Climate Scheduler

Hi Folks,

I’ve put together a simple integration that lets you control climate entities over a 24 hour period, it lets you drag nodes around on a graph to set options at 15 minute intervals. It should also let you change settings like heat/cool/fan along with related speeds, but I’ve not tested those in anger yet as it’s winter in the UK. :sweat_smile:

It uses existing climate entities so should be agnostic to actual hardware as long as it is present already in Home Assistant. It should also use the system setting for Celsius or Fahrenheit but I’ve not tested it.

It’s a work in progress and though I’m a software engineer I’ve not made anything for Home Assistant before, this was created with assistance of Copilot under my guidance. It’s installed on my server at the minute but any constructive feedback would be appreciated, any problems please raise an issue on GitHub for me to track.

Features I’ll add at some point:

  • 7-day scheduling
  • Scheduling of other devices (switches for a boiler, fans, pumps, etc)
  • Show the temperature history for the current day/week in the background of the graph
  • Sunrise/sunset to use as schedules
  • Thermostat groups (Upstairs, Downstairs, etc)
  • Sync schedule to device: Some room thermostats have on-board scheduling so if we could sync the schedule to it then it would work in case of server outages.

The integration looks up all climate entities on your server and adds them to a list, you can select which ones to control. This also means that if your boiler has a climate entity you may be able to schedule it too, it isn’t designed for that per-se but in theory it should work, you do this at your own risk however.

If you click on one of the active thermostats you should see the following above the graph, it’ll let you individually enable or disable scheduled.

Double-click on the graph and it should add a new node, click on it to get an extra UI below the graph for extra settings, drag the node to move change time/temperature values. If you are in an active time period the temperature should be updated immediately, if you reboot your server it should also check and update to the current scheduled values too.

It’s only 24 hour at the minute but I have plans to extend this for 7-day, weekday/weekend, and holiday modes. If you manually change the current temperature it should also respect that change and not update until the next time period kicks in.

You should be able to install it via HACS by the usual methods, more info at the link below:

Literally minutes later I spotted another post that introduced me to this add-on that I didn’t know existed. Ah well, I like my graphs. :sweat_smile:

1 Like

Great Job!
I really like the idea if using the mouse to set temperatures and times :+1:

The distinction between weekday/weekend (for me workday/holiday/weekend would be even better) would be at the top of my feature list :slight_smile:

Good thing, though, you used the caveat here:

The conversion between C and F doesn’t work smoothly yet - happy to work with you on figuring it out in case you need some help here:

And, although I live in Fahrenheit-Country now, I grew up in the Celsius World.
Sometimes, I’m still struggling with the conversion, which is evident, that the temperature in my car is set to Celsius, while everything else is in Fahrenheit :stuck_out_tongue:

P.S.:
Happy to copy this over to a Github issue, if that’s where you’d like to see it.

1 Like

I’ve pushed a fix for the unit issue, if you have a schedule set up already you’ll need to redo the schedules so that the new values are in the correct range. Fingers crossed it works!

Updated to include basic group support.

Known issues:

  • Not functioning in the Home Assistant mobile app
  • Node editor allows for changing of HVAC and other settings, they aren’t currently applied to the device, only temperature is currently controlled
  • Scheduled isn’t updating properly, it should list the current scheduled target temperature and Target will show the actual value that device is set to. This is for cases where someone wants a bit more or less heat than scheduled. The scheduler should respect the change until the next node is hit, more testing is needed.

Version 1.0.3 pushed, it fixes an issue where it wasn’t working in the mobile app.

Fixed a few bugs, now showing temperature history for grouped and single thermostats:

Just discovered that you’ posted some updates, sorry.
Didn’t get a notification as I was ‘Tracking’ not ‘Watching’ the thread.

I just installed V1.0.3 - will feed back ASAP :+1:

Oops - doesn’t load:
Component doesn’t load (V1.0.3) · Issue #1 · kneave/climate-scheduler

Let me know if you need any more info.

No worries, I’m posting them in general rather than for you specifically so if you don’t respond then all good. :slight_smile:

The build variable was something I was using in testing and removed, the file was still present for me so didn’t throw an error. Should now be resolved with v1.1.0 that I’ve just released.

Installed fine now and I started trying it out but ran into a few issues:

Some of the selections are not very ‘sticky’, e.g.

  1. If I set the HVAC Mode of a node to ‘Heat’, then select another node and come back to the 1st node, it shows HVAC Mode ‘Off’ again.
  2. If I switch off ‘Enabled’ for a climate entity, go to another climate entity and come back to the 1st one it’s enabled again. This means that the Climate Scheduler will take over my climate control no matter what I say, unless I ‘Ignore’ the climate entity - and then it needs a screen refresh to move it to the bottom ‘Ignored’ section again.

Other observances:

  1. I need to double-tap on the graph to add a new setpoint (instead of single-tapping as the instructions seem to indicate)
  2. Before I add a new node, the orange box - see below - should show the time and the temperature I’m about to select, not the actual temperature at that point in time.

Thanks for the feedback, adding the historic data has confused things more than a little for sure, I’ve been changing things quicker than I’ve been updating the instructions too for sure…

I’ll have a look at these as they’ve been on my list to fix too, with someone else hitting these issues it’s easier to convince myself it’s worth fixing!

I’ve added a settings pane where you can switch modes for the tooltips, between historic values and what’s currently under the mouse pointer. If in historic mode you should still see pointer values while dragging.

I’ve also hopefully fixed a bunch of issues with HVAC and similar settings, let me know if you have any issues with those.

I’ll give it another try :slight_smile:

1 Like

A lot of changes and because we haven’t had a weekend yet hasn’t been fully tested, but full 7 day scheduling is available!

Also added a big quality of life update in the shape of copy/paste for the schedules. You should be able to copy an existing one to newly created days to speed things up.

v1.3.0 has been released on github and should be available as an update in HACS too.

v1.4.0 released, the new feature is being able to drag a time period around so you can still have a period of the same length of heating/cooling but the start and end times change.

I have been using the scheduler for a few years now but I really like your graph idea and will try it out for sure. Thank you for your contributions!

1 Like

v1.5.0 released, added a custom card so that the integration can be included in tabbed dashboards

I’ve pushed a bugfix release, this improves performance and mitigates a possible security issue too:

Unfortunately, I can’t get it set up.

Here’s the log entry:

Logger: homeassistant.config_entries
Source: config_entries.py:761
First occurred: 13:46:33 (2 occurrences)
Last logged: 13:49:11

Error setting up entry Climate Scheduler for climate_scheduler
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 761, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/climate_scheduler/__init__.py", line 348, in async_setup_entry
    await _async_setup_common(hass)
  File "/config/custom_components/climate_scheduler/__init__.py", line 331, in _async_setup_common
    await async_register_panel(hass)
  File "/config/custom_components/climate_scheduler/__init__.py", line 387, in async_register_panel
    hass.http.register_static_path(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HomeAssistantHTTP' object has no attribute 'register_static_path'. Did you mean: 'async_register_static_paths'?

Version 1.5.0 seems to work fine, though.