i would need your help or maybe just a hint.
Would like to migrate my rules from OH2 - all good except my channel triggered rules.
I use this for my zigbee switch.
OH2 rule:
rule "SchalterBüro"
when
Channel "mqtt:topic:mybroker:SchalterBuero:click" triggered
then
var actionName = receivedEvent.getEvent()
switch(actionName) {
case "single": {
Alexa_Buero_RadioStationID.sendCommand("s15547")
}
case "double": {
Alexa_Buero_Radio.sendCommand("OFF")
}
}
end
My issue now is that i am not able to select this channel via the gui:
“a trigger channel fires” i am only able to select my harmony hub activity trigger.
Thanks for your assistance.
I have now splitted the rule and everything is fine:
rule "SchalterBüroMusikEIN"
when
Channel "mqtt:topic:mybroker:SchalterBuero:click" triggered single
then
Alexa_Buero_RadioStationID.sendCommand("s15547")
end
rule "SchalterBüroMusikAUS"
when
Channel "mqtt:topic:mybroker:SchalterBuero:click" triggered double
then
Alexa_Buero_Radio.sendCommand("OFF")
end
I trie to do what you trie to do but as ECMA script. Any idea how this should work?
what i am struggeling with is, how to get the event. i would like to do it with swich case and not in a seperate rule for all six events.