Hue light / motion sensor reading

Hello everybody!

Im currently trying to utilize a Hue light / motion sensor to determine if my ‘dumb’ bathroom light (in a room with no windows) is on or off by interpreting the ambient light detected from the Hue sensor and displaying it with a simple switch. Im currently at step 1 of the process: Getting data off the Hue sensor. I run openHAB 2.4 with the Hue 2.4 binding. My config is as follows:

hue.things

Bridge hue:bridge:1 "Hue Bridge" @ "Livingroom" [ ipAddress="xyz", userName="xyz" ] {
	0106 light-level-sensor "Sensor" @ "Bathroom" [ sensorId="5" ]
}

hue.items

Number:Illuminance LightLevelSensorIlluminance "Lichtstärke [%s lx]" { channel="hue:0106:light-level-sensor:illuminance" }

default.sitemap

Text item=LightLevelSensorIlluminance

I don’t get a reading displayed and I’m not sure why, this is basically the demo setup from the binding documentation.

I also am uncertain about the reading interval of the sensor, my guess right now is that the light sensor only updates the reading if the motion sensor is triggered. Is that true and if so, is there a way to manually trigger the motion sensor to refresh the reading via openHAB?
I’m sure it’s possible someway because you can actually do exactly that during the setup of HomeKit after adding a Hue Bridge to determine which sensor is in which room.

Would be glad to hear from someone who has worked with the Hue sensors before and can give me some insight. Thanks in advance!

Your item configuration is missing bridges name. In your case “1”. Please try:

{ channel="hue:0106:1:light-level sensor:illuminance" }

See “1:” added between" 0106" and “light-level-sensor”.

Here’s a link to hue binding docs thing configuration section. There you can see that the polling intervall for sensors is 500ms.

1 Like

Understandable mistake since the documentation is in error. :grinning:

I’ll create a PR to update the Hue binding docs (since I was already in the process of adding a few other clarifications).

5 Likes

Created a PR…

2 Likes

Thanks for the help Miika & Ron! Also thanks for creating a PR so quickly.

I got it working, here is my final config for anyone interested:

hue.items

Number:Illuminance Sensor_Bathroom_Illuminance "Lichtstärke [%s lx]" (Sensors, Bathroom, Light_Bathroom_All) { channel="hue:0106:1:light-level-sensor:illuminance" }
Switch	Light_Bathroom_Toggle "Badezimmer" <light>	(Lights, Bathroom, Light_Bathroom_All)

hue.rules

rule "Light_Bathroom_Toggle"
when
    Item Sensor_Bathroom_Illuminance received update
then 
    val lux = (Sensor_Bathroom_Illuminance.state as QuantityType<Number>)
    if (lux > 10){
        Light_Bathroom_Toggle.postUpdate(ON)
    }
    if (lux < 10){
        Light_Bathroom_Toggle.postUpdate(OFF)
    }
end
2 Likes

Please mark this topic solved.

And it is not possible to trigger sensor polling manually. The binding handels it internally. You can only set the intervall as described in the documentation link I provided. And IMO, there’s no need to lower it from the default value so the bridge wont “choke up” with too fast polling.