Created
January 4, 2022 16:55
-
-
Save CRTified/50dc0586b6a0dc1c3f8d23e8bf896783 to your computer and use it in GitHub Desktop.
esphome config for hama 4AC 4USB Power Strip (00176574)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: hamabase | |
platform: ESP8266 | |
board: esp8285 | |
wifi: | |
ssid: WiFi SSID | |
password: WiFi PW | |
fast_connect: True | |
logger: | |
ota: | |
web_server: | |
port: 80 | |
sensor: | |
- platform: wifi_signal | |
name: "WiFi Signal" | |
update_interval: 60s | |
binary_sensor: | |
- platform: gpio | |
pin: | |
number: GPIO3 | |
inverted: true | |
internal: true | |
id: power_button | |
on_click: | |
- switch.toggle: power | |
switch: | |
- platform: template | |
name: "Power" | |
id: power | |
lambda: |- | |
return (id(relay1).state) || | |
(id(relay2).state) || | |
(id(relay3).state) || | |
(id(relay4).state) || | |
(id(relayUSB).state); | |
turn_on_action: | |
- switch.turn_on: relay1 | |
- switch.turn_on: relay2 | |
- switch.turn_on: relay3 | |
- switch.turn_on: relay4 | |
- switch.turn_on: relayUSB | |
turn_off_action: | |
- switch.turn_off: relay1 | |
- switch.turn_off: relay2 | |
- switch.turn_off: relay3 | |
- switch.turn_off: relay4 | |
- switch.turn_off: relayUSB | |
on_turn_on: | |
- light.turn_on: status | |
on_turn_off: | |
- light.turn_off: status | |
- platform: gpio | |
pin: GPIO05 | |
name: Socket 1 | |
id: relay1 | |
- platform: gpio | |
pin: GPIO04 | |
name: Socket 2 | |
id: relay2 | |
- platform: gpio | |
pin: GPIO12 | |
name: Socket 3 | |
id: relay3 | |
- platform: gpio | |
pin: GPIO13 | |
name: Socket 4 | |
id: relay4 | |
- platform: gpio | |
pin: GPIO14 | |
name: USB | |
id: relayUSB | |
light: | |
- platform: binary | |
id: status | |
output: ledlink | |
name: "Status LED" | |
internal: true | |
output: | |
- platform: gpio | |
pin: GPIO01 | |
id: ledlink | |
inverted: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment