Closed Nezz closed 1 year ago
I checked the oma-helen-cli and it only finds old contracts. It grabs the first contract's data by default, which is the oldest contract:
https://github.com/carohauta/oma-helen-cli/blob/5471052e0308726e1b408728f8af088e4c36b3b1/helenservice/api_client.py#L232
Looks like newer contracts are only returned by newer API versions, but once the correct delivery_site_id
is found, the older APIs work.
Adding support for the HA Energy dashboard might need some looking into. If I remember correctly, it does require a certain fixed data format – compared to the current implementation which relies on custom template sensors.
The contract function in the oma-helen-cli seems to be the culprit for a number of issues users are facing with the HA integration. Instead of getting the first contract in the list, it should be able to recognize the active contract somehow. Of course some people might have multiple active contracts in multiple addresses.
The problem is that I only have one active contract with Helen so I really can't tell how the contract response looks for someone who has multiple contracts. But I will try to figure this out.
Thanks @carohauta. You can find an example response with multiple contracts at the end of my original post by clicking on Details
.
I have now upgraded the integration to use a newer Helen API (v14). So far it now supports following the total energy transfer costs of the on-going month, but not yet the consumption from the /measurements/electricity-transfer
endpoint.
I hope to implement that in the next release.
I added supports for measurements here: https://github.com/carohauta/oma-helen-cli/pull/2
I also added a sensor for monthly consumption for integration into the energy dashboard: https://github.com/carohauta/oma-helen-ha-integration/pull/10
I'd like to use this integration to feed my overall electricity consumption into the energy dashboard. However, I buy electricity from another company. Helen delivers the electricity though, so on Oma Helen I'm able to see my consumption. Would it be possible to add support for that?
The API request seems to be this:
Example response:
The
delivery_site_id
and transfer prices can be grabbed from this API:Example response (heavily redacted):