My Axis Camera (Companion Cube LW) does not support ONVIF, so using the current Axis component does not work for me. In order to still get some support out of it, I leverage their HTTP(s) notification action inside their Events functionality to have the camera push custom defined events from the camera to HomeAssistant.
This allows me to trigger events in HomeAssistant from my camera without needing ONVIF.
Setup (Axis):
Go to the “Events” section of your Camera’s UI, and create a Recipient called HomeAssistant configured as HTTP (or HTTPs depending on how your HASS instance is set up):
Configure your Action rule to whatever criteria you desire, and specify the Action to send a Notification to the Recipient we created above.
In the “Custom Parameters” field, define the following mandatory parameters:
- api_password=<YOUR HASS API PASSWORD>
- name=<WHAT YOU WANT YOUR CAMERA TO BE CALLED IN HASS>
- type=<WHAT TYPE OF EVENT YOU WANT TO SEND>
You can also add any of the optional parameters: time, ip, short_mac, mac, preset_number, preset_name, termperature, video_source, pan_coordinate, tilt_coordinate
Axis has a long list of modifiers in their help docs that let you send device-specific information like IP address, etc.
Once the rule is configured in Axis, drop axis_event.py in your custom_components folder and add “axis_event:” to your configuration.yaml
If configured correctly, when the rule is triggered on your Axis camera, it will fire off an event in HomeAssistant: axis_event.<hostname>.<type>
You can then use the events to trigger your automation in HomeAssistant. I personally set it up to notify me when the Camera notices motion.
Hope you guys enjoy it!
Sample Automation: (Sample camera parameters: name=living_room, type=motion)
https://gist.github.com/iamtpage/78b7c34536f6b660da9d674195c9b356