Axis camera component

I don’t think this implementation is right for the door bird, it is a standardization for camera surveillance. But I haven’t checked the api specification of the doorbird so what do I know… :wink:

https://www.doorbird.com/downloads/api_lan.pdf?rev=0.16 there is a monitor request stream. Would this work? I am not that fancy with code though :slight_smile:

Its a simpler (different) stream than used for the metadata stream. I think it wouldn’t be too hard for someone savvy to add support for it in hass.

/R

I’ll try and see how far i can get with it… because this would solve my GET issue :wink:

1 Like

Ugh, i just found out that the monitor stream only monitors the motion sensor and the doorbell. It does not monitor the “open door” command from the app. Gues i’ll have to think of something else in the meantime :slight_smile:

p.s. the doorbird also announces on axis. I grabbed a bonjour browser…

That sucks :confused:

Hmm, a lot of companies using the same bonjour ID, don’t know if I should limit identification to Axis MAC addresses.

@donnib it seems that they will downgrade docker python to 3.5 for next release

I am running Python3.6 and I have the same issue. I am running in a Python virtualenv on an rpi. I tried copying the file to give it the new name, but I still get

2017-06-01 13:09:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component axis
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/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/local/lib/python3.6/site-packages/homeassistant/components/axis.py”, line 162, in setup
if not setup_device(hass, config):
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/axis.py”, line 170, in setup_device
from axis import AxisDevice
File “/home/homeassistant/.homeassistant/deps/axis/init.py”, line 1, in
from .stream import MetaDataStream
File “/home/homeassistant/.homeassistant/deps/axis/stream.py”, line 2, in
import gi # pylint: disable=import-error
ModuleNotFoundError: No module named ‘gi’

Worth noting, I see your folder is under your user home and the directory structure looks different… My gi is installed here /usr/lib/python3/dist-packages/gi

This particular error is that the gi folder doesn’t exist inside your virtual environment.

understood - but I have created the appropriate symlink

pi@raspberrypi:/srv/homeassistant/lib/python3.6/site-packages $ ls -lha gi
lrwxrwxrwx 1 homeassistant nogroup 33 May 31 01:31 gi → /usr/lib/python3/dist-packages/gi

How does it look if you move inside the venv?

The same

(homeassistant) homeassistant@raspberrypi:/home/pi$ ls -lha /srv/homeassistant/lib/python3.6/site-packages/gi
lrwxrwxrwx 1 homeassistant nogroup 33 May 31 01:31 /srv/homeassistant/lib/python3.6/site-packages/gi → /usr/lib/python3/dist-packages/gi

(homeassistant) homeassistant@raspberrypi:/home/pi$ ls -lha /srv/homeassistant/lib/python3.6/site-packages/gi/
total 628K
drwxr-xr-x 6 homeassistant nogroup 4.0K May 31 03:58 .
drwxr-xr-x 38 root root 4.0K May 31 03:58 …
-rw-r–r-- 1 root root 2.1K Sep 29 2014 _constants.py
-rw-r–r-- 1 root root 6.6K Sep 29 2014 docstring.py
-rw-r–r-- 1 root root 2.1K Sep 29 2014 _error.py
-rw-r–r-- 1 root root 246K Sep 29 2014 _gi.cpython-34m-arm-linux-gnueabihf.so
-rw-r–r-- 1 root root 246K May 31 03:36 _gi.cpython-36m-arm-linux-gnueabihf.so
drwxr-xr-x 3 root root 4.0K May 31 03:58 _gobject
-rw-r–r-- 1 root root 2.2K Sep 29 2014 importer.py
-rw-r–r-- 1 root root 4.5K Sep 29 2014 init.py
-rw-r–r-- 1 root root 13K Sep 29 2014 module.py
-rw-r–r-- 1 root root 13K Sep 29 2014 _option.py
drwxr-xr-x 3 root root 4.0K May 31 03:58 overrides
-rw-r–r-- 1 root root 15K Sep 29 2014 _propertyhelper.py
drwxr-xr-x 2 root root 4.0K May 31 03:58 pycache
-rw-r–r-- 1 root root 766 Sep 29 2014 pygtkcompat.py
drwxr-xr-x 3 root root 4.0K May 31 03:58 repository
-rw-r–r-- 1 root root 9.6K Sep 29 2014 _signalhelper.py
-rw-r–r-- 1 root root 14K Sep 29 2014 types.py

If those are the correct paths, then I am unsure what else can be done. The error message is clearly that hass doesn’t see the gi folder, which suggests an issue with the packages.

I’ve written a small app in the axis package that I hope could help with identify possible solutions, but it’s only a hypothesis so far since no one has used it yet :). It can be found as dependencies.py in https://github.com/Kane610/axis

I’m sorry that I can’t be of more immediate help :confused:

@Robban I moved over to a new install of Raspbian and installed HASS with the Raspberry Pi All-In-One Installer, so have the component up and running :slight_smile:

My setup:
P3301 with firmware 5.50.5 and Axis VMD V2.2
M3204 with firmware 5.50.3.6 Axis VMD V2.2

However, only the camera and sound works, perhaps the AXIS M1004-W has different commands to the mine?

- camera #works
- vmd3 #no sensor shows
- sound #works
- motion #no sensor shows
# - input # errors, see below
- daynight #no sensor shows
- tampering #no sensor shows  

2017-06-03 21:52:32 ERROR (MainThread) [homeassistant.loader] Unable to find component sensor.axis 2017-06-03 21:52:32 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform sensor.axis: Platform not found. 2017-06-03 21:52:36 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: <axis.AxisEvent object at 0xaf34b7ec> is not JSON serializable

Great!

  • For both VMD and motion you need to manually add motion detection windows on your cameras, you do that through the gui or API.
  • For VMD it currently only works with the version 3 (which my camera runs), will need to do something smarter here, to solve your situations and for future versions since apparently V4 is out aswell…
  • Inputs, yeah I managed to not set it to a correct sensor type (sensor instead of binary sensor) so it will unfortunately break, I have a new PR in review that will fix this issue
  • daylight is related to the PIR sensor I think, so it won’t show up
  • Tampering, didn’t try it out too much earlier, will look in to it when I have the time

Possible work around for VMD and Input: you can edit your local version (I think here) /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/axis.py.
For Vmd change all the references of vmd3 from 3 to 2 on lines 285-288
For input change sensor to binary_sensor on line 314

@Robban ok thanks, I have already added motion detection windows to VMD so will try the workaround. Many thanks :slight_smile:

Yea, it still doesnt find gi… now what is super crazy odd is that last night, I was using the ios app at around 1am to connect to my system remotely and I had a picture from the camera from the axis component shown. Awesome. I thought maybe there was some issue w/ loading the dependency that time resolved. Tried it this AM and evening and no image. Super confused…

The camera isn’t really dependent on the gi folder, but in the first version I require gi earlier than really needed making the camera break as well, I have a PR in review that will fix this.

Another user managed to solve his issues using the dependency script here (https://github.com/Kane610/axis/blob/master/dependencies.py)

/R

hmm i just tried 0.46 and python says 3.6.

So looks like my problem, whatever is solved. I restarted HASS yesterday and now the camera is showing consistently,… Can’t really explain why.