here is an easier way of connecting your Sonoff tasmota flashed devices to openhab2 (havent tried it with orginal firmware)
install the http binding
Items.items
Switch Sonoff "Sonoff" { http=">[ON:POST:http://192.168.1.169/cm?user=admin&password=urpassgoeshere&cmnd=Power%%20ON] >[OFF:POST:http://192.168.1.169/cm?user=admin&password=urpassgoeshere&cmnd=Power%%20OFF]" }
the actual http command is
http://192.168.1.169/cm?user=admin&password=urpassgoeshere&cmnd=Power%20ON
i had to add an extra % for it to work cause the % calls for an action and %% to ignore
took me some time to figure this out
sitemap.sitemap
Switch item=Sonoff mappings=[ON="ON", OFF="OFF"]
havent played around with the JSON command to read the state yet
@alokin79 Thank you, it actually took me finding your post to figure out how to escape the spaces. Have you been able to integrate active status polling from the switch? I can display it OK but my openHab interface doesn’t update accordingly, only on manual refresh.
In the sitemap I simply include the Switch with no further formating.
@opus Every new binding requires hours of research. At the moment I’m struggling to get homegear/homematic binding to work so I prefer to keep the rest as simple as possible. From my understanding MQTT would require a separate server to connect?
Please how should be inserted %% or @@ characters on Sonoff POW2 switch (espurna firmware)?
On bash command executes OK.
How should be propperly substitued with %% or @@ characters in rules ?