Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retain Switch status ESPHome after reboot and update / Ethernet setup
#5
(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
Reply


Messages In This Thread
RE: Retain Switch status ESPHome after reboot and update / Ethernet setup - by S.Krans - 10-20-2024, 09:38 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)