toreamun / amshan-homeassistant

Home Assistant integrasjon for strømmålere (AMS/HAN/P1). Integrasjonen støter både streaming (serieport/TCP-IP) og MQTT (Tibber Pulse, energyintelligence.se etc)
MIT License
144 stars 9 forks source link

Add lastMeterProduction and lastMeterConsumption from Tibber Pulse #41

Open tfriberg opened 1 year ago

tfriberg commented 1 year ago

Is your feature request related to a problem? Eg. during power outages, or if the Pulse is down/need to be rebooted for any reason, the shorter term data (hour and accumulated) are lost so any calculations based on these gives faulty statistics.

Describe the solution you'd like Being able to use lastMeterProduction and lastMeterConsumption as is available in the API, would give erroneous short term statistics but correct long term statistics.

Describe alternatives you've considered I could use the Tibber Developer API to give me these, but the I would lose the MQTT setup and be reliable on Tibber.

Additional context The net meter is an Landis+Gyr E360.

Power outage 20.00-21.00

image

Power outage around 04.00 and the Pulse was unavailable and needed rebooting (which I did in the morning).

image
toreamun commented 1 year ago

I think this can be done by adding two additional sensor. Then you can pick if you want current sensors or sensors with last registered state. I will have a look at it.

tfriberg commented 1 year ago

I think this can be done by adding two additional sensor. Then you can pick if you want current sensors or sensors with last registered state. I will have a look at it.

An observation I made was that the polling frequency via the Tibber devloper API of lastMeterProduction and lastMeterConsumption (at least consumption) felt erratic. When there was no grid draw (i.e. when the home used all the produced solar power and the surplus was sent to the grid), I interpreted it as that it the Pulse/the API didn't bother updating lastMeterConsumption.

So of there is a way to pull the production and consumption frequently (5, 15, 30 min or w/e) would be great!

bjornta commented 1 year ago

Would we be able to simulate Tibber's "sensor.accumulated_consumption_current_hour_xxxxx" in this case?

matteskonto commented 1 year ago

Since Tibber is receiving regular "lastMeterConsumption" (I get every 5-10 sec via Tibber API) shouldn't the hosted MQTT server also receive these updates as well?

Shouldn't everything that is pushed to Tibber cloud should also be pushed to the local MQTT server at the same rate?

flopp999 commented 1 year ago

I think last meters are now available? I helped a friend and he got them both.

tfriberg commented 1 year ago
image

I think last meters are now available? I helped a friend and he got them both.

These are the sensors I get with my existing installation. Also when adding integration again, I get the same sensors, and none I can identify as last meter.

flopp999 commented 1 year ago

This is what my friend get. He has Kamstrup something... Sweden image