Hello, I have followed several posts here and this video from The Hookup @ https://www.youtube.com/watch?v=31IyfM1gygo
The problem is that when I reboot the system, the switches go on, even if they were off previous to the reboot. I thought this shouldn’t have been the case by following the configuration.
On a service restart, say from within the Hassio Server Management page or via command line, the switches won’t go on.
So is my understanding incorrect or is something incorrectly configured?
My configuration.yaml
is as follows:
switch:
- platform: mqtt
name: "Office TV"
command_topic: "cmnd/sonoffofficetv/POWER"
state_topic: "stat/sonoffofficetv/POWER"
availability_topic: "tele/sonoffofficetv/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
Using the console on the Sonoffs, I entered the following, per the video:
switchretain off
buttonretain on
buttonretain off
poweronstate 3
powerretain on
I turn off the devices via Home Assistant - toggle to off
In the Sonoff console, I see the following:
15:48:31 MQT: stat/sonoffofficetv/RESULT = {"POWER":"OFF"}
15:48:31 MQT: stat/sonoffofficetv/POWER = OFF (retained)
So the setting seems to ‘set’ to OFF and retained, but after the reboot
15:51:42 MQT: Connected
15:51:42 MQT: tele/sonoffofficetv/LWT = Online (retained)
15:51:42 MQT: cmnd/sonoffofficetv/POWER =
15:51:42 MQT: stat/sonoffofficetv/RESULT = {"POWER":"ON"}
15:51:42 MQT: stat/sonoffofficetv/POWER = ON (retained)
The switch goes on. Huh?!?
What am I doing wrong or what isn’t properly configured?