Free Nights Energy Tariff?

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

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!

1 Like

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

Thanks for your help. Not sure why… It might be user error to be honest, I cant find the helper :frowning:

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

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.

:thinking:

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

ah! I see! ok ok, let me take a stab at the yaml. Thanks!

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

You are correct, I had the logic backwards and is now fixed.
Thanks!