The fact that you don’t see the logging implies the rule isn’t firing.
I’d also say that your motion sensor has an ON and OFF value rather than a OPEN or CLOSED value. Contact is more for window or door sensors. In fact, your log shows it is receiving ON or OFF, so you should probably use a switch then instead of a contact?
You could also try the rule as:
rule "Test motion sensor in spare room"
when
Item SpareRoom_Motion_Sensor changed
then
logInfo("_rule_","SpareRoom_Motion_Sensor")
// You have to see the above in the log, otherwise it means the
// rule was never triggered with the described condition.
if (SpareRoom_Motion_Sensor.state == ON)
{
SpareRoom_Dimmer.sendCommand(0)
}
end
Please note that the Designer has been deprecated is not part of the release anymore.
Yes
Than the rule doesn’t run.
For searching the problem you can define the items in a sitemap and changing the switch manually.
We know only that part of your configuration you have posted. Your z-wave definition und your items don’t match. If is’t a item you can use for example
Item zwave_device_46feb3ec_node11_sensor_binary changed to ON
You have already created the items through the paper UI.
Remove the SpareRoom_Motion_Sensor from you items file.
and try:
rule "Test motion sensor in spare room"
when
Item zwave_device_46feb3ec_node11_sensor_binary changed
then
logInfo("_rule_","SpareRoom_Motion_Sensor")
// You have to see the above in the log, otherwise it means the
// rule was never triggered with the described condition.
if (SpareRoom_Motion_Sensor.state == ON)
{
SpareRoom_Dimmer.sendCommand(0)
}
end
Thanks everyone for so many helpful replies.
Changing the item from a contact to a switch solved it. Thanks @SkyyStorm. It is great to finally see my system spring to life, even if it’s just a toy example.
This gives me a working demonstration to further develop from. Hopefully I’ll be able to be independent for a little while at least now. I’m sure I’ll be back though.
Does this really work. If I use it I get an error in log.
I want to get a rule triggered if the thing gets an update but this rule is never triggered. Only difference is, that I use the thing not the item.
when
Thing zwave_device_15a7a49f3a6_node3 received update
then
...
2018-03-14 10:08:23.011 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'einstellungen.rules' has errors, therefore ign
oring it: [20,3]: no viable alternative at input 'zwave_device_15a7a49f3a6_node3'
This one will work, but never triggered:
when
Thing 'zwave_device_15a7a49f3a6_node3' received update
then
...
even if a log message indicates this:
2018-03-14 10:06:42.146 [me.event.ThingUpdatedEvent] - Thing 'zwave:device:15a7a49f3a6:node3' has been updated.
The triggers for rules are things channels and items not the things themselves, I don’t think that’s possible.
Define an item for a channel of the thing and use the item to trigger the rule.
@hr3
Thanks for teh reply. Can you guide me what I should do:
Should I do this? Without any channel? Because I cannot use a channel because this channel is not triggered only the thing itself. and if yes w hich item type should I user?
My problem is, that I want to detect z-wave devices which are no longer sending datas.
For all of them I check battery item update event date. I get this configured for mostly all of my devices that they send this latest every 6h. Only for devices from aeon this is not relyable. They report battery item update randomly.
To detect item update on door open/close event does not fix it too because some doors are opened only some times a year. And event then I will notice or not, that the sensor does not report any more.
Hopefully it is clear what I want to reach.
In habmin I can see the last wakeon time, but don’t know how to get this into a rule.
yes, this will work for me too. But the thing is not changed, it is only updated
Changed is only from online to offline. And the device stays online even if it does not report any longer.
Only relyable from my point of view is to catch this message in a rule: But my rule does not get fired
2018-03-14 10:06:42.146 [me.event.ThingUpdatedEvent] - Thing 'zwave:device:15a7a49f3a6:node3' has been updated.
none of this works:
when
Thing 'zwave_device_15a7a49f3a6_node3' received update or // from habmin
Thing "zwave_device_15a7a49f3a6_node3" received update or // from habmin
Thing 'zwave:device:15a7a49f3a6:node3' received update or // from log
Thing "zwave:device:15a7a49f3a6:node3" received update // from log
then
...