I have created an app that supports ONVIF compatible video cameras. The cameras have to support the following requirements:
- S and T profiles of the ONVIF specification,
- Provide a snapshot URL to obtain a JPEG snapshot,
- Support Pull points for motion capabilities. (version 0.0.22 adds WS_BasicEvents, also knows as Push points, but is not fully tested).
The main differences between this app and the Homey IP camera support is discovery and motion detection.
There are two snapshot views for each camera, the ‘live’ image and one at the point that the last motion was detected (or delayed by a user specified amount after the motion detection). Motion will also generate a trigger for flows and both snapshots are available as tags to be used with other action cards. That allows you to send the image to your phone, etc.
I will attempt to publish it so just need to see if Athom will allow it.
The app is now live. The release version is here:
Sometimes the maybe test version available here:
Not all cameras support motion detection via ONVIF, even if they have motion detection capabilities. Sometimes this is because the manufacture actually does the motion detection offline rather than in the actual camera. Other times it is just because they have not implemented the Pull Points part of the specification.
Cameras known to be test so far:
- H.View HV-E800
- Unbranded HI3516EV200
- FOSCAM FI9900EP V5 (does not support motion detection via ONVIF)
- DBPOWER hd Cam: chinese cheep outdoor cam full HD, already included in Homey, immediately recognise and working with your app, I did not test the motion alarm yet
- IMOU IPCG22: new full HD outdoor cam, already included in Homey, IP recognise but it returns the following error - Cannot read property ‘width’ of undefined
- EBITCAM F220: outdoor full HD cam, IP not recognised - I’m pretty sure this cam needs a token to grab a snapshot so it my be not usable with your app
- Dahua DH-SD22204t-GN-W and Dahua HDBW1320E are working with version 0.0.22.
- Neo CoolCam NIP-55 working
- HiKam S6 does not have a still image URL so not possible to show either image in Homey.
- Chinese unbranded DG-MYQ, motion works but no image URL.
- Eminent EM6330 camera’s are working but No ONVIF motion detection.
- Milesight 360 panoramatic
If you have experience with other cameras that either fully work, partially work or don’t work please reply to this topic with the details and I will updated the list.
To add a camera, use the standard add device method of Homey.
During the process the app will discover all the ONVIF cameras on you LAN and show the list to you. This can take about 15 seconds so please be patient.
Once the list is displayed you can select one camera to add and then tap Next. You will see the screen to enter the camera login credentials ( note some cameras have different credentials for ONVIF and standard access). Enter the details and the select Next. The app will try to login to the camera to verify the credentials and if all goes well the camera will be added.
If you have any issues then the app has a Diagnostics Log feature that can be switched on in the Apps - Configure app section:
Switch the logging on by ticking the LOG ENABLED option. The setting is remembered through app restarts so it can be used to log the complete startup process.
The log is limited to 15kB at which point it will reset and start again. Logging will add extra load to Homey so it is recommend not to keep it switched on all the time.
You can clear the log if required by taping on Clear Log and you can send the log to me by taping on Send Log. You will see a confirmation message before sending the log. Only the information in the log window is sent and there is no identifiable information included so if you are reporting a problem then please contact me either on here, via a PM or on GitHub to follow up on the problem.
The app looks like this:
Image from the last motion event (drop list set to MOTION EVENT)
Image from last snapshot (drop list set to NOW). This can be refreshed at any time by pressing the round arrows below the image.
It is possible to enable / disable the motion detection here (the image shows motion detection switched off): When the motion is switched off, the trigger will not activate and the image will not update.
You can view the current state of the alarms, etc:
The OFFLINE alarm is triggered if the app has recently lost communication with the camera. It can take up to about 30 seconds to detect. After about 1 to 2 minutes the app shows ‘Not Available’.
This could mean the camera has been disconnected or maybe the IP address has changed. If the IP address has changed you can use the Repair option to redetect the camera.
The CAMERA TIME is the time reported by the camera. However the Event times are taken from Homey.
Taping on the cog (top right of the images) takes you to the settings screen:
Here are the standard Name and Zone settings plus you can open the Advanced settings:
The User Name and Password are the credentials required to log into the camera via ONVIF. Check you camera settings to make sure this has been setup.
Has Motion: is detected during the pairing process but you can override it here if you believe it is incorrect. Note that the camera must support ONVIF PullPoint’s and motion detection on the camera for this to work so activating the option for a camera that does not support the feature will not make it work. (Removed form version 0.0.20 onwards)
Single: when set, this option determines if just one snapshot per new trigger is captured, e.g. the trigger has to be cleared by the cammer before another image is captured. if it is not set then an image is captured each time a new motion event is triggered even if the last one is still active.
Delay: this is the time before the image is captured after the trigger is enabled. Some cameras are very sensitive and will trigger before the person has fully entered the image, in which case you might only get the edge of them.
Override ONVIF snapshot URL with: You can enter any URL into here to instead of the one specified by the camera during pairing. Most cameras report the correct URL but it seems a few will provide a URL that does not work so you change it here. It is also possible to capture an image from a different camera if that is what you want. Leave the setting empty to use the default URL. (Removed form version 0.0.20 onwards)
Add Authorization header: When set to Yes, the app will generate HTML headers with the Authorization header set with the login details. If you see that the ONVIF URL does not contain a user name and password then it is a good indication that this needs to be switched on. (Removed form version 0.0.20 onwards)
Time format: allows you to choose from a few options for the time and date shown on the alarms view. The default is Short HH:MM DD-MM which is a format that fits the space provided by the view on most phones.
The last section shows information about the camera provided during pairing.
The Maintenance screen has an option to set the cameras time to the same as Homey and and option to run the repair routine:
Motion image is ready within… flow condition
This Condition card can be added to the AND section of the flows. It allows you to wait for the image to be capture before running the Action cards.
So to use it you would first trigger the motion capture with the relevant Action card in a flow. This might be in response to an external motion sensor for example. Then in another flow that is triggered by, say, the doorbell button press for example, you would add this card to the And section to make sure the image is ready to send to your phone, etc by the Action cards.
- First beta release.
- Complete re-write of the discovery process as some cameras required authentication to obtain some of the basic information.
- Added a log page to the Configure app button in the Apps - ONVIF section of Homey. This provides debug information to help solve any issues with specific cameras.
- Extra error traps to reduce crashes.
- Improves reconnecting to a camera that has been offline,
- Added Repair feature to reconnect a camera when the IP address or login details have changed,
- Added a button to the Log screen to send the log to me.
Version 0.0.20 / 0.0.21
- Added Digest Authorization with auto detection when none, Basic, Digest headers are required.
- Partial implementation of ONVIF Basic WS_Notifications (push events).
- New flow trigger card for ‘Motion Image Ready.
- Updated push event method
- Added motion alarm to device tile.
- Added option to switch between push and pull events when both are available.
- Tidy up of switching events on and off.
- Added retries to event image capture.
- Implemented Push Events Refresh instead of unsubscribing and subscribing.
- Now detects IsTamper event and set the ‘Offline / Tamper alarm’.
- Optimised network timeout for pull events.
- Re-enable events when camera comes back online.
- Made device class settable between camera and sensor in Advanced Settings.
- Optimized libraries to considerably reduce the size of the app.
- Extra diagnostics and possible fix for invalid video source object
- Extra diagnostics for connect camera function
- Added German, Dutch and Italian.
- Try getSystemDateAndTime with credentials if it fails without.
- Moved camera offline check to the app to smooth out processor demand when lots of cameras are added.
- Filter out devices that are not proper ONVIF cameras from search
- Fixed case where the password was appearing in the log.
- Fixed issue with Sync Time function.
- A bad snapshot URI is rechecked during the camera check.
- Fix crash when Sync. Time fails
- Send log change for better reliability
- Added a few more checks for bad data from cameras.
- Changed order of images so the ‘Now’ image is the default when the section is selected.
- Added “Motion image is ready within…” flow condition
- Deprecated “Update Now snapshot” flow action
- Added “Update Motion snapshot” flow action.
- Motion image available even when camera does not support it so that the flow trigger can update it.