jesserizzo / envoy_reader

MIT License
37 stars 26 forks source link

Reading negative whattsNow value #62

Open lnlp opened 3 years ago

lnlp commented 3 years ago

@gtdiehl

Today I noticed reporting of negative whattsNow value in the Home Assistant Enphase Envoy plugin (labeled 'Actueel' on screen):

capture 2021-01-22 16·56·00 - Copy

However envoy/api/v1/production showed an active whatssNow value of 0:

capture 2021-01-22 16·56·09 - Copy

A short moment later (I refreshed both screens) the values were as follows:

capture 2021-01-22 16·56·50 - Copy

capture 2021-01-22 16·57·00 - Copy

I'm not sure why the Envoy does report negative whattsNow values and this is not something caused by envoy_reader.

It is strange however that the negative whattsNow values reported in Home Assistant are different from the ones reported by the Envoy api envoy/api/v1/production.

This is either caused by a problem in envoy_reader or the Home Assistant Enphase Envoy plugin.

How is it possible that the Envoy api reports a negative whattsNow value?

Values were observed at end of noon while it was almost dark. Envoy Metering Multiphase without CT metering installed.

dalklein commented 3 years ago

'end of noon'? If it's dark out, the micros do consume a small amount of current.

In my system with 23 total inverters and the older oval Envoy, m190 / m210 and replacement m190IG/IQ7, the system does consume 10 to 11 watts total at night, measured by my utility meter. My Envoy is powered directly from the same circuit so that would be using 1-3watts. I see zero or some small value reported by the Envoy at night, 10 to 40 watts, and I think this may be the last values reported from the micros before they turn off.

lnlp commented 3 years ago

Thanks. It now shows 0 again (which I would expect). I apparently looked exactly at the 'right' time to notice the effect.

The micro inverters use power overnight? I have 15 iQ7+ installed. Maybe the iQ7(+) make a difference in that aspect?

Still strange that the value reported in Home Assistant was different from the value reported by the API.

gtdiehl commented 3 years ago

@lnlp Sorry for the late reply. If I remember correctly you have an Envoy-S? The current watts now value would be coming from /production.json. This could account for the difference.

gtdiehl commented 3 years ago

@lnlp I suspect this is still and issue?

I was looking at a different issue today and saw that the Production value from a Production CT was negative in the /production.json output: "wNow":-0.719

This negative value is then seen as a -1 W through the Envoy webpage sometimes, mostly it shows 0 W.

Wondering if I should just change the value to zero if a small negative value is retrieved via the API for Production data?

{"production":[{"type":"inverters","activeCount":14,"readingTime":0,"wNow":0,"whLifetime":21112843},{"type":"eim","activeCount":1,"measurementType":"production","readingTime":1628788496,"wNow":-0.719,"whLifetime":20835640.513,"varhLeadLifetime":0.138,"varhLagLifetime":6387378.402,"vahLifetime":24244063.643,"rmsCurrent":0.397,"rmsVoltage":234.865,"reactPwr":88.014,"apprntPwr":93.392,"pwrFactor":-0.06,"whToday":0.513,"whLastSevenDays":60410.513,"vahToday":490.643,"varhLeadToday":0.138,"varhLagToday":463.402}],"consumption":[{"type":"eim","activeCount":1,"measurementType":"total-consumption","readingTime":1628788496,"wNow":3522.636,"whLifetime":62920621.898,"varhLeadLifetime":19041265.699,"varhLagLifetime":6387963.49,"vahLifetime":71222096.905,"rmsCurrent":15.527,"rmsVoltage":234.852,"reactPwr":-477.717,"apprntPwr":3646.434,"pwrFactor":0.97,"whToday":11626.898,"whLastSevenDays":418583.898,"vahToday":12039.905,"varhLeadToday":2120.699,"varhLagToday":463.49},{"type":"eim","activeCount":1,"measurementType":"net-consumption","readingTime":1628788496,"wNow":3523.355,"whLifetime":53013253.98,"varhLeadLifetime":19041265.561,"varhLagLifetime":585.088,"vahLifetime":71222096.905,"rmsCurrent":15.129,"rmsVoltage":234.839,"reactPwr":-389.703,"apprntPwr":3553.055,"pwrFactor":0.99,"whToday":0,"whLastSevenDays":0,"vahToday":0,"varhLeadToday":0,"varhLagToday":0}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}