If you change the position of the switch, the messages testsw / 1: ON are published. But when I publishes testsw / 1: OFF with another client mqtt, the basic UI switch does not change its position. How do I make the switch position change when I get the publication?
This is because you have not configured an inbound configuration (a subscription to a topic) in OH2 to be able to read the status of the device/switch.
Your item config looks good and it is according to the info that I can find (I don’t use the sonoff myself):
Did status updates work before? maybe you changed something recently in your system?
“Long shot” note: If you recently upgraded your Mosquitto MQTT Broker Server to version 1.4.12, you may have a problem with the clientID naming.
But on the other hand… sonoff-977686 does not include ‘#’, ‘+’, or ‘/’ and you can send on/off commands… so this must not be the root-cause…
See: http://mosquitto.org/2017/05/security-advisory-cve-2017-7650/
So does not work either. At the moment I do not use the module. Now I’m studying openhab, switch to BasicUI and track on android MQTT Dashboard, then publish from mobile i monitor the status change in BasicUI
I apologize. I do not understand how status works. The device is connected, this is es8266 + DHT22. If you switch the switch to OpenHAB on other devices, the state will change, but if you switch to a smartphone, the status does not change in openhab and does not update the temperature information, it is updated only after the page reloads. Tell me, what will I miss?
obviously, your ESP code does not accept ON/OFF commands. Only 1/0.
The first version of the item config transforms the ON from openHAB to 1 (this will be mqtt payload that will be published).
You can check the payload in both scenarios using a tool (like MQTT.fx)