83 lines
1.7 KiB
YAML
83 lines
1.7 KiB
YAML
substitutions:
|
|
device_name: "sonofbasic-02"
|
|
friendly_name: "sonofbasic-02"
|
|
comment: "esp8266"
|
|
location: "Tuin"
|
|
api_password: !secret SonofBasic-02_api
|
|
ota_password: !secret ota_password
|
|
wifi_ssid: !secret wifi_ssid
|
|
wifi_password: !secret wifi_password
|
|
gateway: !secret ip_gateway
|
|
subnet: !secret ip_subnet
|
|
ip: !secret SonofBasic-02_ip
|
|
pin_status: GPIO13
|
|
pin_relay: GPIO12
|
|
pin_button: GPIO0
|
|
|
|
# GPIO0 Button (inverted)
|
|
# GPIO1 TX pin (C1 Pin 2)
|
|
# GPIO3 RX pin (C1 Pin 3)
|
|
# GPIO12 Relay
|
|
# GPIO13 Green LED (inverted)
|
|
# GPIO14 Optional Sensor (C1 Pin 5)
|
|
|
|
packages:
|
|
board: !include boards/esp8266_sonofBasic.yaml
|
|
device_base: !include common/common.yaml
|
|
connection: !include common/wifi_noportal.yaml
|
|
status: !include templates/status.yaml
|
|
logger: !include templates/logger.yaml
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: ${pin_button}
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
inverted: true
|
|
name: "Sonoff Basic Button"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff Basic Relay"
|
|
pin: ${pin_relay}
|
|
id: relay
|
|
|
|
status_led:
|
|
pin:
|
|
number: ${pin_status}
|
|
inverted: yes
|
|
|
|
|
|
# esphome:
|
|
# name: sonofbasic-02
|
|
# friendly_name: sonofbasic-02
|
|
|
|
# esp8266:
|
|
# board: esp01_1m
|
|
|
|
# # Enable logging
|
|
# logger:
|
|
|
|
# # Enable Home Assistant API
|
|
# api:
|
|
# encryption:
|
|
# key: "48SvU7npQIluo9PR6xGOmOsXoAKyr7kX1YYjLEXful8="
|
|
|
|
# ota:
|
|
# password: "1900b4474c00a32b76ddc2c550857eff"
|
|
|
|
# wifi:
|
|
# ssid: !secret wifi_ssid
|
|
# password: !secret wifi_password
|
|
|
|
# # Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
# ap:
|
|
# ssid: "Sonofbasic-02 Fallback Hotspot"
|
|
# password: "aUsjAjSOix4j"
|
|
|
|
# captive_portal:
|
|
|