Esphome and Blitzwolf SHP5?

Hi again.
Did anybody found out right config for ESPHome to this plug?

Best,
chrisjan

Pretty easy to figure out from the tasmota config.

The one from @depen ( Esphome and Blitzwolf SHP5? ) here above in the thread works.

I just setup the device and have the exact same problem.
Voltage is always around 120V instead of 240V and Watt is also halvedā€¦
Setup sensor filter to multiply by 2

1 Like

The issue with the too low readings of voltage and power is that esphome assumes that the devices use the default setup of voltage divider resistor and current resistor.

The default is 1M Ohm for voltage divider. The 2xx Volt variants of the SPH5 and Gosund SP112 are using 1906 kOhm. You can configure those values for other power meassurement chips but not the CSE7766. (also see: https://github.com/esphome/feature-requests/issues/736)

In theory it should be ā€œmultiply by 1.906ā€ . With 2 you will get values too high.

3 Likes

Hey, I was going to use @depen config from above for my Gosund 112, but it turns out Iā€™ve got Version 3.4 (https://templates.blakadder.com/gosund_SP112_v3_4.html).

Iā€™ve got it somehow working, but before I can calibrate it I need values for:

    current_resistor: ???
    voltage_divider: ???

So I did it myself and calibrated the values for current_resistorand voltage_divider with another power meter.

Here is my config and hope it will help someone later:

esphome:
  name: ${device_id}
  platform: ESP8266
  board: esp8285
  on_boot:
    priority: -10
    # Turn on switch during startup
    then:
      - switch.turn_on: relay

wifi:
  ssid: 'ssid'
  password: 'password'

api:

logger:
  level: none
  baud_rate: 0

ota:

substitutions:
# Unique device ID
  device_id: "gosund_sp112_1"
  device_name: "Gosund SP112 1"

uart:
  rx_pin: RX
  baud_rate: 4800
  
time:
  - platform: homeassistant
    id: homeassistant_time

sensor:
  - platform: wifi_signal
    name: ${device_name} RSSI
    filters:
      - delta: 2.0    
    
    # Power sensor
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: true
    cf_pin: GPIO05
    cf1_pin: GPIO04
    current_resistor: 0.0022
    voltage_divider: 720
    change_mode_every: 5
    update_interval: 5s
    # Current sensor
    current:
      name: ${device_name} Current
      icon: mdi:current-ac
      unit_of_measurement: A
      accuracy_decimals: 2
      filters:
        - delta: 0.02
        - multiply: 1.81
    # Voltage sensor
    voltage:
      name: ${device_name} Voltage
      icon: mdi:poll
      unit_of_measurement: V
      accuracy_decimals: 1
      filters:
        - delta: 0.5
    # Power sensor
    power:
      id: power
      name: ${device_name} Power
      icon: mdi:flash-outline
      unit_of_measurement: W
      accuracy_decimals: 0
      filters:
        - delta: 1.5
  # Total daily energy sensor
  - platform: total_daily_energy
    name: ${device_name} Daily Energy
    power_id: power
    filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001
    unit_of_measurement: kWh

  - platform: adc
    internal: true
    id: source_sensor
    pin: GPIO17
    accuracy_decimals: 1
    update_interval: 5s
    filters:
      delta: 0.4
    on_value:
      then:
        - if:
            condition:
            # Should return either true or false
              lambda: |-
                return id(source_sensor).state <= 0.3;
            then:
              - switch.toggle: relay

switch:
  # Switch to toggle the relay (Power output)
  - platform: gpio
    id: relay
    name: ${device_name} AC
    icon: mdi:power-socket-eu
    #restore_mode: ALWAYS_ON
    pin: GPIO14
    on_turn_on:
      - light.turn_on: led
    on_turn_off:
      - light.turn_off: led

  # Switch to toggle the relay (USB output)
  - platform: gpio
    id: relay2
    name: ${device_name} USB
    icon: mdi:usb
    #restore_mode: ALWAYS_ON
    pin: 
      number: GPIO13
      inverted: true
    on_turn_on:
      - light.turn_on: led
    on_turn_off:
      - light.turn_off: led

output:
  # Relay state led
  - platform: esp8266_pwm
    id: state_led
    pin:
      number: GPIO02
      inverted: true

light:
  # Relay state light
  - platform: monochromatic
    output: state_led
    id: led

# Uses the red LED as a status indicator
status_led:
  pin:
    number: GPIO00
    inverted: true
2 Likes

Does this also measure the consumption of the USB ports?

It only has 1 general consumption indicator

1 Like

Ok, so if i connect something in the USB ports it will show the consumption, right?

Not sure. Based on the information in the link below, it would seem that the USB power consumption is not measured: https://github.com/arendst/Tasmota/issues/5756#issuecomment-500026002

Hello all,

I have the same SHP5 plug and because i just do not know, i have to solder and upload a Tasmota firmware in order to have it in HA or can be done with other way?
Thank you in advance for your help.

Hi!

I just tried this config but for me no sensing works at all. Did you experience this too?
Voltage, Daily, Power and Current all stay at 0. Switches and RSSI works.

EDIT:
Figured it out. Your setup works on the newer style with different sensor. changed up the code a little to use the old sensor and all working now!

@ GravitySandwich: Can you share config? My Voltage and Power is also 0. What did you change?

1 Like

i have a gosund sp112 and i also donĀ“t get power values