There is now a new Beta release of the ZoneMinder Binding available in the marketplace. The most significant changes, since the Binding that ships along with openHAB:
• HttpClient has been changed to use Jetty. This should also address the connectivity issues.
• Performance has been addressed. Both frequency of calls to Zoneminder Server and number of calls pr. Iteration has been significantly reduced. It should now but significantly lower load on the openHAB server.
• Monitor Channels is only updated when something is linked to the channel.
• New channels has arrived: motion
, image
and `video-url’. The latter is only a string, containing the url to the live stream, and is considered experimental.
The motion channel works like a PIR sensor (eg. ON when there is an active alarm based on motion, else OFF).
The image channel exposes a still image . Update frequency is configurable in the settings. It is possible to configure different update frequencies for normal operation, and another when the monitor is alarmed. It should be possible to find some individual setting. Available settings for update in normal operation: ‘disabled’, ’low’, ‘normal’. Settings when alarmed: ‘disabled’, ‘low’, ‘normal’ and ‘alarm’
Where ‘low’ and ‘normal’ is configurable frequencies, ‘alarm’ means every cycle.
With the introduction of images and streams, the ZoneMinder Streaming server is used (zms). This site requires authentication through query parameters in the URL. For the sake of still images the URL isn’t exposed outside openHAB, but still user name and password would be in urlencoded clear text. To deal with that I have looked at the ZoneMinder Hash authentication. By now the following settings is supported
In the ZoneMinder settings dialog on the system tab:
AUTH_RELAY must be set to none. If AUTH_HASH_LOGINS is enabled, then a authentication hash will be generated and used in the URL instead of the password.
In the next build it will also be possible to enabled AUTH_HASH_IPS as long as openHAB server and ZoneMinder server is on the same LAN.
I also plan to allow the usage of a specific streaming user, since the user rights in ZoneMinder can be limited to only allow Streaming.
Since a ZoneMinder monitor can be configured differently. It can be enabled/disabled, function (modect, nodect, monitor,…), With the new channels and the huge amount of possible settings by combining all combinations on how a monitor can be configured, it has become clear to me that there is a ugernt need to update documentation. So this activity will get some attention.
Known problems / issues
• There is some disconnects in the log, but the Binding seems to reconnect again. The root cause needs to be addressed.
• A few exceptions in the log needs to be addressed. Nothing that should affect stability.
• Update of Server channels not omitted when nothing is linked.
• Some enhancements needed to control the channel update in the monitor (Some settings is disregarded right now).
• The scale setting for still images is omitted.
Possible improvements
• Integration PTZ controls
• Support for zmNinja EventServer
I think both of the above improvements will have to wait until a later release, so I will focus on the known problems / issues. The changes already done are so significant that I would like to see these changes ship with openHAB.
I would like to thank @captndelta for sharing code to fetch still images. I would also thank @rbausdorf for helping optimize performance by his testing.