Hi all
I need to make an automation for my new utility meter tariffs. (until now I haven’t got peak-offpeak)
So here in Greece we have the following
Winter season:
1/11-30/4 : offpeak tarrif between 2:00-8:00 and 15:00-17:00
summer season:
1/5-31/10: offpeak tarrif between 23:00 - 7:00
I made the following 2 automation (1 for each season) I am sure that they could be more elegant, but this is what I manage. I am not sure if the times in Winter are ok. Can someone confirm please?
Winter = 1/11-30/4 : offpeak tarrif between 2:00-8:00 and 15:00-17:00
- id: Winter Deh Night Day
alias: Winter Deh Night Day
trigger:
- platform: time
at: "08:00:00"
variables:
tariff: "peak"
- platform: time
at: "15:00:00"
variables:
tariff: "offpeak"
- platform: time
at: "17:00:00"
variables:
tariff: "peak"
- platform: time
at: "02:00:00"
variables:
tariff: "offpeak"
condition:
- condition: template
value_template: '{{ now().month >= 11 or now().month <= 04 }}'
action:
- service: select.select_option
target:
entity_id: select.daily_energy2
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.monthly_energy2
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.air_condtion_daily_energy2
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.air_condtion_monthly_energy2
data:
option: "{{ tariff }}"
Summer = 1/5-31/10: offpeak tarrif between 23:00 - 7:00
- id: Summer Deh Night Day
alias: Summer Deh Night Day
trigger:
- platform: time
at: "07:00:00"
variables:
tariff: "peak"
- platform: time
at: "23:00:00"
variables:
tariff: "offpeak"
condition:
- condition: template
value_template: '{{ now().month >= 5 or now().month <= 10 }}'
action:
- service: select.select_option
target:
entity_id: select.daily_energy2
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.monthly_energy2
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.air_condtion_daily_energy2
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.air_condtion_monthly_energy2
data:
option: "{{ tariff }}"
Thanks but to be honest I don’t understand what you mean.
I followed the below. I am not sure how I could use the sensor. I thought that in order to declare the peak and the offpeak I need the automation
Tom I see now what Hellis meant. I will try to understand the above and to implement it.
Hellis thanks for your offer. I will try it and I will give you a call in the weekend if I can’t manage it.
So, I found almost ready what I needed. I took the sensor from here, and changed toms automation and the sensors are working. At least for summer and for peak. I will see at night if it will change to offpeak.
However, there are now 2 sensors that I can not delete/remove although I have deleted them from the configuration file. No big deal, I think I will find a way to remove them at the end.
Hi,
Not trying to hijack, i’m replying to help people searching for similar solutions.
Living in Australia, we have some complex Time of use energy tariffs…
I’ve used the advice here to knock up the following which seems a little ‘clunky’ but seems to work
Is there any better way to do this?
(quite new to HA and YAML)
### https://www.energyaustralia.com.au/home/help-and-support/faqs/ausgridchanges for the TOU setup
### Summer Shoulder 7am-2pm & 8pm-10pm. Peak 2pm-8pm – 1st November to 31 March
### Winter Shoulder 7am-5pm & 9pm-10pm. Peak 5pm-9pm – 1st June to 31 August
### Others Shoulder 7am-10pm. April, May, September, October
### Off Peak always 10pm-7am
template:
- binary_sensor:
- name: "Shoulder Time"
icon: "mdi:power-plug"
state: "{{ (((now().month in [11,12,1,2,3])
and (now().weekday() < 5)
and (7 < now().hour < 14)
or (20 < now().hour < 22))
or ((now().month in [6,7,8])
and (now().weekday() < 5)
and ((7 < now().hour < 17)
or (21 < now().hour < 22)))
or (now().month in [4,5,9,10])
and (7 < now().hour <22)) }}"
- binary_sensor:
- name: "Peak Time"
icon: "mdi:power-plug"
state: "{{ (((now().month in [11,12,1,2,3])
and (now().weekday() < 5)
and (14 < now().hour < 20))
or ((now().month in [6,7,8])
and (now().weekday() < 5)
and (17 < now().hour < 21 ))) }}"
- binary_sensor:
- name: "Off Peak Time"
icon: "mdi:power-plug"
state: "{{ (( (now().weekday() < 5)
and (22 < now().hour < 7))
or ((now().weekday() > 5)
and (22 < now().hour < 7))
or ((now().month in [4,5,9,10])
and (22 < now().hour < 7 ))) }}"
I’m using it currently to just show what energy rate is being charged in my dash, but will use it to figure out energy billing when i learn how.
I’ll tweak the dash to be a more elegant display once i figure that out