I bought myself a Hue motion sensor, for the measurement of the ambiant light.
Unfortunatly Openhab is unable to find the sensor.
When I look on the Openhab Docs it states it is supported and this tutorial confirms this.
I am running OH2.3 Stable and updated the system through the openhabian-config tool.
Unfortunatly it didn’t help.
I’ve got the feeling the binding should be version 2.4 but is still 2.4, did the update fail or aren’t bindings updated until there is a new 2.4.0 stable version?
I found and testen a 0.10.0.jar version downloaded via a link somewhere in this thread.
But this is a test version, if I.m correct and doesn’t work with my version.
If I need version 2.4.0 binding, where can I find the update file and is it correct that it is just a drop of a .jar file into the addons folder?
The new feature will be part of OH 2.4 which will be released in a few days (December 17th). The linked version (.jar file) will not work with OH2.3. If you cannot wait any longer I recommend to update to a milestone or snapshot version.
I’ve created a hue.map transformation, with the following content:
1000=Button(ON) INITIAL_PRESSED
1001=Button(ON) HOLD
1002=Button(ON) SHORT RELEASED
1003=Button(ON) LONG RELEASED
2000=Button(DIM UP) INITIAL_PRESSED
2001=Button(DIM UP) HOLD
2002=Button(DIM UP) SHORT RELEASED
2003=Button(DIM UP) LONG RELEASED
3000=Button(DIM DOWN) INITIAL_PRESSED
3001=Button(DIM DOWN) HOLD
3002=Button(DIM DOWN) SHORT RELEASED
3003=Button(DIM DOWN) LONG RELEASED
4000=Button(OFF) INITIAL_PRESSED
4001=Button(OFF) HOLD
4002=Button(OFF) SHORT RELEASED
4003=Button(OFF) LONG RELEASED
I’m trying to get rid of the “.0” behind the events received from the Tap and Dimmer switches. (@cweitkamp: may I suggest to fix that in the binding? )
This is my first attempt at using a profile to transform a value received, so I may have misinterpreted the OH2 documentation here.
Indeed, it works without sourceFormat parameter and a transform of for instance ‘16.0=xxx’. It makes me wonder how sourceFormat is supposed to work, but that’s no topic for this Philips Hue sensors thread.
I get that, but I hope it can become part of 2.5 (and of course you could introduce a ‘legacy’ parameter if you want to go all fancy… ).
This could lead to unexpected behaviour, for instance when a button was pressed last night and another event/trigger changed the lights in the mean time.
I see. Nice catch. That happened because the Hue API does not forget. During restart of OH2 the item’s values are NULL and after the first polling of the API they change to last known state.
Question is what can we do? I have a possible solution in my mind. As we are aware of the polling interval we can check against the last_updated timestamp and dispatch the event only if the difference is lower than the polling interval (or twice the polling interval). Wdyt?
I currently have no Items defined for the Tap and Dimmer switches, only rules that trigger when a button press/release event fires. I’m still in testing phase…
The messages shown are generated in the rule with a logInfo function call based on a switch statement.
IMHO a check against twice (or even three times to be very very safe) the polling interval should do the trick. This is a special case and (re)starting OH or loading the binding does not happen in such a short timeframe.
Hey,
thank you for the dimmer switch and motions sensor feature in the Hue Binding.
I’m trying to use the Hue motion sensor in a room to turn on the lights. This is my rule (thank’s to rlkoshak):
var Timer timer = null
rule "Flur Bewegungsmelder"
when
Item Flur_MotionSensorPresence received update
then
if(timer === null || timer.hasTerminated) {
FlurSchalter.sendCommand(ON)
logInfo("Motion Flur", "Bewegung erkannt -> Licht an")
timer = createTimer(now.plusSeconds(30), [ |
timer = null
FlurSchalter.sendCommand(OFF)
logInfo("Motion Flur", "Seit 30 Sekunden keine Bewegung mehr erkannt -> Licht aus")
])
}
else {
logInfo("Motion Flur", "Bewegung erneut erkannt -> Timer verlängert ")
timer.reschedule(now.plusSeconds(30))
}
end
This is a part of my openhab log file:
2019-01-19 19:56:51.906 [vent.ItemStateChangedEvent] - Flur_MotionSensorPresence changed from OFF to ON
2019-01-19 19:56:51.908 [INFO ] [e.smarthome.model.script.Motion Flur] - Bewegung erkannt -> Licht an
2019-01-19 19:56:51.908 [ome.event.ItemCommandEvent] - Item 'FlurSchalter' received command ON
2019-01-19 19:57:21.910 [INFO ] [e.smarthome.model.script.Motion Flur] - Seit 30 Sekunden keine Bewegung mehr erkannt -> Licht aus
2019-01-19 19:57:21.911 [ome.event.ItemCommandEvent] - Item 'FlurSchalter' received command OFF
2019-01-19 19:57:31.184 [vent.ItemStateChangedEvent] - Flur_MotionSensorPresence changed from ON to OFF
2019-01-19 19:57:31.184 [INFO ] [e.smarthome.model.script.Motion Flur] - Bewegung erkannt -> Licht an
2019-01-19 19:57:31.185 [vent.ItemStateChangedEvent] - Flur_MotionSensorLastUpdate changed from 2019-01-19T19:56:51.000+0100 to 2019-01-19T19:57:31.000+0100
2019-01-19 19:57:31.186 [ome.event.ItemCommandEvent] - Item 'FlurSchalter' received command ON
2019-01-19 19:58:01.187 [INFO ] [e.smarthome.model.script.Motion Flur] - Seit 30 Sekunden keine Bewegung mehr erkannt -> Licht aus
My problem is, at 19:56:51 I moved at the room and the light turned on. Im moved around a bit for 20 seconds to update the timer. Then I left the room, but ten seconds (19:57:21) later the light turned off. After this I didn’t went back to the room.
What happens if you stay longer than 30 seconds in the room? Will the light remain on? From my personal feeling you somehow should consider the current state of the Flur_MotionSensorPresence item because a rule triggered by received updated will be invoked for every update independently if it is ON or OFF or whatever.
Hi Christoph,
Thank’s for your help. . When I stay longer in the room, the light will turn off after the first 30 seconds.
But I think if I want to use ON as trigger (“changed to ON”) it won’t work, because when I move around in the room the item won’t change to OFF and then ON…
Is that the goal you want to reach? I guess not. Please correct me if I am wrong but I would wrap up your user-story like this: “When someone enters the room (motion detected) → turn the lights on, after everyone leaves the room (no motion detected) → wait 30s, then turn the lights off.”?
Thus I propose to check for the current states of Flur_MotionSensorPresence. When it changed to ON send ON to your lights, When it changed to OFF start timer, and so on.