{"id":588,"date":"2019-11-14T20:53:25","date_gmt":"2019-11-14T20:53:25","guid":{"rendered":"https:\/\/www.flat-planet.net\/?p=588"},"modified":"2019-11-14T20:53:26","modified_gmt":"2019-11-14T20:53:26","slug":"hive-motion-sensor-and-openhab2","status":"publish","type":"post","link":"https:\/\/flat-planet.net\/?p=588","title":{"rendered":"Hive Motion Sensor and OpenHab2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Recently I&#8217;ve started adding ZigBee based devices to my home automation solution &#8211; specifically I&#8217;ve added the Husbzb-1 stick to my setup. This has the benefit of combining both a Z-Wave and Zigbee controller in the same physical device, so I get to be agnostic as to the devices I add.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My next step was to try out a Hive Motion Sensor, for no other reason then there was one in the local store and a quick Google showed that it was Zigbee based.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This device is interesting in terms of form factor &#8211; suits what I was planning quite well, and the channels it provides;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Motion Intrusion (_intrusion) &#8211; Switch<\/li><li>Temperature (_temperature) &#8211; Number:Temperature<\/li><li>Tamper (_tamper) &#8211; Switch<\/li><li>Motion Presence (_motion) &#8211; Switch<\/li><li>Low Battery (_iaslowbattery) &#8211; Switch<\/li><li>Battery Voltage (_batteryvoltage) &#8211; Number<\/li><li>Illuminance (_illuminance) &#8211; Number<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So I actually ended up with more then I expected since neither the illuminance nor the temperature are referenced in any documentation that I can find. I&#8217;ve no clue what the difference between Motion Intrusion and Motion Presence are though &#8211; both seem to trigger at the same time&#8230; will update when I learn more.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The other interesting thing is that on the very first trigger, the state is updated from NULL to ON for presence (_intrusion and _motion), but the sensor itself never seems to trigger a state change to OFF. In order to handle this, I&#8217;ve defined an item, subscribed to the _motion channel, and then a rule to reset it back to off after 5 mins.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nvar Timer vFrontDoor_holdDown  = null\n\nrule &quot;Reset Front Door trigger&quot;\nwhen\n    Item FrontDoorMotion changed to ON\nthen\n    if(vFrontDoor_holdDown === null || vFrontDoor_holdDown.hasTerminated){\n        vFrontDoor_holdDown = createTimer(now.plusMinutes(5), &#x5B;| \n            postUpdate(FrontDoorMotion, OFF)\n            vFrontDoor_holdDown = null\n        ])\n    }\n    else{\n        vFrontDoor_holdDown.reschedule(now.plusMinutes(5)) \n    }\nend\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Recently I&#8217;ve started adding ZigBee based devices to my home automation solution &#8211; specifically I&#8217;ve added the Husbzb-1 stick to my setup. This has the benefit of combining both a Z-Wave and Zigbee controller in the same physical device, so I get to be agnostic as to the devices I add. My next step was [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[379],"tags":[70,364,384,385,386],"series":[],"class_list":["post-588","post","type-post","status-publish","format-standard","hentry","category-openhab","tag-home-automation","tag-openhab","tag-hive","tag-zigbee","tag-hive-motion-sensor"],"_links":{"self":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=588"}],"version-history":[{"count":2,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/588\/revisions"}],"predecessor-version":[{"id":591,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/588\/revisions\/591"}],"wp:attachment":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=588"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}