Hi, I have a double smart plug which is acting funny after flashing with ESPhome. The code is below (I copied somewhere), but one switch is working (the other not) and the WATT value is always above 3000 W even when OFF.
Any advice? Thanks
esphome:
# Digoo DG-SP202 wifi plug with power monitoring
name: micro_and_small_oven_power_plug
platform: ESP8266
board: esp01_1m
substitutions:
# Modify variables based on your settings
hostname: 'micro and small oven power plug'
wifi:
ssid: xxxx
password: xxxx
manual_ip:
static_ip: 192.168.1.160
gateway: 192.168.1.253
subnet: 255.255.255.0
api:
ota:
logger:
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: hlw8012
sel_pin:
number: GPIO16
inverted: True
cf_pin: GPIO5
cf1_pin: GPIO4
current_resistor: 0.00221 ## Higher value gives lower watt readout
voltage_divider: 896 ## Lower value gives lower voltage readout
current:
name: "Micro and small oven amperage"
unit_of_measurement: A
voltage:
name: "Micro and small oven voltage"
unit_of_measurement: V
power:
name: "Micro and small oven wattage"
unit_of_measurement: W
id: "wattage"
change_mode_every: 8
update_interval: 3s
- platform: total_daily_energy
name: "Micro and small oven daily power usage"
power_id: "wattage"
filters:
- multiply: 0.001 ## Multiplication factor from W to kW is 0.001
unit_of_measurement: kWh
- platform: wifi_signal
name: "Micro and small oven power plug WiFi Signal"
update_interval: 60s
- platform: uptime
name: $hostname Uptime
id: uptime_s
update_interval: 15s
filters:
- lambda: return x / 3600;
unit_of_measurement: "h"
accuracy_decimals: 2
binary_sensor:
- platform: gpio
pin:
number: 0
mode: INPUT_PULLUP
inverted: true
name: "Micro button"
on_press:
- switch.toggle: relay1
- platform: gpio
pin:
number: 16
mode: INPUT_PULLUP
inverted: true
name: "Small oven button"
on_press:
- switch.toggle: relay2
- platform: status
name: "Micro and small oven power plug Status"
switch:
- platform: gpio
name: "Micro power plug"
pin: GPIO15
id: relay1
- platform: gpio
name: "Small oven power plug"
pin: GPIO14
id: relay2
#################
# OFFICE AC POWER PLUG RESTART
#################
- platform: restart
name: "Micro and small oven power plug restart"
text_sensor:
- platform: version
name: "Micro and small oven power plug ESPHome Version"
- platform: wifi_info
ssid:
name: $hostname WiFi