Schedy fails to operate properly on v4.5.11, works fine on v4.5.8
What happened?
The HASS APP Shchedy runs properly and sets the thermostat correctly at startup, however, any time based changes in the Schedy app fail to apply.
Version
4.5.11
Installation type
Home Assistant add-on
Relevant log output
I have info logging enabled, and nothing shows up at the time of the scheduled change.
Relevant code in the app or config file that caused the issue
thermostat_schedule:
module: hass_apps_loader
class: SchedyApp
debug: true
actor_type: thermostat
schedule_snippets:
######################
### Cooling Season ###
######################
cooling_season_home:
- v: 75
rules:
- { start: "7:00", end: "21:00"}
- v: 69
cooling_season_vacation:
- v: 78
cooling_season_guest:
- v: 75
######################
### Heating Season ###
######################
heating_season_home:
- v: 70
rules:
- {start: "07:00", end: "21:00"}
- v: 67
heating_season_vacation:
- v: 67
heating_season_guest:
- v: 70
rules:
- {start: "07:00", end: "21:00"}
- v: 67
rooms:
whole_house:
actors:
climate.thermostat_main:
supports_hvac_modes: false
schedule:
######################
### Cooling Season ###
######################
- x: "IncludeSchedule(schedule_snippets['cooling_season_home']) if state('climate.thermostat_main') == 'cool' and state('input_select.thermostat_schedule_main') == 'Home' else Next()"
- x: "IncludeSchedule(schedule_snippets['cooling_season_vacation']) if state('climate.thermostat_main') == 'cool' and state('input_select.thermostat_schedule_main') == 'Vacation' else Next()"
######################
### Heating Season ###
######################
#- x: "IncludeSchedule(schedule_snippets['heating_season_guest']) if state('climate.thermostat_main') == 'heat' and is_on('switch.guest_mode') else Next()"
- x: "IncludeSchedule(schedule_snippets['heating_season_home']) if state('climate.thermostat_main') == 'heat' and state('input_select.thermostat_schedule_main') == 'Home' else Next()"
- x: "IncludeSchedule(schedule_snippets['heating_season_vacation']) if state('climate.thermostat_main') == 'heat' and state('input_select.thermostat_schedule_main') == 'Vacation' else Next()"
watched_entities:
- climate.thermostat_main
- input_select.thermostat_schedule_main
- switch.guest_mode
Anything else?
No response
This seems to be a currently known issue of AppDeamon itself, which fails to correctly schedule timers. Sometimes the timer does not fire at all, sometimes it fires with delays.
I run into the same problem and figured out a workaround. Instead of calling the function run_daily with a time-object, call it with a parsed string.
For schedy this requires to edit the file room.py and change lines 464 and 465 to the following:
for _time in times:
parsed_time = self.app.parse_time(_time.strftime("%H:%M:%S"), aware=True)
self.app.run_daily(self._scheduling_timer_cb, parsed_time)
There are a couple of scheduler issues that we are planning on fixing in the next release in a week or two.
Should be fixed by #2515