evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Imported power and energy entities factor 1000 wrong

Open DeZeeg opened this issue 11 months ago • 7 comments

Description

EVCC is installed on home assistant as add-on. As my Enphase Envoy has an integration with home assistant, I use those sensors in evcc as the source for grid and solar.

Values for current are correct. Values for energy and power are a factor 1000 too small:

grid - energy evcc shows = 8.7 kWh Home Assistant sensor shows 8.732 Mph grid - power evcc shows 0 kW Home Assistant sensor shows 0.245kW

It's not possible for me to validate if this is specifically related to the Enphase device in home assistant.

Steps to Reproduce

  1. install EVCC on home assistant
  2. use UI configuration
  3. setup grid: manufacturer = home assistant / power entity = Enphase envoy entity sensor

Configuration (YAML)


Configuration (UI)

{
  "site": {
    "title": "",
    "grid": "db:6",
    "pv": ["db:2"],
    "battery": null,
    "aux": null,
    "ext": null
  },
  "loadpoints": [
    {"id":4,"name":"db:4","charger":"db:3","vehicle":"db:5","title":"Easee","defaultMode":"pv","priority":0,"phasesConfigured":0,"minCurrent":6,"maxCurrent":16,"smartCostLimit":0.175,"smartFeedInPriorityLimit":null,"planEnergy":0,"planTime":"0001-01-01T00:00:00Z","planPrecondition":0,"limitEnergy":0,"limitSoc":0,"planStrategy":{"continuous":false,"precondition":0},"thresholds":{"enable":{"delay":60000000000,"threshold":0},"disable":{"delay":180000000000,"threshold":0}},"soc":{"poll":{"mode":"charging","interval":3600000000000},"estimate":true}}
  ],
  "charger": [
    {"config":{"charger":"EHZNG59G","password":"***","template":"easee","timeout":"20s","user":"***"},"deviceProduct":"Easee Charge Lite","id":3,"name":"db:3","type":"template"}
  ],
  "meter": [
    {"config":{"currentL1":"sensor.envoy_122309099983_production_ct_current_l1","currentL2":"sensor.envoy_122309099983_production_ct_current_l2","currentL3":"sensor.envoy_122309099983_production_ct_current_l3","energy":"sensor.envoy_122309099983_lifetime_energy_production","maxacpower":"0","power":"sensor.envoy_122309099983_current_power_production","template":"homeassistant","uri":"***","usage":"pv"},"deviceProduct":"Home Assistant","deviceTitle":"Zonnepanelen","id":2,"name":"db:2","type":"template"},
    {"config":{"currentL1":"sensor.envoy_122309099983_net_consumption_ct_current_l1","currentL2":"sensor.envoy_122309099983_net_consumption_ct_current_l2","currentL3":"sensor.envoy_122309099983_net_consumption_ct_current_l3","energy":"sensor.envoy_122309099983_lifetime_net_energy_consumption","maxacpower":"0","power":"sensor.envoy_122309099983_current_net_power_consumption","template":"homeassistant","uri":"***","usage":"grid"},"deviceProduct":"Home Assistant","id":6,"name":"db:6","type":"template"}
  ],
  "vehicle": [
    {"config":{"cache":"15m","capacity":69,"icon":"car","password":"***","template":"polestar","title":"Polestar","user":"***","vin":"***"},"deviceProduct":"Polestar","id":5,"name":"db:5","type":"template"}
  ],
  "tariffs": "#tariffs:
  grid:
    type: template
    template: enever
    token: *****
    provider: ANWB # Provider, [, AA, AIP, ANWB, BE, EE, EN, EVO, EZ, FR, GSL, MDE, NE, PE, TI, VDB, VON, WE, ZG, ZP]
    charges: # Charge, Additional fixed charge per kWh (e.g. 0.05 for 5 cents) (optional)
    tax: # Tax, Additional percentage charge (e.g. 0.2 for 20%) (optional)
    formula: math.Max((price + charges) * (1 + tax), 0.0) # Formula, Individual formula for calculating the price (optional)
    interval: 3h # Interval, optional
    
#grid: # price using energy from the grid
#  type: fixed
#  price: 0.294 # EUR/kWh

#feedin: # price for feeding solar energy to the grid
#  type: fixed
#  price: 0.08 # EUR/kWh
 
#co2: # carbon intensity forecast
#  type: template
#  template: grünstromindex
#  zip: *****

#solar: # list of pv generation forecast (additive)
#- type: template
#  template: solcast
#  site: <site>
#  token: *****",
  "mqtt": {"broker":"","user":"","password":"","clientID":"","insecure":false,"caCert":"","clientCert":"","clientKey":"","topic":"evcc"},
  "influx": {"url":"","database":"","token":"","org":"","user":"","password":"","insecure":false},
  "shm": {"vendorId":"","deviceId":""},
  "interval": 30
}

Logs

[lp-1  ] DEBUG 2026/01/03 22:17:42 pv charge current: 0A = 0A + -0.436A (100W @ 1p)
[site  ] DEBUG 2026/01/03 22:18:12 ----
[lp-1  ] DEBUG 2026/01/03 22:18:12 charge power: 0W
[lp-1  ] DEBUG 2026/01/03 22:18:12 charge currents: [0.008 0.006 0.01]A
[site  ] DEBUG 2026/01/03 22:18:12 grid power: 0W
[site  ] DEBUG 2026/01/03 22:18:12 pv 1 power: -0W
[site  ] DEBUG 2026/01/03 22:18:12 !! solar production: accumulate set db:2 5.179kWh meter total (was: Accumulated: 0.000kWh updated: 2026-01-03 22:17:42 +0100 CET meter: 5.179kWh)
[site  ] DEBUG 2026/01/03 22:18:12 !! solar production: accumulate moved db:2 from 0.000 to 0.000
[site  ] DEBUG 2026/01/03 22:18:12 grid currents: [1.07 0.413 0.865]A
[site  ] DEBUG 2026/01/03 22:18:12 site power: 100W
[lp-1  ] DEBUG 2026/01/03 22:18:12 charge total import: 8127.379kWh
[lp-1  ] DEBUG 2026/01/03 22:18:12 charger status: B
[lp-1  ] DEBUG 2026/01/03 22:18:12 pv charge current: 0A = 0A + -0.436A (100W @ 1p)
[site  ] DEBUG 2026/01/03 22:18:42 ----
[lp-1  ] DEBUG 2026/01/03 22:18:42 charge power: 0W
[lp-1  ] DEBUG 2026/01/03 22:18:42 charge currents: [0.008 0.006 0.01]A
[site  ] DEBUG 2026/01/03 22:18:42 grid power: 0W
[site  ] DEBUG 2026/01/03 22:18:42 pv 1 power: -0W
[site  ] DEBUG 2026/01/03 22:18:42 !! solar production: accumulate set db:2 5.179kWh meter total (was: Accumulated: 0.000kWh updated: 2026-01-03 22:18:12 +0100 CET meter: 5.179kWh)
[site  ] DEBUG 2026/01/03 22:18:42 !! solar production: accumulate moved db:2 from 0.000 to 0.000
[site  ] DEBUG 2026/01/03 22:18:42 grid currents: [1.07 0.413 0.865]A
[site  ] DEBUG 2026/01/03 22:18:42 site power: 100W
[lp-1  ] DEBUG 2026/01/03 22:18:42 charge total import: 8127.379kWh
[lp-1  ] DEBUG 2026/01/03 22:18:42 charger status: B
[lp-1  ] DEBUG 2026/01/03 22:18:42 pv charge current: 0A = 0A + -0.436A (100W @ 1p)

Version

v0.300.2

System

linux/arm64, CET +01:00

DeZeeg avatar Jan 03 '26 21:01 DeZeeg

Your sensors need to provide the values with the unit that evcc expects. This is W for power an kWh for energy.

mfuchs1984 avatar Jan 03 '26 22:01 mfuchs1984

Your sensors need to provide the values with the unit that evcc expects. This is W for power an kWh for energy.

I understand, but the HA documention shows that those use the same unit for power. For energy, there is indeed a mismatch.

https://www.home-assistant.io/integrations/enphase_envoy

DeZeeg avatar Jan 04 '26 08:01 DeZeeg

You should provide an evcc trace log with homeassistant and site on trace, so we can see what is coming in.

mfuchs1984 avatar Jan 04 '26 08:01 mfuchs1984

Hmm, what else does the selection offer? Can you set everything on trace?

mfuchs1984 avatar Jan 04 '26 08:01 mfuchs1984

[ha-meter] TRACE 2026/01/04 09:38:18 {"entity_id":"sensor.envoy_122309099983_current_power_production","state":"-0.005","attributes":{"state_class":"measurement","unit_of_measurement":"kW","device_class":"power","friendly_name":"Enphase Envoy (solar) Current power production"},"last_changed":"2026-01-04T08:38:07.963772+00:00","last_reported":"2026-01-04T08:38:07.963772+00:00","last_updated":"2026-01-04T08:38:07.963772+00:00","context":{"id":"01KE42G6AVF16A97PK14X7GPTQ","parent_id":null,"user_id":null}}

"unit_of_measurement":"kW" "state":"-0.005"

It reports kW. So you need to create a template sensor in homeassistant that concerts it to W. At the moment, it's slightly negative, but this might be because there is no sun, you should look at it again when it's sunny.

mfuchs1984 avatar Jan 04 '26 08:01 mfuchs1984