Advertisement
Guest User

Untitled

a guest
Aug 7th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. """
  2. Thermostat day script
  3. """
  4. @time_trigger("once(7:30:00)")
  5. def thermostat_work_day():
  6.     """Trigger at 7:30am every"""
  7.     log.info(f"Thermostat Work Day")
  8.     """Only trigger on workday"""
  9.     if binary_sensor.workday == 'on'
  10.         """Set High Temp"""
  11.         if float(sensor.dark_sky_daytime_high_temperature_0d) > 85.0:
  12.             hightemp = 85
  13.         elif float(sensor.dark_sky_daytime_high_temperature_0d) < 85.0:
  14.             hightemp = 75
  15.         """Set Low Temp"""
  16.         if float(sensor.dark_sky_overnight_low_temperature_0d) > 50.0:
  17.             lowtemp = 55
  18.         elif float(sensor.dark_sky_overnight_low_temperature_0d) < 50.0:
  19.             lowtemp = 65
  20.         """Send the actual command to the thermostat"""
  21.         climate.set_temperature(entity_id="climate.radio_thermostat_company_of_america_ct101_thermostat_iris_mode",target_temp_low=lowtemp,target_temp_high=hightemp,hvac_mode="heat_cool")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement