mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-11-03 09:00:28 +01:00
72 lines
1.2 KiB
YAML
72 lines
1.2 KiB
YAML
esphome:
|
|
name: '<NODE_NAME>'
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
|
|
logger:
|
|
# Disable UART logging (pins GPIO1/3 are used for button/led)
|
|
baud_rate: 0
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
|
|
ota:
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: "Teckin Button"
|
|
pin:
|
|
number: GPIO1
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
inverted: true
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
id: blue_led
|
|
pin:
|
|
number: GPIO13
|
|
inverted: true
|
|
- platform: gpio
|
|
name: "Teckin Relay"
|
|
pin: GPIO14
|
|
id: relay
|
|
on_turn_on:
|
|
- switch.turn_on: blue_led
|
|
on_turn_off:
|
|
- switch.turn_off: blue_led
|
|
|
|
# Use red LED for connectivity status indicator
|
|
status_led:
|
|
pin:
|
|
number: GPIO3
|
|
inverted: true
|
|
|
|
sensor:
|
|
- platform: hlw8012
|
|
sel_pin:
|
|
number: GPIO12
|
|
inverted: true
|
|
cf_pin: GPIO04
|
|
cf1_pin: GPIO05
|
|
# Higher value gives lower watt readout
|
|
current_resistor: 0.00221
|
|
# Lower value gives lower voltage readout
|
|
voltage_divider: 871
|
|
current:
|
|
name: "Teckin Current"
|
|
accuracy_decimals: 2
|
|
voltage:
|
|
name: "Teckin Voltage"
|
|
power:
|
|
name: "Teckin Power"
|
|
update_interval: 15s
|