I’m having a problem with schedule_prepend
in my schedy heating script. The relevant parts are:
schedule_prepend:
- x: "6 if house_mode() == 'Away' or season() == 'Summer' else Next()"
# default rule to apply if no other matches
schedule_append:
- v: 15
rooms:
livingroom:
rescheduling_delay: 0
replicate_changes: true
actors:
climate.livingroom_thermostat:
schedule:
- x: "15 if simulate_bedtime() == 'on' else Next()"
- v: 19
rules:
- weekdays: 1-5
rules:
- rules:
# - x: "Next() if season() == 'Spring' else Break()"
# - {v: 15, start: "23:00", end: "17:00+1d" }
# - { start: "17:00", end: "23:00" }
- x: "Next() if house_mode() == 'Home - Normal Day' else Break()"
- { start: "07:00", end: "09:00" }
- { start: "17:00", end: "19:00" }
- rules:
- x: "Next() if house_mode() == 'Home - Home Day' else Break()"
- { start: "07:00", end: "09:00" }
- { v: 19, start: "09:00", end: "17:00" }
- { start: "17:00", end: "22:30" }
- weekdays: 6-7
rules:
- { start: "07:00", end: "09:00" }
- { v: 19, start: "09:00", end: "17:00" }
- { start: "17:00", end: "22:30" }
Oddly, the prepend is being ignored. From the log:
schedy_heating: --- [R:livingroom] Initializing room (name='livingroom').
schedy_heating: --- [R:livingroom] [A:climate.livingroom_thermostat] Initializing actor (entity_id='climate.livingroom_thermostat', type='thermostat').
schedy_heating: --- [R:livingroom] [A:climate.livingroom_thermostat] Fetching initial state.
schedy_heating: --> [R:livingroom] [A:climate.livingroom_thermostat] Attribute 'state' is 'heat'.
schedy_heating: --> [R:livingroom] [A:climate.livingroom_thermostat] Attribute 'temperature' is 15.0.
schedy_heating: --> [R:livingroom] [A:climate.livingroom_thermostat] Attribute 'current_temperature' is 21.6.
schedy_heating: --> [R:livingroom] [A:climate.livingroom_thermostat] Received value of 15.0��.
schedy_heating: --- [R:livingroom] [A:climate.livingroom_thermostat] Listening for state changes.
schedy_heating: --- [R:livingroom] Registering scheduling timers at: [00:00:00, 07:00:00, 09:00:00, 17:00:00, 19:00:00, 22:30:00]
schedy_heating: <-- [R:livingroom] Loading state of 'schedy_room.schedy_heating_livingroom' from Home Assistant.
schedy_heating: --> [R:livingroom] = {'entity_id': 'schedy_room.schedy_heating_livingroom', 'state': '15.0', 'attributes': {'actor_wanted_values': {'climate.livingroom_thermostat': '15.0'}, 'scheduled_value': '6.0', 'rescheduling_time': None, 'overlay_active': False}, 'last_changed': '2022-07-17T21:39:27.711702+00:00', 'last_updated': '2022-07-17T21:39:27.711702+00:00', 'context': {'id': '01G871M6AZ9BK05R8EAN6S9BBN', 'parent_id': None, 'user_id': '0ef99f16230e4d129335978c77d3c611'}}
schedy_heating: --- [R:livingroom] Evaluating room's schedule (reset=False, force_resend=False).
schedy_heating: --- [R:livingroom] Assuming it to be 2022-07-26 19:27:27.989153.
schedy_heating: --- [R:livingroom] ������ [SUB] <<Schedule 'livingroom'>/1:<Rule with sub <Schedule 'prepend'>>>
schedy_heating: --- [R:livingroom] ������ [ACT] <<Schedule 'livingroom'>/1/1:<Rule x="6 if house_mode() == 'Away' or season() "...>>
schedy_heating: --- [R:livingroom] Initializing expression helper: BasicHelper, order = 0
schedy_heating: --- [R:livingroom] Initializing expression helper: PatternHelper, order = 0
schedy_heating: --- [R:livingroom] Initializing expression helper: ScheduleHelper, order = 0
schedy_heating: --- [R:livingroom] Initializing expression helper: StateHelper, order = 0
schedy_heating: --- [R:livingroom] Initializing expression helper: ThermostatExpressionHelper, order = 0
schedy_heating: --- [R:livingroom] Initializing expression helper: CustomEnvironmentHelper, order = 1000
schedy_heating: --- [R:livingroom] Executing the expression_environment script.
schedy_heating: --- [R:livingroom] ������ => 6
schedy_heating: --- [R:livingroom] Final result: 6.0��, markers: set()
schedy_heating: --- [R:livingroom] Result didn't change, not setting it again.
schedy_heating: <-- [R:livingroom] Sending state to HA: state='15.0', attributes={'actor_wanted_values': {'climate.livingroom_thermostat': '15.0'}, 'scheduled_value': '6.0', 'rescheduling_time': None, 'overlay_active': False}
house_mode
is set to away
.
As you can see, it comes to the correect conclusion that the target should be set to 6C, but then does nothing about it.
Any ideas?