Hello,
I created a Relay node using the new ESPHome (v 1.10). The node itself does not have the functionality to save and restore the state of the relay when the power to NodeMCU cycles (this happens at least a few times in my apartment, I live in India).
Is there a way, I can do this through HomeAssistant. Home Assistant itself is powered through a UPS and never looses power. Here is the config for my ESPHome node.
binary_sensor:
- platform: gpio
pin:
number: D5
inverted: true
mode: INPUT_PULLUP
id: main_geyser_button
name: “Main Geyser Power Button”
on_press:
then:- switch.toggle: main_geyser_relay
switch:
- switch.toggle: main_geyser_relay
- platform: gpio
name: “Main Geyser Relay”
pin: D2
id: main_geyser_relay
restore_mode: RESTORE_DEFAULT_OFF
sensor: - platform: dht
pin: D1
temperature:
name: “Main Bathroom Temperature”
humidity:
name: "Main Bathroom Hum