Raspberry PI Openhab 3
MQTT binding 3
My channel “mqtt:topic:b8be661fe1:slaapkamer_wireless_wall_switch:action” can produce 3 strings “single_right”, “single_left” and “single_both”
I can see this in my event.log
2021-01-20 22:18:14.821 [INFO ] [openhab.event.ChannelTriggeredEvent ] - mqtt:topic:b8be661fe1:slaapkamer_wireless_wall_switch:action triggered single_left
How do i use this in a rule to react to one of the values?
The rule below gives no error , but its not working
//Wireless 2 button switch
rule "lamp on/off"
when
Channel "mqtt:topic:b8be661fe1:slaapkamer_wireless_wall_switch:action" triggered
then
var actionName = "receivedEvent.getEvent"
switch(actionName) {
case "single_left": {
StudeerkamerHuewhite_Dimmer.sendCommand(100)
logInfo("test", "Light ON")
}
case "single_right": {
StudeerkamerHuewhite_Dimmer.sendCommand(0)
logInfo("test", "Light OFF")
}
}
end
How do i get the value off my channel in my variable “actionName”