[SOLVED] Motion sensor & expire binding

Hi All,

I have a hue motion sensor, which switches from OFF to ON when it detects motion and afterwards it turns to off. It switches a light on for 3 minutes

Ideally, it would reset the timer for the motion sensor as long as someone is in the room (motion sensor detects motion all the time and switches from OFF to ON vice versa - the motion sensor does not stay ON all the time). So it should start the 3 minutes again all the time it detects motion.

With the following code, I am able to switch on the light, but it does not reset the timer.

items:

Switch EG_kue_motion_presence "presence [%s]" <motion> { http="&lt;[EG_kue_motion_presence:5000:JS(getHuePresence.js)]" }

Switch EG_kue_motion_presence_timer { expire="3m,state=OFF" }

rules:

rule "Kitchen Motion"
when
    Item EG_kue_motion_presence changed to ON
then
    EG_kue_motion_presence_timer.postUpdate(ON)
    if (EG_kue_li_decke.state != ON && EG_kue_motion_daylight.state == OFF) EG_kue_li_decke.sendCommand(ON)
end

rule "Kitchen Lights Timer"
when
    Item EG_kue_motion_presence_timer changed to OFF
then
    if (EG_kue_li_decke.state == ON) EG_kue_li_decke.sendCommand(OFF)
end

Anyone who could advise, what I am doing wrong.

Thanks in advance.
Dom

You need to use sendCommand to activate a binding.

rule "Kitchen Motion"
when
    Item EG_kue_motion_presence changed to ON
then
    EG_kue_motion_presence_timer.sendCommand(ON)
    if (EG_kue_li_decke.state != ON && EG_kue_motion_daylight.state == OFF) EG_kue_li_decke.sendCommand(ON)
end