Skip to content

Conversation

@DjordjeMandic
Copy link
Member

@DjordjeMandic DjordjeMandic commented Jan 4, 2026

Description:

This PR updates the BL0942 reference calibration values (voltage, current, power, and energy) to match values derived from the BL0940 Application Note formulas combined with BL0942 datasheet constants.

The updated reference values are calculated for the most commonly used hardware configuration:

  • 1 mΩ shunt resistor
  • Voltage divider: 5 × 390 kΩ (high side) + 510 Ω (low side)

Why is this needed?

With the existing reference values, the BL0942 energy measurement consistently reports higher accumulated energy than expected. This becomes apparent when comparing:

  • the component’s energy sensor
  • the ESPHome total_daily_energy sensor

In real-world usage, total_daily_energy was consistently lower than the accumulated energy reported by the BL0942 component, indicating incorrect energy scaling.

What is the result?

After applying the corrected reference values:

  • Energy accumulation matches expected real-world consumption
  • The BL0942 energy sensor and total_daily_energy are consistent with each other
  • Voltage, current, and power scaling remain correct for the stated hardware configuration

Scope and compatibility

These reference values are explicitly intended for the most common BL0942 hardware design. Custom hardware with different shunt values or voltage dividers may still require custom calibration.

Related issue (if applicable): fixes

Pull request in esphome with YAML changes (if applicable):

Checklist:

  • I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • I am merging into current because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.

  • Link added in /components/_index.md when creating new documents for new components or cookbook.

New Component Images

If you are adding a new component to ESPHome, you can automatically generate a standardized black and white component name image for the documentation.

To generate a component image:

  1. Comment on this pull request with the following command, replacing component_name with your component name in lower_case format with underscores (e.g., bme280, sht3x, dallas_temp):

    @esphomebot generate image component_name
    
  2. The ESPHome bot will respond with a downloadable ZIP file containing the SVG image.

  3. Extract the SVG file and place it in the /static/images/ folder of this repository.

  4. Use the image in your component's index table entry in /components/_index.md.

Example: For a component called "DHT22 Temperature Sensor", use:

@esphomebot generate image dht22

@netlify
Copy link

netlify bot commented Jan 4, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit cfe972c
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/6959d36a4a4f0d000820df35
😎 Deploy Preview https://deploy-preview-5853--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DjordjeMandic DjordjeMandic marked this pull request as draft January 4, 2026 02:32
@DjordjeMandic DjordjeMandic marked this pull request as ready for review January 4, 2026 02:42
@DjordjeMandic DjordjeMandic changed the title BL0942 Update references [bl0942] Update references Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant