Skip to content

Instantly share code, notes, and snippets.

@CRTified
Created January 4, 2022 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CRTified/50dc0586b6a0dc1c3f8d23e8bf896783 to your computer and use it in GitHub Desktop.
Save CRTified/50dc0586b6a0dc1c3f8d23e8bf896783 to your computer and use it in GitHub Desktop.
esphome config for hama 4AC 4USB Power Strip (00176574)
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