I’ve been working with getting push notifications from Axis devices (www.axis.com), and have a basic component available that would hope you guys would be interested in trying out. My goal is to get this integrated into home assistant when I’m satisfied with the level of integration this component delivers.
name (Optional): The Axis device’s name to display in the front end
host (Optional): The Axis device’s IP address. Default is 192.168.0.90
username (Optional): The Axis device’s username. Default is root
password (Optional): The Axis device’s password. Default is pass
location (Optional): The Axis device’s physical location.
include (Required):
camera (Optiona):
motion (Optiona): Motion detection sensor
pir (Optiona): PIR sensor
audio (Optiona): Audio sensor
Observe that it is not recommended to keep the root users password as default
and for all features in this component there are no need to expose a user above
viewer privileges (might change with development).
Possible additional features:
Additional sensor support: Input ports, Day night state for IR lights,
Live stream access, tampering, recording and storage alerts
Triggering of output ports and relays
Light control
Media player platform for TTS to speaker
Audio stream from camera for voice control
Opening up more stuff, some things aren’t clearly defined at gitlab it seems. Have tried in a browser without being logged in and I can now download the repository
I have M3005 cameras and testing this. Do i change in config file to m3005?
When i run “ln -s /usr/lib/python3/dist-packages/gi /srv/homeassistant/lib/python3.4/site-packages” i get access denied error. Im new to this. Do you know what I’m doing wrong?
I now gett Invalid Config in HASS and pointing to axis.
Could I ask you how your are monitoring/pulling the metadatastream is there a way of capturing this. I use axis cameras a lot through work and have a couple on the house so I’m really interested in this add on.
Although slightly off topic I need to monitor the metadatastream for a project at work, so wondering if you could point me In The right direction?
I tried to install the component but since it’s the first time i install a custom component i run into issues.
I am running Home Assistant in a docker container.
I created a folder custom_components and places the axis.py and the two folders binary_sensor and camera into it so it looks like this
config
custom_components
axis.py
binary_sensor
camera
but i get a problem it can’t load or find the component :
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up input_boolean
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up updater
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up verisure
2017-05-19 13:28:11 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.axis. Make sure all dependencies are installed
Traceback (most recent call last):
File “/usr/src/app/homeassistant/loader.py”, line 141, in get_component
module = importlib.import_module(path)
File “/usr/local/lib/python3.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 673, in _load_unlocked
File “”, line 673, in exec_module
File “”, line 222, in _call_with_frames_removed
File “/config/custom_components/axis.py”, line 15, in
from axis import AxisDevice
ImportError: No module named ‘axis’
2017-05-19 13:28:11 ERROR (MainThread) [homeassistant.loader] Unable to find component axis
2017-05-19 13:28:11 ERROR (MainThread) [homeassistant.setup] Setup failed for axis: Component not found.
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up discovery
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up config
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up logbook
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up tts
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up zeroconf
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up device_tracker
2017-05-19 13:28:11 INFO (MainThread) [homeassistant.setup] Setting up ios
Failed config
General Errors:
- Component not found: axis
- Setup failed for axis: Component not found.
Successful config (partial)
I also tried to create a folder named axis inside custom_components and then place the files/folders there but it still won’t work.
since the path does not exist in the docker container i have or i don’t know what it is here, i don’t know if this is the reason it doesn’t load the component so any help would be great
So it sounds like you have put the files in the right place but can’t find the place where hass has got its package installs. Observe! Those paths are just suggestions, they may differ on different systems and setups.
To simplify debugging I’d suggest wait till tomorrow when the component will be part of the release. Then we only need to care for making sure that hass can find the gi package.
If I get the time I will have a look on docker as well
@Robban thx for getting back. I installed the newest docker image 0.45 where the component should be part of it. I did following :
Run apt-get update
Run apt-get install python3-gi gir1.2-gstreamer-1.0
Run ln -s /usr/lib/python3/dist-packages/gi /usr/local/lib/python3.4/site-packages
Restarted the docker image but the gi can’t be found, see log bellow.
Any ideas what i am doing wrong ?
2017-05-22 10:50:51 ERROR (MainThread) [homeassistant.setup] Error during setup of component axis
Traceback (most recent call last):
File “/usr/src/app/homeassistant/setup.py”, line 188, in _async_setup_component
None, component.setup, hass, processed_config)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/axis.py”, line 162, in setup
if not setup_device(hass, config):
File “/usr/src/app/homeassistant/components/axis.py”, line 170, in setup_device
from axis import AxisDevice
File “/usr/local/lib/python3.6/site-packages/axis/init.py”, line 1, in
from .stream import MetaDataStream
File “/usr/local/lib/python3.6/site-packages/axis/stream.py”, line 2, in
import gi # pylint: disable=import-error
ModuleNotFoundError: No module named ‘gi’
2017-05-22 11:16:01 ERROR (MainThread) [homeassistant.setup] Error during setup of component axis
Traceback (most recent call last):
File “/usr/src/app/homeassistant/setup.py”, line 188, in _async_setup_component
None, component.setup, hass, processed_config)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/axis.py”, line 162, in setup
if not setup_device(hass, config):
File “/usr/src/app/homeassistant/components/axis.py”, line 170, in setup_device
from axis import AxisDevice
File “/usr/local/lib/python3.6/site-packages/axis/init.py”, line 1, in
from .stream import MetaDataStream
File “/usr/local/lib/python3.6/site-packages/axis/stream.py”, line 2, in
import gi # pylint: disable=import-error
File “/usr/local/lib/python3.6/site-packages/gi/init.py”, line 42, in
from . import _gi
ImportError: cannot import name ‘_gi’
That seems to be some internal issue with gi. Possibly related to python 3.6/Docker.
I will need to set up an environment for this and investigate this. Will probably test with both a 3.6 as well as Docker (first time for me). Sorry for the inconvenience!
So I’ve been able to look in to this a little bit, and it seems that the version of gi available on raspbian does not support python3.6, which is a shame.
I’m gonna mention for @balloob that there might be other external dependencies that doesn’t work with python3.6 out of the box.
Anyway, I’m gonna try to build a newer version of gi to see if I can get it to work at all with python3.6. But that is probably gonna take a few days since this is not something I know very well.
In the mean time if you wanna use the Axis component I guess you would need to not use the Docker together with python3.6.