Doktor-X
(Doktor-X)
October 19, 2023, 8:58am
1
Hello, i need help for setting one place that will contain price for peek and offpeek price so that, if price change i dont have to do it one by one for all my sensors and i can just change it in one place. At the moment i have it setu like this and it works, but how do i replace fix price with some sort of variable
sensor:
- platform: template
sensors:
dnevni_trosak_klima:
friendly_name: "Dnevni Trosak klima"
unit_of_measurement: '€'
value_template: "{{ (states('sensor.dnevna_potrosnja_klima_vt') | float * 0.157003 + states('sensor.dnevna_potrosnja_klima_nt') | float * 0.080965) | round(2) }}"
So how do i replace 0.157003 and 0.080965 with variable or somthing else
Doktor-X
(Doktor-X)
October 19, 2023, 9:03am
3
I have to admit that I don’t really know how to use that information, can you explain it to me a bit
tom_l
October 19, 2023, 9:09am
4
Create two:
Put them in your dashboard. Put your prices in them.
Use them in your template the same way you would use a sensor:
value_template: "{{ (states('sensor.dnevna_potrosnja_klima_vt')|float(0) * states('input_number.foobar')|float(0) + etc...
Doktor-X
(Doktor-X)
October 19, 2023, 9:34am
5
So in nutshell i just need to replace in my code this parts from
float * 0.157003 and float * 0.080965
to
float(0) * states('input_number.foobar')|float(0)
I presume that this foobar name needs to be same as name in input number helper
tom_l
October 19, 2023, 9:38am
6
Yes. That was just an example.
Doktor-X
(Doktor-X)
October 19, 2023, 11:11am
7
Im testing input number helper in energy dashboard so that i dont mess up my yaml config, but im facing problem energy cost is in - and not +, i dont know what i did wrong
tom_l
October 19, 2023, 12:10pm
8
That is correct. Negative means you owe money.
Doktor-X
(Doktor-X)
October 19, 2023, 1:51pm
9
Now that day reseted price is in + and correctly calculated, to bad that enegry dashboard update interval is not in real time
tom_l
October 20, 2023, 9:28am
10
If you want a real time (power) card almost identical to the energy flow card, check this out:
Hello there
[power_flow_card_plus]
A few days ago I forked the original Power Flow Card and I’ve done quite some work on it since then:
Display Individual Power Entities - You can now display individual power entities on the card, making it easier to track specific devices or circuits in your home.
Customize Individual Entities’ Label, Icon and Color - With the new update, you can customize the label, icon, and color of each individual entity. This allows you to tailor the card…