Coder Social home page Coder Social logo

homeassistant_custom_components's Introduction

Home Assistant custom components

Home Assistant

Shinobi

Shinobi is an open source cctv solution.

To enable this component, first copy custom_components/shinobi inside your Home Assistant config directory and add the Shinobi component and platform, for example in configuration.yaml. See https://shinobi.video/docs/api on how to get your api_key and group_key. The ssl param is optional and defaults to false. The white- and blacklist is also optional and defaults to all active monitors being considered. Only one filtering method can be applied at the same time. For now, the name assigned in Shinobi is used to filter cams.

…
shinobi:
  host: <your-cams_ip or hostname>
  api_key: <api_key>
  group_key: <group_key>
  ssl: false

camera:
  - platform: shinobi
    whitelist: 
      - cam0_name
    blacklist: 
      - cam1_name
      - cam2_name
…

At the moment, all configured and activated cameras (in state, Record or Watch-only, see https://shinobi.video/docs/settings) are fetched and added to Home Assistant as MjpegCamera. For this to work, the stream type has to be set to mjpeg in shinobi (in the individual camera settings, for all cameras that should be displayed in HA, still preview is working fine anyway if the jpeg API is enabled [default in shinobi]) No additional packages have to be installed.

Updated for versions after 0.85 of Home Assistant

TODO

  • figure out which camera platform is working best for this (Shinobi allows to switch between different stream output configs, atm only mjpeg is supported as described above)
  • add movement detection as (binary?) sensors
  • add ptz control (as switches? I have not yet seen a good solution in HA, anybody who can help please drop some lines)

homeassistant_custom_components's People

Contributors

felixsteghofer avatar sretalla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homeassistant_custom_components's Issues

Camera.Shinobi

Good afternoon,

I have implemented Shinobi via docker (moeiscool) and have Shinobi configured to Shinobi and your configuration recommendations.

While attempting to connect Shinobi to hass, I get the following error upon restart

Unable to find component camera.shinobi

I have added the two files to custom_components so I am not sure what else I can do to fix. Please advise. Thank you!

Ideas for more funtionality

I really like this custom component, would be great if it could be an official HA component in the future.
I have an idea on how to integrate PTZ into the component:

The Shinobi API allows for control of the PTZ of a camera using this http://xxx.xxx.xxx.xxx/[API KEY]/control/[GROUP KEY]/[MONITOR ID]/[ACTION] where [ACTION] is the control you want to execute e.g. left, right etc.

A way to integrate this would be to have those actions as HA events. Users would then have to create scripts to execute these actions - this could be displayed nicely in the new Lovelace UI with entity-buttons.

sequence:
- event: cam_ptz
    event_data:
    entity_id: device_tracker.paulus
    event_id: left

I don't code so this is an idea that may be terrible! Thanks for reading.

Also I think motion as a binary_sensor would be great!

Detected I/O inside the event loop

I've configured the Shinobi Custom Component as per recommendations in the guide and my home assistant never finishes initializing web services.

shinobi:
  host: 192.168.1.222:8080
  api_key: adeadfed13adeadfed13
  group_key: deadbeef96
  ssl: false

camera:
  platform: shinobi

I can use the cameras inside Home Assistant. I can see and add still pictures from the cameras to my dashboard. All other integrations are failing when I add the Shinobi custom component. The logs are telling me to report the issue to the custom component author for Shinobi. Here are relevant logs.

Jun 28 14:42:19 raspberrypi hass[3905]: 2020-06-28 14:42:19 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform solaredge is taking over 10 seconds.
2020-06-28 14:42:23 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for shinobi doing I/O at custom_components/shinobi/__init__.py, line 79: req = requests.get(api_base + api_path, timeout=DEFAULT_TIMEOUT)
:42:23 raspberrypi hass[3905]: 2020-06-28 14:42:23 ERROR (SyncWorker_17) [homeassistant.components.octoprint] Endpoint: printer Failed to update OctoPrint status. Error: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: //192.168.1.251:80/api/printer (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x649af170>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Jun 28 14:42:23 raspberrypi hass[3905]: 2020-06-28 14:42:23 ERROR (SyncWorker_17) [homeassistant.components.octoprint] Endpoint: job Failed to update OctoPrint status. Error: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: //192.168.1.251:80/api/job (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x649af770>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Jun 28 14:43:09 raspberrypi hass[3905]: 2020-06-28 14:43:09 ERROR (MainThread) [homeassistant.components.sensor] Setup of platform solaredge is taking longer than 60 seconds. Startup will proceed without waiting any longer.

When I remove the configuration.yaml entries for Shinobi, all other services operate properly.

Possibly related, I am using Poseidon stream type for encoding because it is more compatible with other services. However, still pictures are operating properly and I would expect streaming to simply fail when accessed from Home Assistant Shinobi Custom Component if this was the cause.

Component not loading after upgrade to 0.91 +

I had the component working well up to the point of upgrade.

I found a reference to the breaking change:
https://community.home-assistant.io/t/breaking-changes-in-0-91/109772

I tried the suggested remedy, but have been unable to make it work, still getting this in the logs on startup:
2019-04-09 15:43:58 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.shinobi.camera. Make sure all dependencies are installed Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 183, in _load_file module = importlib.import_module(path) File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/config/custom_components/shinobi/camera.py", line 9, in from homeassistant.components.camera.mjpeg import (CONF_MJPEG_URL, CONF_STILL_IMAGE_URL, MjpegCamera) ModuleNotFoundError: No module named 'homeassistant.components.camera.mjpeg'

I have the structure:
`custom_components
└── shinobi

   └── __init__.py   (copy of shinobi.py from custom components)

   └── camera.py  (copy of shinobi.py from the camera subdir)

   └── shinobi.py   (copy of shinobi.py from custom components)`

Anything more I can do to help identify what needs changing or to help testing?

The following components and platforms could not be set up - home assistant v0.91.4

I copied the whole custom_components/ folder in Home Assistant's config folder
I added the below in configuration.yaml and restarted home assistant.

shinobi:
  host: 192.168.23:8080
  api_key: xxyDJ6jgqhodSBsuut1EzPsZvsvdsC1QHJe
  group_key: 1WyMdsvcdsvdsEoZY1W

I got a message saying:

The following components and platforms could not be set up:
shinobi
Please check your config

In the logs, it says:

Log Details (ERROR)
Mon Apr 22 2019 08:10:30 GMT+0300 (Eastern European Summer Time)
Setup failed for shinobi: Component failed to initialize.

I removed ":8080" from host: and restarted home assistant again.

Again I got a message saying:

The following components and platforms could not be set up:
shinobi
Please check your config

I am using home assistant v0.91.4
I'm I doing something wrong?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.