This OH2 problem is driving me crazy. I have an Item “Darkness” that is defined as follows
Contact Darkness "Darkness [MAP(darkness.map):%s]" {mqtt="<[mqtt:dpie3/din8/down:state:CLOSED],<[mqtt:dpie3/din8/up:state:OPEN],<[mqtt:dpie3/din8/state:state:CLOSED:down],<[mqtt:dpie3/din8/state:state:OPEN:up]"}
I can see in the events.log that the Item changes when the relevant mqtt messages are received. My problem is that rules that should trigger on the change of the item does not trigger. I did also add a cron time rule, just to see that the rules file is read and that the item is working. See the code below:
rule "Dummy"
when
Item Darkness changed
then
logInfo("dummy", "Darkness changed")
end
rule "Cron"
when
Time cron "*/5 * * * * ?"
then
logInfo("dummy", "Darkness state is "+Darkness.state)
end
This is the output in the openhab.log when I change the value of Darkness (by sending the relevant MQTT message):
2017-10-20 14:53:50.004 [INFO ] [eclipse.smarthome.model.script.dummy] - Darkness state is CLOSED
No trace of the “Darkness changed” printout.
Similar questions on this forum seems to relate to wrong naming of the rules file, or incorrect item binding. But I do see the item change in the event log.
This is driving me crazy! Please help!!