Interesting that you consider RF to be “old tech”.
What's the more modern replacement then?
What's the more modern replacement then?
all_day_start = datetime.time(hour=6, minute=30, second=0) all_day_end = datetime.time(hour=23, minute=00, second=0) all_day = TimeCondition(all_day_start, all_day_end) weekend = DayOfWeekCondition([6, 7]) weekend_routine_conditions = [("AND", all_day), ("AND",weekend)]
weekday = DayOfWeekCondition([1,2,3,4,5]) morning_start = datetime.time(hour=6, minute=30, second=0) morning_end = datetime.time(hour=8, minute=00, second=0) morning = TimeCondition(morning_start,morning_end) weekday_morning_routine_conditions = [("AND", weekday), ("AND", morning)] evening_start = datetime.time(hour=17, minute=00, second=0) evening_end = datetime.time(hour=23, minute=00, second=0) evening = TimeCondition(evening_start, evening_end) weekday_evening_routine_conditions = [("AND", weekday), ("AND", evening)]
target_temps = { "default": {"livingRoom":6, "bedroom":6, "garage":1, "office":6}, "eco": {"livingRoom": 18, "bedroom": 16, "garage": 2, "office": 18}, "preferred": {"livingRoom": 20, "bedroom": 18, "garage": 2, "office": 20}, "max": {"livingRoom": 30, "bedroom": 30, "garage": 30, "office": 30} } temp_manager = TemperatureManager(target_temps)
maintenance_schedule = MultiRoomTempSchedule([], "Maintenance Schedule", temp_manager, "default")
weekend_routine_schedule = MultiRoomTempSchedule( weekend_routine_conditions, "Weekend Routine", temp_manager, "eco" ) weekday_morning_routine_schedule = MultiRoomTempSchedule( weekday_morning_routine_conditions, "Weekday Morning Routine", temp_manager, "eco" ) weekday_evening_routine_schedule = MultiRoomTempSchedule(weekday_evening_routine_conditions, "Weekday Evening Routine", temp_manager, "eco")
presence_condition = PresenceCondition("presenceHome") presence_schedule = PresenceTempSchedule([("AND",all_day),("AND", presence_condition )], "Presence Schedule", temp_manager, "preferred")
scheduler = Scheduler([weekend_routine_schedule, weekday_morning_routine_schedule, weekday_evening_routine_schedule, presence_schedule, maintenance_schedule])
while True: scheduler.update() time.sleep(30)
Comment