Have you installed the mqtt binding?
If yes, can you post your mqtt.cfg located in your conf/services folder, please?
How do you monitor your mqtt traffic?
No any issues with mqtt. I able control relay from UI. Hardware send “testing/mqtt/topic” and I see ON in UI. When Ichange state in UI - relay on or off. But I can’t control relay via button. Button change state only in UI.
I monitor traffic with mqtt-spy, but it is no mqtt issue. The same behavior for switch on modbus.
So what you are saying is that when you change the switch on the OH UI, you don’t see the message testing/mqtt/back-topic:ON or OFF on mqtt spy, but the UI and the switch state changes when you publish testing/mqtt/topic:ON or OFF on mqtt-spy for testing
When i change switch state via OH UI i see message “testing/mqtt/back-topic” [ON|OFF]
But when my device publish “testing/mqtt/topic” - UI state changed, but OH doesn’t send “testing/mqtt/back-topic” with new state to device. So i can’t control light via button. Only via OH UI.
rule "Test mqtt switch"
when
MQTT_Test_Switch changed
then
if (MQTT_Test_Switch.state == ON) {
MQTT_Test_Light.sendCommand(ON)
} else {
MQTT_Test_Light.sendCommand(OFF)
}
end
This way you separate the behaviours and if you wanted to command something else with that switch then you can change the rule
I guess change binding to command instead state will work. Will test it today.
Config with rule works but i want to understand how to implement it without rules.
Thank, will provide feedback after testing.