2021-09-29 02:26:13 +00:00
|
|
|
# Model TGWF115PQM
|
|
|
|
substitutions:
|
|
|
|
board: esp01_1m
|
|
|
|
restore_mode: ALWAYS_ON
|
2022-08-27 00:03:39 +00:00
|
|
|
log_baud_rate: '0'
|
2021-09-29 02:26:13 +00:00
|
|
|
|
|
|
|
packages:
|
2022-08-27 00:03:39 +00:00
|
|
|
base: !include device_base_esp8266.yaml
|
2021-09-29 02:26:13 +00:00
|
|
|
|
|
|
|
binary_sensor:
|
|
|
|
- platform: gpio
|
2022-03-29 18:54:34 +00:00
|
|
|
id: power_button
|
2021-09-29 02:26:13 +00:00
|
|
|
pin:
|
|
|
|
number: GPIO3
|
|
|
|
inverted: True
|
|
|
|
on_press:
|
|
|
|
then:
|
|
|
|
- switch.toggle: relay
|
|
|
|
|
|
|
|
sensor:
|
|
|
|
- platform: hlw8012
|
|
|
|
sel_pin:
|
|
|
|
number: GPIO12
|
|
|
|
inverted: True
|
|
|
|
cf_pin: GPIO04
|
|
|
|
cf1_pin: GPIO5
|
|
|
|
current_resistor: "0.0019"
|
|
|
|
voltage_divider: "2150"
|
|
|
|
current:
|
|
|
|
name: ${device_name} Current
|
|
|
|
unit_of_measurement: A
|
|
|
|
power:
|
|
|
|
id: power
|
|
|
|
name: ${device_name} Power
|
|
|
|
unit_of_measurement: W
|
|
|
|
initial_mode: CURRENT
|
|
|
|
change_mode_every: 4294967295
|
|
|
|
update_interval: 2s
|
|
|
|
- platform: total_daily_energy
|
|
|
|
name: ${device_name}
|
2022-03-29 18:54:34 +00:00
|
|
|
icon: mdi:flash
|
2021-09-29 02:26:13 +00:00
|
|
|
power_id: power
|
|
|
|
method: trapezoid
|
|
|
|
|
|
|
|
status_led:
|
|
|
|
pin:
|
|
|
|
number: GPIO13
|
|
|
|
inverted: False
|
|
|
|
|
|
|
|
switch:
|
|
|
|
- platform: gpio
|
|
|
|
name: ${device_name} Power Switch
|
2022-03-29 18:54:34 +00:00
|
|
|
icon: mdi:power
|
2021-09-29 02:26:13 +00:00
|
|
|
id: relay
|
|
|
|
pin: GPIO14
|
|
|
|
restore_mode: ${restore_mode}
|