- Platform information:
- Hardware: Raspberry PI 4
- OS: Raspian
- Java Runtime Environment: JRE 11
- openHAB version: 3
I have setup my sonoff (with Tasmoto firmware) to use the MQTT (version 1.5.7). Situation is that the ‘ON’ command is send to the MQTT topic, but when I switch in openhab the switch back to off, the ‘OFF’ command appears not to be send to the topic.
If I change the custom-on-value to ‘OFF’ (inversing the switch), it is send. It looks like the switch only sends the MQTT command when the item switch is turned on.
Code for the thing/channel:
UID: mqtt:topic:6f14af6b44:757a3400a1 label: V2-SO-Zolderverwarming thingTypeUID: mqtt:topic configuration: payloadNotAvailable: Offline availabilityTopic: tele/V2-SO-ZolderVerwarming/LWT payloadAvailable: Online bridgeUID: mqtt:broker:6f14af6b44 location: Zolder channels: - id: cmndV2SOZolderverwarming channelTypeUID: mqtt:switch label: Zolderverwarming description: "" configuration: postCommand: false retained: false qos: 1 commandTopic: cmnd/V2-SO-ZolderVerwarming/POWER stateTopic: stat/V2-SO-ZolderVerwarming/POWER off: OFF on: ON
Looking at the MQTT using the MQTT explorer:
Start: cmnd and stat POWER is ‘OFF’.
I toggle the switch in openhab to on. MQTT explorer shows the cmnd power is updated to ‘ON’ and the stat power follows directly.
I toggle the switch in openhab to off. MQTT explorer shows the cmnd power is not updated.
Openhab log only states the on command:
2022-03-09 19:54:53.840 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'V2SOZolderverwarming_Zolderverwarming' received command ON 2022-03-09 19:54:53.842 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'V2SOZolderverwarming_Zolderverwarming' predicted to become ON
As I am new to openhab, the first question is: what am I doing incorrect?