Relay mode randomly reverts to default
Closed this issue · 11 comments
Using the latest firmware, I am having issues where the relay mode, which I have set to Switched, will (for seemingly no reason) change itself back to the factory default of ‘Always On’. All other settings appear to be retained properly when this occurs, and the HTTP server does reflect that the settings have changed back to ‘Always On’. I have been having to use the web interface to change the relay mode back to my preferred setting each time this happens. Please advise.
Interesting. Default value is Switched, so I'm not sure why it would be reverting automatically to Always On. I'm not seeing anything in the code that is even capable of changing the value. Did you flash a precompiled bin.gz file or compile the firmware yourself in the ESPHome dashboard? Is it only happening at boot or randomly while the switch is on? Maybe you could leave the logs open and try to see what the logs say whenever the configuration changes to always on.
If you compiled in this file, then it will always go to always_on at boot since this yaml file depends on home assistant services to turn a light on or off instead: https://github.com/KaufHA/kauf-rgb-switch/blob/main/yaml-features/rotate-colors-sync-to-ha-light.yaml
You can add stay_switched: 'true'
to the substitutions section of your yaml and it will stay switched instead of reverting.
That is the only modification I made and must be responsible for the change. I will add the substitution, thanks!
Yea, that would do it.
It does beg the question as to why it would be rebooting at random, but that's another question entirely.
Are you connected to Home Assistant? If not you need to turn on the No HASS switch to stop it from rebooting.
I am, or at least should be, connected to Home Assistant. It's been running and stable for some time.
Then I guess leave the logs open and see if you can catch it rebooting. It should give a reason. If not I can have you enable more debug code.
I've just made the stay_switched: 'true'
substitution and set a static IP to rule out possible networking issues as a cause (as much as is reasonably possible, anyway). I will let you know if any issues persist!
I really appreciate your quick response to the issue and am really enjoying the new switch!
After about 30 minutes it appears that the rolling log simply drops old data -- FIFO. Is there a way to extend this period?
Not sure how to do this through the web interface. Are you still having issues with reboots? I think you can scroll up further if you view logs through the ESPHome addon instead of through the web interface on the device itself.