Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : RTE tempo days #32

Open
olivier91ou33 opened this issue Feb 11, 2024 · 8 comments
Open

Feature Request : RTE tempo days #32

olivier91ou33 opened this issue Feb 11, 2024 · 8 comments

Comments

@olivier91ou33
Copy link

Hi,

Seeing that there is demand on forums so that HA-Linky can monitor power consumption depending on price plan (base, tempo, HC/HP, ...), I am looking at contributing to the project.

But as a starting point, it would be easier if Conso API could use RTE APIs to get the tempo day color. HA-linky module could then be evolved easier to fetch it along with Linky data and split power consumption by category
That would then open the door to also add cost management for people looking for an exhaustive energy dashboard

Interested in going this way?

@bokub
Copy link
Owner

bokub commented Feb 12, 2024

Hi @odurecu !

The main goal of Conso API is to provide raw data directly from Enedis, without reading, altering or tempering it. In my vision, it's just a basic block that can be used to build more complex tools that can parse, transform, and aggregate data (such as HA Linky)

Tempo days are not managed by Enedis, so this would mean changing Conso API to be dependent of two different APIs, when only a small fraction of users actually have a tempo contract.

If you need additional information from HA Linky, then you should edit HA Linky to fetch this information.
And if you think there is no tool good enough for fetching tempo days, maybe you could build one instead of trying to fit this feature in Conso API, that has nothing to do with contracts or energy cost !
What do you think about it ?

@olivier91ou33
Copy link
Author

I was suggesting using Conso API because other solutions are not really convenient :

  • getting Tempo days from HA-Linky would imply that RTE API credentials are stored in HA-Linky code/conf what is not safe. Anyone could grab them to flood RTE with HA-Linky identity
  • there are a couple of HA addons that do the job (https://github.com/hekmon/rtetempo is quite good) but it would make implementation inside HA-Linky complex to depend on an external module (plan the cases where it is installed or not, get installed after a while...)
    But if you want to stick HA-linky to provding raw data, I can understand.
    As a user, I wanted to have more than that and I saw that there were such requests on the HA forum, that's why I asked

@bokub
Copy link
Owner

bokub commented Feb 12, 2024

But if you want to stick HA-linky to provding raw data, I can understand.

I want Conso API to provide raw data, so I don't want to add this feature in Conso API. Requests on the HA forum are about HA-Linky, not Conso API !

HA-Linky could be smarter and connect to an additional service, I don't have problems with that !
I personally don't use tempo so I don't have knowledge about what already exists, but why not create a "Tempo API" service that HA-Linky could use, instead of trying to add features to Conso API ?

Also, please note that HA Linky still doesn't support cost computations, because of Home Assistant limitations (bokub/ha-linky#2)

@olivier91ou33
Copy link
Author

Conso API makes sense because it federates individual data collection towards Enedis API. A Tempo API service is a bit overkill since it has to send one request per day to RTE api and provide it once to HA-Linky, it is not worth a VM for that or even a container

I know the limitation on cost computation for external data sources. But you can overcome it as soon as you know the plan of the user. Instead of providing the data consumption in a single block, you record multiple statistics (eg consumption_HP and consumption_HP for HP/HC plan). Then you can add each of this stat as an input of the energy dashboard (and configure the price for each of them)

@bokub
Copy link
Owner

bokub commented Feb 12, 2024

Then you can add each of this stat as an input of the energy dashboard (and configure the price for each of them)

No, you can't configure a price, Home Assistant doesn't allow it. That's what bokub/ha-linky#2 is about !

You're talking about having tempo costs, with prices depending on the date, but it's not even possible to configure prices for a dumb "base" or "HP/HC" contract !

What I mean is: why work on a complex tempo feature in Conso API when nobody figured out how to even configure a very basic static price in Home Assistant ?

Step 1: Figure out how to configure prices in home assistant
Step 2: Now you can think about how to add tempo prices

@olivier91ou33
Copy link
Author

The second option (which is one greyed "Utiliser une entité de suivi des coûts totaux") is enough
In addition to publishing 2 energy stats (eg consumption_HP and consumption_HC), you also publish 2 costs stats (cost_HP and cost_HC)
Then you configure 2 power sources : consumption_HP using cost_HP and same one with _HC
Example of what it would look like with Tempo
image

PS : I write in English as a reflex on Github but we can also switch to French if you want...

@bokub
Copy link
Owner

bokub commented Feb 12, 2024

Ah ben oui si tu parles français ce sera plus simple 😄

OK donc ce que tu préconises c'est que HA Linky publie, en plus des données de consommation, des statistiques de coût à part ?

Comme je disais dans mon message précédent, ce serait déjà pas mal d'y aller étape par étape, et de débloquer cette fonctionnalité dans HA Linky (la fameuse issue #2 qui est toujours ouverte) pour les tarifs base, puis HP / HC, avant de s'attaquer à mettre du tempo dans Conso API

Il faut pas mettre la charrue avant les boeufs si tu vois ce que je veux dire

@olivier91ou33
Copy link
Author

Oui, appel à la websocket de HA presque identique à celui de la conso.
Il suffit de faire un 2 ème appel avec la même structure de données en ajoutant _cost au StatisticID par exemple et en mettant le coût par tranche horaire au lieu de la cosommation.

Le tarif base peut être dans l'onglet config de l'addon ou bien créer un input indépendant dans les helpers de HA

Pour l'étape suivante HP/HC, la difficulté est que chaque contrat peut avoir des tranches HC différentes mais a priori, ces créneaux seraient récupérables via l'API Enedis Contracts V5 https://datahub-enedis.fr/services-api/data-connect/documentation/customers-v5-contrats/
Le swagger contient un attribut"offpeak_hours": "HC (23h00-7h30)" sachant qu'il peut y avoir 2 créneaux HC dans une journée (parfois un autre 12h-14h)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants