Axis camera component

Wondering if it’s possible to set this up with cameras that are using LTE. Is there anyway to update the IP address for cameras to reach external networks, maybe in the yaml file?

Im not exactly sure what you’re asking here

What do you mean update IP address for cameras to reach external networks? Wouldn’t it be a real IP?

Right now the integration only updates the IP address of the device if the config entry is updated which currently can only happen when different discovery protocols report a new IP.

Hi

I have an AXIS camera (Q1615) outside my LAN. I have setup a reverse SSH tunnel so I can reach it as if it was local. However I do not want to see the live image in HA as it takes too much bandwidth (camera is behind a 4G router).
Is it possible to disable the live stream, and only use the integration to send request to the camera ? I would like for instance to activate and deactivate some virtual inputs (currently I have an HTTP request like /axis-cgi/virtualinput/deactivate.cgi?schemaversion=1&port=1)

Thanks for your support !

You can disable select entities as you wish

Robban, have you had a chance to look into the implementation of the PTZ commands and preset positions for the Axis cameras? And forcing MJPEG stream configuration?
I just added a feature request, which I forgot to do in June…
Many thanks!

You actually did ;).

Its on my todo but I have some way to go to rework the library first as I want to reach a better approach to it before I extend the integration.

Hello all!

Release notes of the Axis integration coming with Home Assistant 2024.3.0

The big change coming with this release is a more or less totalt rewrite of the Axis backend interfacing with the devices. I have tested it as good as I can and validated towards multiple variations of firmware and device variants. But still there might be cases I haven’t caught, so please if you can try out the beta track with your Axis devices.

Cheers!

/Robban


For feature requests of the integration post an issue at Axis github

I’m on Github Sponsors if you appreciate my work.

2 Likes

Robban, I wonder if you have found time to work on the Axis integration?..
Just so as you know, I just found that the last firmware 9.80.55 is not worlking with the Axis integration for the M3104-LVE camera (it might be due to the latest cybersecurity updates added?)… I had to downgrade to 8.40.37. It might work though with the 9.80.49 firmware, I didn’t tested it…
Many thanks!

Yes, 2024.3.0 have the full library refactoring in place, there are some issues with it Im working on. Next step is to improve the integration so it has a good structure to build on, will also need to look at better handling of https, mqtt, web sockets and similar things.

Wish I saw this before upgrading HA. I put to use ONVIF for this cameras for now and its so slow compared to axis API…

Can you enable debug and provide logs I will try to get a release out tonight

Fix for missing parameters reported AXIS integration broken from last HA update · Issue #112550 · home-assistant/core · GitHub has been published and aims to be out with 2024.3.1

1 Like

Robban, I can confirm you that none of the 9.80.xx firmware versions work with the M3104-LVE camera, only the latest 8.40.37 works.
Best regards and many thanks.

Ok, do you get any errors? Its good to know that it doesn’t work, but without the output I can’t really help you

In the integration I just see that the camera is not available and the card doesn’t show anything. The log shows the following:

Logger: homeassistant.components.axis
Source: components/axis/device.py:272
integration: Axis (documentation, issues)
First occurred: 17:13:53 (1 occurrences)
Last logged: 17:13:53

Error connecting to the Axis device at 192.168.131.18

I also saw another error that might be more helpful:

Logger: homeassistant.config_entries
Source: config_entries.py:504
First occurred: 17:14:55 (8 occurrences)
Last logged: 18:38:29

Error setting up entry axismola3 for axis
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/axis/__init__.py", line 21, in async_setup_entry
    api = await get_axis_device(hass, config_entry.data)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/axis/device.py", line 261, in get_axis_device
    await device.vapix.initialize()
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/vapix.py", line 144, in initialize
    await self.initialize_api_discovery()
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/vapix.py", line 162, in initialize_api_discovery
    await asyncio.gather(*[api.update() for api in apis if api.supported])
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/interfaces/api_handler.py", line 126, in update
    obj_ids = await self._update()
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/interfaces/api_handler.py", line 115, in _update
    objects = await self._api_request()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/interfaces/port_management.py", line 31, in _api_request
    return await self.get_ports()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/interfaces/port_management.py", line 36, in get_ports
    return GetPortsResponse.decode(bytes_data).data
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/models/port_management.py", line 221, in decode
    data=Port.decode_to_dict(data["data"]["items"]),
                             ~~~~~~~~~~~~^^^^^^^^^
KeyError: 'items'

I hope these will help?
Thanks

Thanks. That will be fixed with 2024.3.1

1 Like

Robban, Perfect! I’m glad it was helpful. By the way, will you add the PTZ commnands and preset positions? Thanks!

At some point in time. But I will not give any promise in terms of expected delivery

Hello all! 2023.3.1 is out where I’ve fixed a bunch of different things reported as not supported by devices, thanks to you all for providing debug data!

There might be more issues hidden behind what Ive fixed before but I try to fix them as quickly as possible.

I just updated from 2023.12.x to 2024.3.1 and the Axis Component did show an error. I completely removed it and tried to add the camera again but the camera cannot be added and it shows “Unknown error”.
In the log I see:

Logger: aiohttp.server
Quelle: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
Erstmals aufgetreten: 12:36:09 (3 Vorkommnisse)
Zuletzt protokolliert: 12:39:33

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 91, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 25, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 68, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 72, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 197, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 111, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 359, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 405, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 502, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/axis/config_flow.py", line 72, in async_step_user
    serial = device.vapix.serial_number
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/vapix.py", line 114, in serial_number
    return self.basic_device_info["0"].serial_number
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/vapix/interfaces/api_handler.py", line 164, in __getitem__
    return self._items[obj_id]
           ~~~~~~~~~~~^^^^^^^^
KeyError: '0'

Edit: Found the corresponding issue: Axis still broken after upgrading to 2024.3.1 · Issue #113513 · home-assistant/core (github.com)
As a temporary workaround, using the root login did work as I only have one camera here.

1 Like