esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

BL0942 Reports wrong energy accumulation KWh #6273

Open yiannosi opened 1 day ago

yiannosi commented 1 day ago

The problem

I have two ESPhome modules with BL0942. Both module correctly report voltage,current and frequency but the Energy register seems to increase exponentially.

image

Which version of ESPHome has the issue?

2024.9.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

13.1

What platform are you using?

ESP8266

Board

ESP12e

Component causing the issue

BL0942

Example YAML snippet

esphome:
  name: esphome-web-95fd0c
  friendly_name: Bedroom 3 AC Meter
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp8266:
  board: esp12e

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
  platform: esphome

# Allow provisioning Wi-Fi via serial
#improv_serial:

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  - ssid: !secret second_ssid
    password: !secret second_wifi_password
  manual_ip:
    static_ip: 192.168.10.95
    gateway: 192.168.10.254
    subnet: 255.255.255.0

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

uart:
  id: uart_bus
  tx_pin: TX
  rx_pin: RX
  baud_rate: 4800
  stop_bits: 1

sensor:
  - platform: wifi_signal
    name: "3rdBedroom AC Meter Signal"
    update_interval: 5s
    entity_category: "diagnostic"

  - platform: bl0942
    uart_id: uart_bus
    voltage:
      name: 'Voltage'
      accuracy_decimals: 1
    current:
      name: 'Current'
      accuracy_decimals: 1
    power:
      name: 'Power'
      accuracy_decimals: 1

    energy:
      name: 'Energy'
      accuracy_decimals: 1
      filters:

    frequency:
      name: "Frequency"
      accuracy_decimals: 2

    update_interval: 1s

binary_sensor: 
  - platform: status
    name: "3rdBedroom AC Meter"  ### <--- useful to make sure the device wakes at least twice a day or HA alerts me  
    id: dBedroom_3_AC_Meter_Connect

status_led:
  pin: GPIO5

text_sensor:
  - platform: wifi_info
    ip_address:
      name: ESP IP Address
    ssid:
      name: ESP Connected SSID
    scan_results:
      name: ESP Latest Scan Results     

Anything in the logs that might be useful for us?

No response

Additional information

No response

theanch92 commented 1 day ago

I have the same issue, solved for now like this:

energy: name: Energy
accuracy_decimals: 2 filters: multiply: 0.000001

yiannosi commented 1 day ago

Hmm..What makes you think its a simple matter of scaling?

theanch92 commented 1 day ago

I have made a comparison with the history, I have practically a small constant load, I thought it was just a multiplication problem but in fact it is higher by about 3 times even with the multiply: 0.000001. Today 1.21kwh, before update 0.35khw

Then I don't know, let's wait for someone to know more