I have used yaml code as stated below, but notices that sending message ‘on’ repeatedly, I actually toggle between ‘ON’ and ‘OFF’ status. Though sending that message would put sonoff device on ‘ON’ status only?
on_message:
- topic: esp_pow1_To
payload: 'on'
then:
- switch.toggle: relayandled
- mqtt.publish:
topic: esp_pow1_From
payload: "On"
- topic: esp_pow1_To
payload: 'off'
then:
- switch.toggle: relayandled
- mqtt.publish:
topic: esp_pow1_From
payload: "Off"