Skip to content

Commit

Permalink
Add sonoff-basic template
Browse files Browse the repository at this point in the history
  • Loading branch information
untergeek committed Oct 18, 2024
1 parent dc02e8b commit 60c283b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions template/sonoff-basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# We track the project name and version here in the template
packages:
main: !include
file: ../esphome.yaml
vars:
project_name: untergeek.sonoff-basic
project_version: 1.0.0
chip: !include
file: ../esp8266.yaml
vars:
board: esp01_1m
sync: !include ../time.yaml
togl: !include ../restart_switch.yaml
logs: !include ../logging.yaml

substitutions:
icon: "phu:smart-switch"

switch:
- platform: gpio
id: relay1
name: "${friendly_name}"
pin: GPIO12
restore_mode: RESTORE_DEFAULT_OFF

binary_sensor:
- platform: gpio
internal: true
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "${friendly_name} Button"
on_press:
- switch.toggle: relay1

status_led:
pin:
number: GPIO13
inverted: yes

0 comments on commit 60c283b

Please sign in to comment.