Weekly Schedule Helper - Multi state option

The current new helper is great, but only has the status On or Off.
It would be nice to add a default state for when nothing is scheduled (Off) and then when make a schedule, be able to give it a specific state.

For example I have curtains that have multi positions during the day. So the options are Open, Closed, Daytime, Evening, etc. I would be nice to be able to schedule that in one helper and not create 3 or 4 helpers for every state

An image maybe explains it better: Different color, different state.
Schedule Options

Or a YAML Example:

# Example configuration.yaml entry
schedule:
  thermostat_schedule:
    name: "Thermostat schedule"
    default_state: Closed
    monday:
      - from: "07:00:00"
        to: "09:00:00"
        state: Open
      - from: "09:00:00"
        to: "11:00:00"
	    state: Daytime		
    tuesday:
      - from: "07:30:00"
        to: "10:00:00"
	    state: Open
      - from: "10:00:00"
        to: "12:00:00"
	    state: Daytime	
      - from: "12:00:00"
        to: "13:00:00"
	    state: Evening	

Agree. It would also be nice to have more granular intervals in the UI and not just 30 mins increments.
E.g. to schedule an alarm clock.
It seems only possible via yaml but not in the UI?

2 Likes

Agree. The state could be the required temperature for a thermostat. An automation could then be triggered by the schedule and turn the heating on and off - and also set the target temperature.

1 Like

One of the features that could be helpfull is to integrate ventilation control that would allow for different fan speeds for each hour and also bypass feature ie. Party Mode to set up higer fan speed for specific time after which ventilation would follow regular program.

Check out my schedule_state component on HACS - GitHub - aneeshd/schedule_state: HA sensor that returns a string based on a defined schedule, enabling further automations

This would be a great addition

Great idea.

I could use this to schedule the preset modes (comfort, away, night, frost) of my climate entities or define different brightness levels throughout the day for my light bulbs.
A multi state option would allow easy modification from the UI without digging into an automation. That would make it a lot easier for other members of my household, who don’t have a firm grasp of how Home Assistant works, to change the schedule of an entity.

Furthermore, I think it would add clarity. As an example, I currently use a weekly schedule to control my climate entities. “On” means preset mode “comfort”, “Off” means preset mode “night”. However, you need to know this in order to make sense of it. That’s no problem for me, but it isn’t necessarily obvious for other household members. With a multi state weekly scheduler, this would be obvious since you could simply have “comfort” and “night” displayed in the schedule.

For completeness, finders of this enhancement request may want to consider the Local Calendar integration to see if it can satisfy their desires.

A multi-valued schedule would be extremely useful for a heating schedule. Of course, having a schedule to define the times for a set of labels and a sidebar to define some numeric value (temperature in my use case) per label would be even better than just a multi-value schedule.

Now I need 5 schedules, 5 numeric inputs and one template helper to return the temperature based on those inputs and schedules. Having at least the labels defined in a multi-value schedule would make changing those schedules a lot easier.

Hi everyone!
I was wondering if it would be possible to add a “data” field in the schedule’s entries, something like the data section of the “service call” action.

It would be very usefull, for example, to set a different temperature for thermostats during the day, instead of being just able to switch them on or off (issue already stated in this post).

I was thinking of something like the data section of the “service call” action, to be able to set multiple variables for my automations.

I think it could be an interesting addition to the schedule component!

This feature would be awesome! It could replace tens of helpers. Scheduling would be much easier.

Agreed, I am trying to setup a heating system schedule similar to my old Hive system and i want to schedule different temperatures for different times of the day. We need an option to have different states from the schedule at different times of day other than just on or off.

Seconding. I found this post while trying to do the exact same thing: schedule my heaters to jump to different temperatures at different times.

I opened a PR that adds this feature: Allow attaching additional data to schedule helper blocks by Klikini · Pull Request #116585 · home-assistant/core · GitHub

Hi - thanks for the contribution!

Will this change also allow for retrieval of the current schedule’s data or just the upcoming schedule?

It will show the current schedule’s data as attributes on the schedule entity.

Here, “Data” is the data for the current schedule block:
327305482-59fb8c09-57e2-4472-9c64-a3bd96f207f7

thanks for your PR! Great addition!
One small addition I’d love to see, is, getting the data for the next event too.
So with a schedule like

Light Schedule
schedule:
  light_schedule:
    name: "Light schedule"
    wednesday:
      - from: "0:00:00"
        to: "12:00:00"
        data:
          brightness: 100
          color_temp: 4000
      - from: "12:00:00"
        to: "24:00:00"
        data:
          brightness: 50
          color_temp: 2000

I’d like to be able to do something like this:
{{ state_attr('schedule.light_schedule', 'brightness') }} => 100
{{ state_attr('schedule.light_schedule', 'next_event') }} => … 12:00:00
{{ state_attr('schedule.light_schedule', 'next_brightness') }} => 50

Example use case: automation that triggers 5 minutes before next_event that will call light.turn_on action with a 5 minute transition time to the new brightness level. For that the value of the next event must be accessible.

(Sorry if I’m missing something and that would be possible already somehow)


PS: how does it deal with name clashes currently? What happens if I name a data object “next_event”?



An idea I just had: alternativly it might be even better if we could get the state (and data) from a schedule for any given input time. So then I would be able to do:

{{
state_attr(
  schedule_at( // get schedule at some given time
    'schedule.light_schedule', // which calendar to get the data from
    state_attr('schedule.light_schedule', 'next_event')), // time of when to get data; here: time of next event
  'brightness')
}}

Proposed PR for frontend.

https://github.com/home-assistant/frontend/pull/22798

A little concerned UX will not go for it (object selector is pretty advanced), but we’ll see.