markbergsma / pimatic-hue-zll

Pimatic integration with Philips Hue (ZLL)
GNU General Public License v2.0
7 stars 4 forks source link

Integrating HUE Motion Sensor #13

Open quintz opened 8 years ago

quintz commented 8 years ago

Hi

I just bought my first Hue Motion Sensor and was wondering if it is integratable into the Hue Plugin (because it is kind off related to hue lights)? Or is there any other way to implement it into pimatic?

Cheers Quintz

sweebee commented 8 years ago

Dont know If its possible, but it isnt very usefull because it doesnt support Some kind of socket. You can only poll the bridge.

quintz commented 8 years ago

I have searched about polling the bridge, but didn't find anything useful. Do you maybe have a link for me, with a "how to"?

sweebee commented 8 years ago

This plugin polls the bridge. Polling = look every x seconds if something has changed. Minimum is 8 seconds if I'm correct. So the bridge doesn't send a message to pimatic, pimatic has to look if something has changed.

So in worst case scenario, it takes 8 seconds for pimatic to detect the motion. So if you use it with a homeduino light, it will go on 8 seconds after you entered the room.

renemathieu commented 7 years ago

Actual I found it quite useful. The motion sensor should switch the lights on via hue bridge. Now I can handle with pimatic some rules. Example: Lights are switched on (motion is detected) and a power switch is also activated. Now I can change the lights via a rule to "working scene". Otherwise stay in standard scene. This works also with a delay of 8s for me. So, if possible, why not integrate it?

sebster6 commented 7 years ago

I'd like to chime in with this request, especially since the motion sensor includes a temperature sensor as well (which would be awesome to use in Pimatic). Any chance of implementing this?

sebster6 commented 7 years ago

Just as a little followup, this is how the motion sensors responds to an API GET call of its temperature sensor ("temperature" being the Celsius value, in this case 17,43°C):

{ "state": { "temperature": 1743, "lastupdated": "2016-12-26T11:51:08" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue temperature sensor 1", "type": "ZLLTemperature", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:xx:xx:xx:dc:c6-02-0402" }

Unfortunately, I don't know how to add this to the supported devices in the plugin. :( I'm hoping for the original developer to add it, it would be a great sensor addition!

markbergsma commented 7 years ago

Yes, I do have plans to add sensors support (motion & temperature), even though it will have to be polled from the bridge indeed.

But it will probably be a while before I'll be able to get to this; I've been very busy for a while now and it's not looking like that will improve soon.

sebster6 commented 7 years ago

It's great to hear you plan to implement sensor support! Maybe somebody with some more time on their hand (and coding skills) can help with implementation...

acefed commented 7 years ago

Good to hear this feature is added to the backlog!

The creators of Homey (Athom, https://www.athom.com/en/) made a node.js Hue app which supports the sensor devices, including the Hue Motion Sensor. I know it's a different situation, because Homey receives signals, so there's probably less need to poll, but... their code might be useful as an example for Pimatic.

More info: https://github.com/athombv/nl.philips.hue