Given the following config:
- alias: Change Utility Tariffs on Weekends
trigger:
- platform: time
at: '15:00:00'
- platform: time
at: '19:00:00'
condition:
- condition: 'time'
weekday:
- sat
- sun
action:
- service: utility_meter.select_tariff
data:
entity_id:
- utility_meter.daily_energy
- utility_meter.monthly_energy
tariff: peak
- service: utility_meter.select_tariff
data:
entity_id:
- utility_meter.daily_energy
- utility_meter.monthly_energy
tariff: offpeak
- alias: Change Utility Tariffs on Weekdays
trigger:
- platform: time
at: '07:00:00'
- platform: time
at: '14:00:00'
- platform: time
at: '21:00:00'
- platform: time
at: '23:00:00'
condition:
- condition: 'time'
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: utility_meter.select_tariff
data:
entity_id:
- utility_meter.daily_energy
- utility_meter.monthly_energy
tariff: partialpeak
- service: utility_meter.select_tariff
data:
entity_id:
- utility_meter.daily_energy
- utility_meter.monthly_energy
tariff: peak
- service: utility_meter.select_tariff
data:
entity_id:
- utility_meter.daily_energy
- utility_meter.monthly_energy
tariff: partialpeak
- service: utility_meter.select_tariff
data:
entity_id:
- utility_meter.daily_energy
- utility_meter.monthly_energy
HA does not switch tariffs:
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
2019-02-22 07:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Change Utility Tariffs on Weekdays
2019-02-22 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Change Utility Tariffs on Weekdays: Running script
2019-02-22 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Change Utility Tariffs on Weekdays: Executing step call service
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
2019-02-22 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Change Utility Tariffs on Weekdays: Executing step call service
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
2019-02-22 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Change Utility Tariffs on Weekdays: Executing step call service
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
2019-02-22 07:00:00 INFO (MainThread) [homeassistant.helpers.script] Script Change Utility Tariffs on Weekdays: Executing step call service
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
File "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 118, in async_tariff_change
2019-02-22 08:10:48 INFO (MainThread) [homeassistant.components.automation] Initialized trigger Change Utility Tariffs on Weekdays
2019-02-22 08:10:48 INFO (MainThread) [homeassistant.components.automation] Initialized trigger Change Utility Tariffs on Weekdays
2019-02-22 08:10:48 INFO (MainThread) [homeassistant.components.automation] Initialized trigger Change Utility Tariffs on Weekdays
2019-02-22 08:10:48 INFO (MainThread) [homeassistant.components.automation] Initialized trigger Change Utility Tariffs on Weekdays
It always stays on “offpeak”. I looked at utility_meter/sensor.py, but it doesn’t help much.