I would like to calculate my current electricity costs from my Tibber tariff using a function.
I thought I could perform an action on this because the sensor.accumulated_consumption_current_hour value changes.
However, I would then need the last value before the change and the electricity price of the last hour for the calculation.
Do you perhaps have an idea how one could represent such a calculation/function?
Or does such a function already exist?
It looks like I have found a simple solution for calculating electricity prices, the Tariffs.
However, as a comparison, I would like to compare the price of a second electricity provider, but without these two providers being added together in the energy dashboard.
I have another question. For my alternative electricity provider, I would like to switch the electricity price between main and off-peak tariffs.
For this I have created two helpers. One that gives me a switch for off-peak hours (10 p.m. - 6 a.m.) and one in which I can then write the corresponding electricity price.
The switchover in the automation should then look like this:
Unfortunately, the code doesn’t seem to be correct, because the variable “input_numer.strompreis_stadtwerk” is not described in this way and an error message appears.
extra keys not allowed @ data[‘state’]
Does anyone have an idea how I can solve the problem in code?
I liked a new entity named “verbrauch_h_akt_tibber”
create and describe it with the value from the sensor "sensor.accumulated_consumption_current_hour_tibber’'.
I entered the following into the configurations.yaml, but unfortunately the new entity does not appear.
I would like to calculate the current difference/savings between the two providers using the two entities “sensor.verbrauch_tibber_ht_nt_cost” and “sensor.verbrauch_sw_ht_nt_cost” .
This also works wonderfully with the code shown.
However, I have the problem that after restarting HA, the two entities are set to zero and the difference value is therefore lost.
Is there another way to display the current electricity costs from the energy dashboard?