From 06bb60c9b7861c072deabc58fa6a2a2a4c1f2dff Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 26 Feb 2019 15:09:29 +0100 Subject: [PATCH] Add teckin page --- devices/sonoff.rst | 21 +++++++++++-- devices/sonoff_4ch.rst | 2 +- devices/teckin.yaml | 68 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 devices/teckin.yaml diff --git a/devices/sonoff.rst b/devices/sonoff.rst index cf3ea2c6b..ebf3aa160 100644 --- a/devices/sonoff.rst +++ b/devices/sonoff.rst @@ -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 `__ + See Also -------- diff --git a/devices/sonoff_4ch.rst b/devices/sonoff_4ch.rst index f57fd2b40..bb6380145 100644 --- a/devices/sonoff_4ch.rst +++ b/devices/sonoff_4ch.rst @@ -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 `. If you additionally want the buttons to control the relays, look at `the complete Sonoff 4CH -with automation example `__. +with automation example `__. .. figure:: images/sonoff_4ch_result.png :align: center diff --git a/devices/teckin.yaml b/devices/teckin.yaml new file mode 100644 index 000000000..7a71625b9 --- /dev/null +++ b/devices/teckin.yaml @@ -0,0 +1,68 @@ +esphome: + name: '' + platform: ESP8266 + board: esp01_1m + +wifi: + ssid: '' + 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