Energy Meter from Rest API

Hello,

My energy provider expose an API to get the per days energy consumption in the following form:

{
            "date": "2023-10-01T00:00:00.000+0000",
            "f1": 0.467,
            "f2": 0.516,
            "f3": 0.473,
            "f4": 0.579
 }

Is there a way to integrate it in home assistant?

On a first glance ‘yes’ but you’d have to be a bit more explanatory as ‘integrate’ can mean a lot.
As a start you can create different sensors using this one RESTful - Home Assistant (home-assistant.io)

Thank you for response.

I would just have the total consumption per day but the datas I’m receiving from the endpoint is aggregated per day and I just have the now() - 2days datas (so I can just see the day before yesterday consumption)

How I can tell to HA that the sensor is updated 2 days ago and not now?

That is quite a tricky thing indeed as I assume you want to add it to the Energy dashboard? Fafaik there is no solution to ‘tell’ the statistics (stats are used in dashboard) to offset x days

If not E dashboard, alternatively you can use a apexcharts with a 2 days offset

Yes, I would like to add it to dashboard.

I just need a way out to tell it that a value relies to a date

Well…as mentioned…this does not exist fafaik and I have not seen an easy way to load data into statistics too so you’d have to build this and I guess that is not ‘worth’ it.

1 Like