I have a motion sensor setup in my things file
Thing topic BedroomRepeaterNode
{
Channels:
Type switch : MotionSensor "Bedroom Motion Sensor" [stateTopic = "mygateway1-out/200/1/1/0/16", on="1", off="0" ]
}
I was trying to get my motionsensor rule to fire. The log kept saying when motion was detected that the corresponding item (below)
Switch MasterBedroom_MotionSensor_raw (gMotionSensorsRaw) { channel = "mqtt:topic:broker1:BedroomRepeaterNode:MotionSensor" }
Had changed from 0 to 1. and so on.
So I had a rule setup. No matter what though, I couldn’t get said rule to trigger. I tried using changed, updated, updated from [] to [], command ON ect. I even added all the different variations with this or that or this other thing.
Nothing.
But I did figure out that if I added the trigger=true i could get something what would fire.
Thing topic BedroomRepeaterNode
{
Channels:
Type switch : MotionSensor "Bedroom Motion Sensor" [stateTopic = "mygateway1-out/200/1/1/0/16", on="1", off="0", trigger=true ]
}
So then my rule became
rule "testing MotionSensor changed"
when
Channel "mqtt:topic:broker1:BedroomRepeaterNode:MotionSensor" triggered 1
then
This worked. I was able to finish my rule and do more testing. Now, I am trying to stick to using design patterns. So I am trying to bring this in to my group rule.
rule "Raw Motion Sensor State Changed"
when
Member of gMotionSensorsRaw received update // from OFF to ON
then
So there is the problem… i don’t know if channel triggers can be grouped?..
Should i go back to just triggering on item changes? If so… is there something I am missing with the mqtt binding not triggering a rule to fire?
Thanks!