From 51b2f58791d5c1ff68050e2e362119e2d7067ba2 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 16 Apr 2025 22:40:29 +0200 Subject: [PATCH] Added switches to sthome-ut1 device --- esphome/data/config/sthome-ut1.yaml | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/esphome/data/config/sthome-ut1.yaml b/esphome/data/config/sthome-ut1.yaml index c6c5d53..99d5e0d 100644 --- a/esphome/data/config/sthome-ut1.yaml +++ b/esphome/data/config/sthome-ut1.yaml @@ -47,3 +47,55 @@ wifi: password: "7SglIlgdkpAD" captive_portal: + +#preferences: +# flash_write_interval: 30s + +switch: + - platform: gpio + pin: + number: GPIO16 + inverted: true + id: relay1 + name: "Relay 1" + icon: "mdi:run-fast" + restore_mode: RESTORE_DEFAULT_OFF + on_turn_on: + - delay: 1000ms + - switch.turn_off: relay1 + + - platform: gpio + pin: + number: GPIO17 + inverted: true + id: relay2 + name: "Relay 2" + icon: "mdi:run-fast" + restore_mode: RESTORE_DEFAULT_OFF + on_turn_on: + - delay: 1000ms + - switch.turn_off: relay2 + + - platform: gpio + pin: + number: GPIO18 + inverted: true + id: relay3 + name: "Relay 3" + icon: "mdi:run-fast" + restore_mode: RESTORE_DEFAULT_OFF + on_turn_on: + - delay: 1000ms + - switch.turn_off: relay3 + + - platform: gpio + pin: + number: GPIO19 + inverted: true + id: relay4 + name: "Relay 4" + icon: "mdi:run-fast" + restore_mode: RESTORE_DEFAULT_OFF + on_turn_on: + - delay: 1000ms + - switch.turn_off: relay4