Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retain Switch status ESPHome after reboot and update / Ethernet setup
#1
Information 
Hi  

if i update the boards A64 / A128 the outputs does not retain their status so if i have switch-1 on and reboot the switch-1 goes off




i run ESPHome true Home Assistant and run the automations true node-red is there a possibility to have it retain the previous state before reboot or update



Also i want to use my ethernet but it wont connect 


Code:
esphome:
  name: kincony-kc868-a64-rk
  friendly_name: Kincony KC868-A64-RK

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxx"

ota:
  password: "xxx"
  platform: esphome

#wifi:
#  ssid: !secret wifi_ssid
#  password: !secret wifi_password

#  # Enable fallback hotspot (captive portal) in case wifi connection fails
#  ap:
#    ssid: "Kincony-Kc868-A64-Rk"
#    password: !secret wifi_ap

#captive_portal:




# Example configuration entry
i2c:
  - id: bus_a
    sda: 5
    scl: 16
    scan: true
    frequency: 400kHz
  - id: bus_b
    sda: 15
    scl: 4
    scan: true
    frequency: 400kHz
   

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

  # Optional manual IP
  manual_ip:
    static_ip: 20.20.20.192
    gateway: 20.20.20.1
    subnet: 255.255.255.0



Thanks in advance
Sijmen
Reply
#2
do you want use KC868-A64 and KC868-A128 work with ESPHome, but need retain the previous OUTPUT state after re power on?
Reply
#3
(10-13-2024, 11:06 AM)admin Wrote: do you want use KC868-A64 and KC868-A128 work with ESPHome, but need retain the previous OUTPUT state after re power on?

Yes

i got both boards
Reply
#4
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
Reply
#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
#6
yes
Reply


Forum Jump:


Users browsing this thread: