Hello,
this is a question surely answered before, but I could not find it.
I have a sonoff power socket that is controlled via mqtt. It has a topic that publishes information ( stat/sonoff/POWER) and a topic that is suscribed to my openhab2 instance (cmnd/sonoff/POWER). Moreover, I have concted Alexa with the openhab cloud.
Both work fine on their own. If I turn on the plug using paper UI I can turn it off using Alexa, but if I turn it on with Alexa (or manually by pressing the button on the power socket) it does not get updated in openhab and I have to turn the switch on and off again.
Here are my Item and sitemap declarations:
Group Home "Zuhause" <house>
Group LivingRoom "Wohnzimmer" <sofa> (Home)
Switch LivingRoom_Power "Fernseher" <poweroutlet> (LivingRoom, gPower) ["Switchable"] {mqtt=">[mybroker:cmnd/sonoff/power:command:ON:1],>[mybroker:cmnd/sonoff/power:command:OFF:0]"}
Switch LivingRoom_Power "Fernseher" <poweroutlet> (LivingRoom, gPower) {mqtt="<[mybroker:stat/sonoff/POWER:state],<[mybroker:cmnd/sonoff/POWER:state]"}
Group:Switch:OR(ON, OFF) gPower "Steckdose" <poweroutlet> (Home)
sitemap zuhause label="Zuhause" {
Frame {
Group item=LivingRoom
}
}
Thanks for your help!!