10-20-2024, 09:38 AM
(10-14-2024, 10:34 AM)admin Wrote: the switch yaml code you can add "restore_mode" for that.
fox example:
switch:
- platform: gpio
name: "Relay"
pin: GPIO12 # your relay GPIO
id: relay
restore_mode: RESTORE_DEFAULT_ON # or RESTORE_DEFAULT_OFF or ALWAYS_OFF/ALWAYS_ON
here is ESPHome about "restore_mode" setting details: https://esphome.io/components/switch/index.html
So like this
Code:
- platform: gpio
name: "a128-light65"
pin:
pcf8574: pcf8574_hub_out_5
number: 0
mode: OUTPUT
inverted: true
restore_mode: RESTORE_DEFAULT_ON