I have both ESPHome bulbs and shellys running ESPHome on the same fixtures (I want both color/temp changing and detached switches). Sometimes the bulbs misbehave so the shelly’s are set up to toggle the relay if the bulbs aren’t responding. For this reason, I have the bulbs configured to restore_mode: RESTORE_AND_ON so they light when power is turned back on and I don’t have a screaming wife. The problem is, when the bulbs decide to restart in the middle of the night because of API or wifi issues, the lights also turn on and I have a screaming wife.
Is there a way to differentiate between a restart and a power cycle and perform different startup behaviors based on this (i.e. restart: lights do not restore on. power cycle: Lights restore on)? If not, is this something that is possible to implement if I submitted a feature request?
I didn’t know you could create a text sensor for reset reason, so thanks for this. Are there downsides to using the debug level logger like memory use or flash health?
I have an automation but that doesn’t stop the light from turning on immediately after the reboot since it takes a bit to connect.
lol. She’s been pretty cool with it overall but definitely gets annoyed when it doesn’t work. I often remind her that the main reason I got into automation is because she can’t turn off a %&$!ing light in the house (not that we’ve saved any time or money switching to automation)
Ok I’m trying to use on_boot with the reset reason text sensor but I’m having trouble getting to work. I’m guessing there is something wrong with the lambda function?
[15:51:20][D][text_sensor:064]: 'Reset Reason': Sending state 'Software/System restart'
Are you not able to control light color within on_boot?
I am able to turn the lights on/off but it seems to default to a color temp somewhere around around 3500K.
I’ll try to later, I can’t right now. In the meantime, I believe you are getting the error because you probably don’t have debug as the logger level and and the debugger component setup.
See Mahko_Mahko’s comment above, but you don’t need to set up the text_sensor:
adding these should correct the error:
logger:
level: debug ##<---- place under your logger entry
debug: