Skip to content
Permalink
main
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
substitutions:
name: "athom-sw04"
friendly_name: "Athom SW04"
project_name: "athom.sw04"
project_version: "1.0"
light1_restore_mode: RESTORE_DEFAULT_OFF
light2_restore_mode: RESTORE_DEFAULT_OFF
light3_restore_mode: RESTORE_DEFAULT_OFF
light4_restore_mode: RESTORE_DEFAULT_OFF
esphome:
name: "${name}"
name_add_mac_suffix: true
project:
name: "${project_name}"
version: "${project_version}"
esp8266:
board: esp8285
restore_from_flash: true
api:
ota:
logger:
baud_rate: 0
web_server:
port: 80
wifi:
ap: {} # This spawns an AP with the device name and mac address with no password.
captive_portal:
dashboard_import:
package_import_url: github://athom-tech/athom-configs/athom-sw04.yaml
binary_sensor:
- platform: status
name: "${friendly_name} Status"
# Touch Buttons
- platform: gpio
pin:
inverted: true
number: GPIO12
name: "${friendly_name} Button 1"
disabled_by_default: true
on_multi_click:
- timing:
- ON for at most 0.5s
- OFF for at least 0.2s
then:
- light.toggle: light1
- timing:
- ON for at least 4s
then:
- button.press: restart_button
- platform: gpio
pin:
inverted: true
number: GPIO3
name: "${friendly_name} Button 2"
disabled_by_default: true
on_click:
max_length: 0.5s
then:
- light.toggle: light2
- platform: gpio
pin:
inverted: true
number: GPIO5
name: "${friendly_name} Button 3"
disabled_by_default: true
on_click:
max_length: 0.5s
then:
- light.toggle: light3
- platform: gpio
pin:
inverted: true
number: GPIO16
name: "${friendly_name} Button 4"
disabled_by_default: true
on_click:
max_length: 0.5s
then:
- light.toggle: light4
sensor:
- platform: uptime
name: "${friendly_name} Uptime"
button:
- platform: restart
id: restart_button
name: "${friendly_name} Restart"
output:
# Relays
- platform: gpio
pin: GPIO13
id: relay1
- platform: gpio
pin: GPIO4
id: relay2
- platform: gpio
pin: GPIO15
id: relay3
- platform: gpio
pin: GPIO14
id: relay4
light:
- platform: status_led
name: "${friendly_name} Status LED"
disabled_by_default: true
pin:
number: GPIO0
inverted: true
# Relays
- platform: binary
name: "${friendly_name} Light 1"
id: light1
output: relay1
restore_mode: ${light1_restore_mode}
- platform: binary
name: "${friendly_name} Light 2"
id: light2
output: relay2
restore_mode: ${light2_restore_mode}
- platform: binary
name: "${friendly_name} Light 3"
id: light3
output: relay3
restore_mode: ${light3_restore_mode}
- platform: binary
name: "${friendly_name} Light 4"
id: light4
output: relay4
restore_mode: ${light4_restore_mode}
text_sensor:
- platform: wifi_info
ip_address:
name: "${friendly_name} IP Address"
disabled_by_default: true