I am relatively new to ESPHome. Currently building my second device, which is a well water level monitoring device utilizing an air pump, an air valve, a pressure sensor and two relays to drive the pump and the valve.
When I use the relays to be powered in OFF state, everything works fine. But when I reverse the logic and have the relays powered in ON state (to save power) the ESP looses crashes and reboots.
Just to be sure it’s a brownout I am hunting down, I thought it would be great to be able to implement a brownout logging.
As there is no direct way to define interrupts in ESPHome, I thought about a lambda which defines the interrupt and registers it in the esp → on_boot section.
Is this possible, or will I overwrite something essential by doing this?
relay LED is switched on / draws current in relay spool
cable is connected to NO and is off from boot on
on event:
ESP changes output.turn_on
delay some seconds
ESP changes output.turn_off
Not working:
on_boot output.turn_on
relay LED is switched off / no current in relay spool
cable is connected to NC and is off from boot on
on event:
ESP changes output.turn_off
delay some seconds
ESP changes output.turn_on
At not working configuration it resets after some event cycles at random time. It’s not really related to switching the relays (or starting / stoping the valve or the pump).