Hi
While having programmed before I am quite new to automations and energy monitoring, and would like some feedback if my thinking is correct and good.
My energy company has a different tariff during the winter months between 07-21 weekdays (excluding weekends and specific holidays)
I have just made a utility meter helper to split the consumed energy and wondered if this automation is smart or if there is something I miss:
It’s for now running on startup and every hour to be safe.
alias: EnergyCostMode
description: ""
triggers:
- trigger: homeassistant
event: start
- trigger: time_pattern
hours: "*"
conditions: []
actions:
- alias: Select mode on 'Energi mätare' based on time and season
if:
- condition: time
after: "06:59:00"
weekday:
- mon
- tue
- wed
- thu
- fri
before: "20:59:00"
alias: Time is between 07-21 on weekdays
- condition: template
value_template: "{{ now().month in [11, 12, 1, 2, 3] }}"
alias: Month is between november and march
- condition: state
entity_id: calendar.sweden
state:
- "off"
alias: Not a swedish holiday
then:
- action: select.select_option
metadata: {}
target:
entity_id: select.energi_matare
data:
option: Högpristid
alias: Select 'Peak tariff' on Energi mätare
else:
- action: select.select_option
metadata: {}
target:
entity_id: select.energi_matare
data:
option: Övrig tid
alias: Select 'Offpeak tariff' on Energi mätare
mode: single