Dual Tariff on Home assistant

I have been trying to figure out what I may have done wrong. But having no luck. I thought I would ask the Hive Mind.

I am new to home assistant, so be gentle . I am trying to set up a Peak / Off peak tariff. Everything appears to work correctly. But the peak is all show showing in off peak time of energy graph. This is also messing with my costs.

Help

image

Show the history graph for the two sensors.

Show how you have configured the tariff selection. Format the config properly for the forum by doing this: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Thanks Tom, New to the forum, did not know the etiquette.

This is a snap of History for both Sensors…

Both sensors are increasing at the same time. This should not be possible when using tariffs.

alias: "Energy: Peak and Offpeak Tariffs"
description: ""
trigger:
  - platform: time
    at: input_datetime.off_peak_energy_end
    variables:
      tariff: peak
  - platform: time
    at: input_datetime.off_peak_energy_start
    variables:
      tariff: offpeak
action:
  - service: select.select_option
    target:
      entity_id: select.energy_grid_import
    data:
      option: "{{ tariff }}"
mode: single

The automation looks good. I can’t explain it. Only one of the sensors should increase at a time, like this:

Not like this:

Thanks tom , Cant get my head Around this. I will keep on trying

When did you create the automation?

About a week ago.

Is the utility meter defined in YAML or UI Helper?

Are there any relevant errors in Settings → System → Logs?

I used the UI helper, I have checked the logs, The only thing I can see is

Aha!

Capitalisation is important in Python and Home Assistant.

Change your automation to:

trigger:
  - platform: time
    at: input_datetime.off_peak_energy_end
    variables:
      tariff: Peak # not peak

You used capitalisation for one tariff but not the other. Unfortunately I don’t think you can edit the Utility Meter helper created in the UI once it is made. You’ll have to change the automation. Or delete the utility meter helper and recreate it if having one lower case and one upper case tariff triggers OCD for you.

You are a genuis , with a very good eye. I did not spot that

Thanks ,

1 Like