Add teckin page

This commit is contained in:
Otto Winter 2019-02-26 15:09:29 +01:00
parent 514e0a2c1d
commit 06bb60c9b7
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
3 changed files with 88 additions and 3 deletions

View File

@ -288,7 +288,7 @@ Sonoff S31
GPIO0, Button (inverted),
GPIO12, Relay and Red LED,
GPIO13, Green LED (inverteD),
GPIO13, Green LED (inverted),
See :doc:`/components/sensor/cse7766` for measuring power
@ -309,7 +309,24 @@ Shelly 2
GPIO5, Relay #2,
GPIO12, SW Input #1,
GPIO14, SW Input #2,
Teckin
------
.. pintable::
GPIO1, Button (inverted),
GPIO3, Blue LED (inverted),
GPIO13, Red LED (inverted),
GPIO14, Relay,
GPIO12, HLW8012 SEL Pin (inverted),
GPIO4, HLW8012 CF Pin,
GPIO5, HLW8012 CF1 Pin,
See :doc:`/components/sensor/hlw8012` for measuring power.
Example config: `teckin.yaml <https://github.com/esphome/esphome-docs/blob/current/devices/teckin.yaml>`__
See Also
--------

View File

@ -295,7 +295,7 @@ them in one area, and simply pass that ID later on. For example, above you can s
output being created with the ID ``blue_led`` for the blue LED. Later on it is then transformed
into a :doc:`monochromatic light </components/light/monochromatic>`.
If you additionally want the buttons to control the relays, look at `the complete Sonoff 4CH
with automation example <https://github.com/OttoWinter/esphomedocs/blob/current/devices/sonoff_4ch.yaml>`__.
with automation example <https://github.com/esphome/esphome-docs/blob/current/devices/sonoff_4ch.yaml>`__.
.. figure:: images/sonoff_4ch_result.png
:align: center

68
devices/teckin.yaml Normal file
View File

@ -0,0 +1,68 @@
esphome:
name: '<NODE_NAME>'
platform: ESP8266
board: esp01_1m
wifi:
ssid: '<WIFI_SSID>'
password: '<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_PULLUP
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