For those who would like to use this with the tuya convert; I get the strong impression that these will not work with tuya-convert. The original plug tries downloading a firmware using a non-secure connection. These plugs try to use https, and that fails with tuya convert. I’ll try to see if I can use stunnel to get them to download a firmware, but If they do proper certificate checking, that won’t work. I’ll post my results here later.
A random certificate with a valid certificate from a private root will not work.
Off course the plug does not have an RTC, so cert based authentication will be a challenge. Therefore they seemed to have chosen to use pre shared key authentication.
The SHP6 tries to connect to a3.tuyaeu.com and sugests 2 cipher suites:
TLS_PSK_WITH_AES128_CBC_SHA256 (0x00ae)
TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff)
So if they use a PSK it’s probably in the original firmware somewhere.
Nevermind, someone has already figured this out and the newest version of tuya-convert supports the new devices perfectly.
Only just received two SHP7, the double version of this. Won’t have time to poke the serial and stuff for a while, but uploaded some pictures if anyone wanna have a look under the hood before ordering these.
(
((or just pull the module, read the silkscreen, then probe the board another day https://ibb.co/album/jR0taa))
Done intitial pin mapping:
wifi module
IO1/TX IO3/RX
IO5 IO4
IO0 IO2
IO13 IO12
IO14 IO16
IOUT* GND
VDD
mapping
IO0 switch1 (next to wifi module)
IO13 led1
IO15 relay1
IO2 switch2
IO12 led2
IO16 relay2
IO01/TX blue led
IO03/RX** SEL HLW8012? pin 8
IO5** CF1 HLW8012? pin 7
IO4** CF HLW8012? pin 6
GND HLW8012? pin 5
VDD HLW8012? pin 1
*) no idea if correct, seems unused
**) untested
Hope to get it flashed soon:) Flashed, need to get buttons and power meter chip working.
Button shows up in log once, but doesn’t do anything besides show up in log.
[22:32:30][D][binary_sensor:036]: 'button1': Sending state OFF
[22:32:33][D][binary_sensor:036]: 'button2': Sending state OFF
add mode: INPUT_PULLUP
fixes button.
config.yaml so far:
substitutions:
device_name: blitzwolf07
esphome:
name: ${device_name}
platform: ESP8266
board: esp8285
wifi:
ssid: !secret iot_ssid
password: !secret iot_password
domain: !secret iot_domain
ap:
ssid: "ESPhome"
password: !secret iot_password
logger:
baud_rate: 0
hardware_uart: UART1
api:
ota:
#IO13 led1 ok
#IO12 led2 ok
#IO01/TX blue led ok
#IO0 switch1 ok?
#IO2 switch2 ok?
#IO15 relay1 ok
#IO16 relay2 ok
binary_sensor:
- platform: gpio
id: button1
#internal: true
pin:
number: GPIO00
mode: INPUT_PULLUP
on_press:
- switch.toggle: relay1
- platform: gpio
id: button2
#internal: true
pin:
number: GPIO12
mode: INPUT_PULLUP
on_press:
- switch.toggle: relay2
output:
- platform: gpio
pin: GPIO13
inverted: true
id: led1
- platform: gpio
pin: GPIO02
inverted: true
id: led2
switch:
- platform: gpio
pin: GPIO14
id: relay1
name: '${device_name} Relay 1'
on_turn_on:
- output.turn_on: led1
on_turn_off:
- output.turn_off: led1
- platform: gpio
pin: GPIO16
id: relay2
name: '${device_name} Relay 2'
on_turn_on:
- output.turn_on: led2
on_turn_off:
- output.turn_off: led2
status_led:
pin:
number: GPIO01 #tx
inverted: true
Tasmota template has some additional info:
GPIO # | Component |
---|---|
GPIO00 | Button1 |
GPIO01 | LedLinki |
GPIO02 | Led2i |
GPIO03 | HLWBL SELi |
GPIO04 | BL0937 CF |
GPIO05 | HLWBL CF1 |
GPIO09 | None |
GPIO10 | None |
GPIO12 | Button2 |
GPIO13 | Led1i |
GPIO14 | Relay1 |
GPIO15 | None |
GPIO16 | Relay2 |
Here is my Blitzwolf SHP6 ESPHOME configuration file
Functions:
- Button - ON / OFF
- When the button on blue LED on
- When power consumption above 1W red LED on (delayed)
- after boot turn on the relay
# Blitzwolf SHP6 15A Power Monitoring Plug
# https://templates.blakadder.com/blitzwolf_SHP6-15A.html
substitutions:
plug_name: blitzwolf_shp6_04
# Higher value gives lower watt readout
current_res: '0.00290'
# Lower value gives lower voltage readout
voltage_div: '760'
esphome:
name: ${plug_name}
platform: ESP8266
board: esp8285
on_boot:
priority: -10
then:
# on affter boot
- switch.toggle: relay
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
logger:
api:
ota:
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
binary_sensor:
- platform: gpio
internal: true
pin:
number: GPIO13
inverted: True
on_press:
- switch.toggle: relay
name: "${plug_name}_button"
switch:
- platform: gpio
name: "${plug_name}_Relay"
id: relay
pin: GPIO15
on_turn_on:
- switch.turn_on: "${plug_name}_LED_Blue"
on_turn_off:
- switch.turn_off: "${plug_name}_LED_Blue"
- switch.turn_off: "${plug_name}_LED_Red"
- platform: gpio
internal: true
name: "${plug_name}_LED_Blue"
id: "${plug_name}_LED_Blue"
pin: GPIO2
inverted: True
- platform: gpio
name: "${plug_name}_LED_Red"
internal: true
id: "${plug_name}_LED_Red"
pin: GPIO0
inverted: True
sensor:
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO05
cf1_pin: GPIO04
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
current:
name: "${plug_name}_Amperage"
unit_of_measurement: 'A'
accuracy_decimals: 3
voltage:
name: "${plug_name}_Voltage"
unit_of_measurement: 'V'
power:
name: "${plug_name}_Wattage"
unit_of_measurement: 'W'
id: "${plug_name}_Wattage"
on_value_range:
- above: 2.0
then:
- switch.turn_on: "${plug_name}_LED_Red"
- below: 2.0
then:
- switch.turn_off: "${plug_name}_LED_Red"
change_mode_every: 8
update_interval: 5s
- 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
# Extra sensor to keep track of plug uptime
- platform: uptime
name: '${plug_name}_Uptime'
unit_of_measurement: days
update_interval: 300s
filters:
- multiply: 0.000011574
# BlitzWolf BW-SHP6 10A Power Monitoring Plug
# https://templates.blakadder.com/blitzwolf_SHP6.html
substitutions:
plug_name: blitzwolf_shp6_01
# 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
on_boot:
priority: -10
then:
# on affter boot
- switch.toggle: relay
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
logger:
api:
ota:
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
binary_sensor:
- platform: gpio
internal: true
pin:
number: GPIO13
inverted: True
on_press:
- switch.toggle: relay
name: "${plug_name}_button"
switch:
- platform: gpio
name: "${plug_name}_Relay"
id: relay
pin: GPIO15
on_turn_on:
- switch.turn_on: "${plug_name}_LED_Blue"
on_turn_off:
- switch.turn_off: "${plug_name}_LED_Blue"
- switch.turn_off: "${plug_name}_LED_Red"
- platform: gpio
internal: true
name: "${plug_name}_LED_Blue"
id: "${plug_name}_LED_Blue"
pin: GPIO2
inverted: True
- platform: gpio
name: "${plug_name}_LED_Red"
internal: true
id: "${plug_name}_LED_Red"
pin: GPIO0
inverted: True
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
voltage:
name: "${plug_name}_Voltage"
unit_of_measurement: 'V'
power:
name: "${plug_name}_Wattage"
unit_of_measurement: 'W'
id: "${plug_name}_Wattage"
on_value_range:
- above: 1.0
then:
- switch.turn_on: "${plug_name}_LED_Red"
- below: 1.0
then:
- switch.turn_off: "${plug_name}_LED_Red"
change_mode_every: 8
update_interval: 5s
- 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
# Extra sensor to keep track of plug uptime
- platform: uptime
name: '${plug_name}_Uptime'
unit_of_measurement: days
update_interval: 300s
filters:
- multiply: 0.000011574
here is config for Blitzwolf SHP8
substitutions:
device_name: blitzwolf_shp8_01
upper_devicename: "BlitzWolf SHP8 01"
ip: 192.168.xx.xx
# Higher value gives lower watt readout
current_res: '0.00221'
# Lower value gives lower voltage readout
voltage_div: '825'
esphome:
name: ${device_name}
platform: ESP8266
board: esp8285
comment: Blitzwolf SHP8
on_boot:
priority: -10
then:
- light.turn_on: ${device_name}_blue_led_light
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pwd
fast_connect: true
manual_ip:
static_ip: ${ip}
gateway: 192.168.x.x
subnet: 255.255.255.0
dns1: 192.168.x.x
dns2: 8.8.8.8
ap:
ssid: "${upper_devicename} Hotspot"
password: "!secret wifi_pwd"
captive_portal:
logger:
api:
ota:
web_server:
port: 80
binary_sensor:
- platform: gpio
id: ${device_name}_button
pin:
number: GPIO3
inverted: True
mode: INPUT_PULLUP
on_press:
- switch.toggle: ${device_name}_relay
- platform: status
name: "${upper_devicename} Status"
id: ${device_name}_status
output:
- platform: esp8266_pwm
pin: GPIO13
inverted: true
id: ${device_name}_blue_led
light:
- platform: monochromatic
name: "${upper_devicename} Blue LED"
output: ${device_name}_blue_led
id: ${device_name}_blue_led_light
switch:
- platform: gpio
pin: GPIO14
id: ${device_name}_relay
name: '${upper_devicename} Relay'
on_turn_on:
- light.turn_off: ${device_name}_blue_led_light
on_turn_off:
- light.turn_on: ${device_name}_blue_led_light
- platform: restart
name: "${upper_devicename} Restart switch"
sensor:
- platform: uptime
name: '${upper_devicename} Uptime'
update_interval: 60s
- platform: wifi_signal
name: "${upper_devicename} WiFi Signal Sensor"
update_interval: 300s
id: ${device_name}_wifisignal
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: true
cf_pin: GPIO04
cf1_pin: GPIO05
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
current:
name: '${upper_devicename} Current'
unit_of_measurement: 'A'
accuracy_decimals: 3
icon: mdi:flash-outline
voltage:
name: '${upper_devicename} Voltage'
unit_of_measurement: 'V'
accuracy_decimals: 0
icon: mdi:flash-outline
power:
name: '${upper_devicename} Power'
unit_of_measurement: 'W'
icon: mdi:flash-outline
change_mode_every: 4
update_interval: 5s
text_sensor:
- platform: wifi_info
ip_address:
name: '${upper_devicename} IP Address'
icon: mdi:ip
- platform: version
name: '${upper_devicename} ESPHome Version'
works like a charm, thank you.
how can i tune this values?
plug_name: blitzwolf_shp6_04
Higher value gives lower watt readout
current_res: ‘0.00290’
Lower value gives lower voltage readout
voltage_div: ‘760’
I just received a SHP-7 and a SHP-9 (and some more SHP-6’S) I can’t wait to get the ‘7’ flashed, I have to open the ‘9’ to see if it’s also esp based, I really hope so
Just try it. If it is not esp based, then it would anyway not accept the flash
It worked, it’s tasmotized now, so tomorrow I’m going to see if I can figure out the pins for it. It’s rather nice, 3 plugs, and two usb ports, and as I read it, they should be individually controllable.
Is there an ‘easy’ path for figuring out the pins?
I’ve made a very rudimentary template for shp9 now, and it’s uploaded to the repository.
It only handles the switches, LED and button, and I still have yet to figure out how to get powermonitoring active on this.
HI,
I have a BW-SHP6 15A. I flashed it first with Tasmota. The reading where ok. But I prefer ESPHome. So I used one of the configs here:
substitutions:
plug_name: blitzwolf_shp6
# 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: !secret ssid
password: !secret wifi_password
# Enable logging
logger:
# Enable Home Assistant API
web_server:
port: 80
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: 5s
- 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
unit_of_measurement: days
update_interval: 300s
filters:
- multiply: 0.000011574
Unfortunately, the Voltage and Amperage stay 0?? The wattage is correct. Anyone an idea? Or is the latest SHP6 using a different chip? (BL0937 and is not supported?)
I have had the same problem, the problem is wrong configuration.
i used this https://community.home-assistant.io/t/esphome-blitzwolf-bw-shp6-configuration/113938/12
Thanks, but unfortunately this won’t work either? Could it be that they changed the hardware?
Can you double check this line under the sensor section.
cf1_pin: GPIO04
It has to be 04 and not 14
Aha, That’s the failure! Overlooked! Thanks it is working now !
I like the idea of using the red led to show if there is power consumption above a certain threshold!
But does anyone know how to make a binary sensor out of that? Something that would have the value True if power => 10 W for instance, and False if < 10W.
Oh wait I can just comment out internal: true from the declaration of the LED_Red
Hi all.I am a beginner and i have 5-6 BW-SHP6 .i running HA on PI 3 .did a solution for upgrade ower the air software to works wit home assistant ?? that is for me now the only option.
or any link for buying 3d printed flash tool
Thanks