Hi everybody,
I just got my Blitzwolf BW-SHP6 working with ESPHome on home assistant and wanted to share the config file so everybody can use it. I flashed my SHP6 using the tutorial for the Tasmota Github and it worked fine. But it was quite a hassle to but the plug back together so maybe using tuya-convert is better method. Intermit.tech has a tutorial on that, but i haven’t tried it, since i don’t have a Linux PC.
I based the config on the tutorial from Intermit.tech who used a SHP2 and changed the pin layout according to this post. Then I did some modifications to best mimic the original working of the device.
substitutions:
plug_name: YOURNAME
# Higher value gives lower watt readout
current_res: "0.00290"
# Lower value gives lower voltage readout
voltage_div: "940"
esphome:
name: ${plug_name}
platform: ESP8266
board: esp8285
wifi:
ssid: "YOURSSID"
password: "YOURPASSWORD"
# Enable logging
logger:
# Enable Home Assistant API
api:
password: 'YOURAPIPASSWORD'
ota:
password: 'YOURAPIPASSWORD'
time:
- platform: homeassistant
id: homeassistant_time
binary_sensor:
- platform: gpio
pin:
number: GPIO13
inverted: True
name: "${plug_name}_button"
on_press:
- switch.toggle: switch1
output:
- platform: gpio
pin: GPIO15
id: relay
- platform: gpio
pin: GPIO00
inverted: True
id: led1
status_led:
pin:
number: GPIO02
inverted: True
switch:
- platform: template
id: switch1
icon: mdi:power-socket-eu
optimistic: true
name: "${plug_name}_Relay"
turn_on_action:
- output.turn_on: relay
- output.turn_on: led1
turn_off_action:
- output.turn_off: relay
- output.turn_off: led1
sensor:
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO05
cf1_pin: GPIO14
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
current:
name: "${plug_name}_Amperage"
unit_of_measurement: A
accuracy_decimals: 3
icon: mdi:flash-circle
voltage:
name: "${plug_name}_Voltage"
unit_of_measurement: V
icon: mdi:flash-circle
power:
name: "${plug_name}_Wattage"
unit_of_measurement: W
id: "${plug_name}_Wattage"
icon: mdi:flash-circle
change_mode_every: 4
update_interval: 10s
- platform: total_daily_energy
name: "${plug_name}_Total Daily Energy"
power_id: "${plug_name}_Wattage"
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
icon: mdi:clock-alert
# Extra sensor to keep track of plug uptime
- platform: uptime
name: ${plug_name}_Uptime Sensor
icon: mdi:clock-outline
I set the template switch to optimistic, because i don’t no how to do a lambda template. I’m sure this can be improved, but it works for me at the moment.
I hope this will help somebody,
Greetings,
Tijmen