I have a Philips hue light - Switch icon=“light” label=“Hal lamp boven” item=1EHAL
I have a fibaro Motion sensor - Switch item=0EHALMOTION label=“Motion” icon=“switch”
When I trigger motion I see the switch changing on my sitemap
I can switch the hue light on and off without any problems
I’m trying to adapt the example rule “how-to-turn-on-light-when-motion-detected-and-is-dark”
that is not working for me (nothing happens)
so I simplified it to:
rule "HalLichtAan"
when
Item 0EHALMOTION changed from OFF to ON
then
{
sendCommand(1EHAL, ON)
}
end
Still not working
Events.log:
2016-12-12 21:51:18.496 [ItemStateChangedEvent ] - 0EHALMOTION changed from OFF to ON
2016-12-12 21:51:18.497 [ItemStateChangedEvent ] - zwave_device_36dce47a_node5_sensor_binary changed from OFF to ON
2016-12-12 21:51:48.922 [ItemStateChangedEvent ] - zwave_serial_zstick_36dce47a_serial_sof changed from 38685 to 38686
2016-12-12 21:51:48.924 [ItemStateChangedEvent ] - 0EHALMOTION changed from ON to OFF
2016-12-12 21:51:48.925 [ItemStateChangedEvent ] - zwave_device_36dce47a_node5_sensor_binary changed from ON to OFF
What I’m I doing wrong?
Do I need to import something, do I need to restart openhab2 after I made changes??
On my site map I have a switch representing my motion detector
When it detects movement the switch on de sitemap goes on and after a minute or so it goes off
I’m new to this and maybe I’m missing something small or I miss the concept.
Way is order on the site map important? Can’t I have a rule that uses the motion sensor without it being present on the sitemap?
Below the total content of my item, sitemap and rule file
My *.item file
Group ALLE
Group gLampen (ALLE)
Group gLampenStaan
Group gLampenHal
Group:Switch:OR(On,OFF) gLampen "alle lampen" (all)
Group:Switch:OR(On,OFF) gLampenStaand "alle staande lampen"
is invalid syntax. You have to put the elements in the correct order. However, I’m not certain that is true any more. The fact you see anything indicates that may not be true any more.
Absolutely. You do not have to put your Items on a sitemap to access them in rules.
You are trying to use Items in your sitemap that do not exist in your .items file. Are these Items that were created using PaperUI or Habmin? Presumably so.
The curly brackets on in the rule are not needed.
Add a log statement to the rule and watch openhab.log to verify the rule is triggering. It should be.
If the rule isn’t triggering it most likely means that the motion sensor is not changing from OFF to On. Try loosening the trigger to just “changed” or “received update” and add an if statement to the rule to check if it is ON. Then work backwards to make the trigger more restrictive once you know what is happening.