hekmon / rtetempo

RTE Tempo days calendar and sensors for Home Assistant
MIT License
141 stars 6 forks source link

Switch price per hour sensor example to be €/kWh #8

Closed fcrozat closed 1 year ago

fcrozat commented 1 year ago

Currently, the example given for price per hour sensor is not in euro cents, not euro, which make it not usable on the Energy dashboard as price source.

I would suggest to drop the * 100 in the template yaml to have the proper price in €

hekmon commented 1 year ago

Yes the example does show the price in cents because it is intended to be showed/printed on screen as a widget and not used as a source for the energy dashboard.

Switching it to euros would result in the loss of the visual sub cents values. On the other end, source prices used in the example are in € especially because their are designed to be used as input in the energy dashboard.

I know a lot of people are seeking to have a dynamic prices sensor to be applied to their single metering sensor (here and here). But using tempo I personnaly think this is a not-so-good approach: the only SoT (source of truth) of how many kWh you have consumed in each color and on/off peak are the Linky integrated counters. They are the one retreived by Enedis and transmitted to EDF for billing. They are the ones people should recover to applied (fixed) prices on each of them. Having a single global metering device and trying to apply on it a constantly changing price is an approximation at best.

Not even mentionning that you will lost this kind of details from HA: image

This is why, for this example, everything related to prices (input numbers and template sensor) are in seperated github gists: they are not part of this integration. This integration is all about Tempo colors from RTE. And RTE has nothing to do with prices (EDF does). This example is here to show how someone can use its sensors (colors and off peak) to make something more. But I am fairly confident that if someone does need a dynamic prices sensor for the energy dashboard, it will be easy for him to adapt my example (by removing the * 100 like you said).

But I do not want to publish it in this form because I do not "believe" this is the right way of doing it :)

fcrozat commented 1 year ago

Wow, I wasn't aware you could get this kind of refinement in HA Energy dashboard. I've read the dicusssion on HA Community (quite interesting). Do you have a gist with your sensor template for Linky ?

hekmon commented 1 year ago

They actually are not template sensors, but real sensors from my other integration LinkyTIC. I use the prices in the input numbers from the example for each of them in order to have this energy dashboard results.

fcrozat commented 1 year ago

Ok. I'll check the other solution mentioned on the forum. Thanks