parallelsys
(Fernando Fuentes)
December 4, 2022, 6:19pm
1
Hello Team, I am looking for a way to start a tariff that does not account for energy charges from 9PM to 7AM.
Right now, HA is tracking properly my usage during the day with cost, I need to subtract the specific range of kWh used during that period.
Any ideas? Is anybody out there doing something similar?
Thanks!
Why don’t you set the price correctly? Because, consumed kWh is still correct and if you dynamically adjust the price, it would also work fine.
If you really insist on excluding these times from energy dashboard, you probably need to run some sql scripts daily to set zero values.
1 Like
parallelsys
(Fernando Fuentes)
December 5, 2022, 4:47am
3
Can you elaborate?
What do you mean set the price correctly?
Is there a way to set the price of kWh to 0 base on time?
Thanks for your reply!
parallelsys
(Fernando Fuentes)
December 5, 2022, 5:47am
5
I have created the helpers but is not clear how to integrate the helpers so it can track during specific times.
Examples would be greatly appreciated!
Thanks for your reply!
You should have an input helper called energy_price and you can set its value via an automation and energy dashboard will use the new value for calculating.
Everyday at 9pm, set it 0,
At 7 am, set it back to original price
d
1 Like
parallelsys
(Fernando Fuentes)
December 5, 2022, 4:26pm
7
Thanks for your help. Not sure why… It might be user error to be honest, I cant find the helper
Thanks in advance for your patience and help.
1 Like
Be sure that you enabled it via energy dashboard for each tracked entity. You might be using static pricing option, 4th one.
This is configured for each tracked entity, keep in mind that.
1 Like
parallelsys
(Fernando Fuentes)
December 5, 2022, 6:19pm
9
I got that part, I guess what I am trying to figure out, is how to create that entity. I dont see to be able to create one base on “energy_price”
You can create a helper entity through;
Settings - devices and services - helpers (bottom) - click create on this page. I have shared my example on first post.
krskrab
December 5, 2022, 8:04pm
11
template:
- sensor:
- name: Energy price
unique_id: energy_price
unit_of_measurement: €/kWh
state: >
{% set hr = now().hour %}
{% if (6 <= hr < 22 ) %}
{{ 1.11 }}
{% else %}
{{ 0.5 }}
{% endif %}
1 Like
parallelsys
(Fernando Fuentes)
December 5, 2022, 8:09pm
12
ah! I see! ok ok, let me take a stab at the yaml. Thanks!
parallelsys
(Fernando Fuentes)
December 5, 2022, 10:24pm
13
Here is what I got so far:
- sensor:
- name: Energy price
unique_id: energy_price
unit_of_measurement: $/kWh
state: >
{% set hr = now().hour %}
{% if (7 <= hr < 22 ) %}
{{ 0.0 }}
{% else %}
{{ 0.2501 }}
{% endif %}
Through out the day, between 7 to 22, the price is zero (0), is that right?
This is contrary to what you have asked
2 Likes
parallelsys
(Fernando Fuentes)
December 6, 2022, 6:54am
15
You are correct, I had the logic backwards and is now fixed.
Thanks!