Schedule
The Schedule integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides a way to create a weekly schedule entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] in Home Assistant, consisting of time blocks with defined start and end times. The schedule is active when a time block starts and becomes inactive when it ends, allowing it to be used for triggering or making decisions in automations and scripts.
Configuration
To add the Schedule helper to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
At the top of the screen, select the tab: Helpers.
-
In the bottom right corner, select the
Create helper button. -
From the list, select Schedule.
-
Follow the instructions on screen to complete the setup.
After creating schedule blocks, you can press a block to edit the details.
Adding additional data
Adding the following as Additional data
will show brightness
and color_temp
as entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] attributes when the block is active:
brightness: 100
color_temp: 4000
YAML configuration
Alternatively, this integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] can be configured and set up manually via YAML instead.
To enable the Integration sensor in your installation, add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file.
The data
field follows the same logic as described above in Adding additional data.
schedule:
light_schedule:
name: "Light schedule"
wednesday:
- from: "17:00:00"
to: "21:00:00"
data:
brightness: 100
color_temp: 4000
thursday:
- from: "17:00:00"
to: "23:00:00"
data:
brightness: 90
color_temp: 3500
friday:
- from: "07:00:00"
to: "10:00:00"
data:
brightness: 80
color_temp: 3000
- from: "16:00:00"
to: "23:00:00"
data:
brightness: 60
color_temp: 2500
Configuration Variables
Alias for the schedule. Multiple entries are allowed.
Icon to display in the frontend for this schedule.
A schedule for each day of the week.
Attributes
A schedule entity exports state attributes that can be useful in automations and templates.
Attribute | Description |
---|---|
next_event |
A datetime object containing the next time the schedule is going to change state. |
key_1 , key_2 , … |
The mapping values from Additional data / data settings of a time block when the respective block is active. |
Automation example
A schedule creates an on/off (schedule) sensor within the times set.
By incorporating the light_schedule
example from above in an automation, we can turn on a light when the schedule is active.
triggers:
- trigger: state
entity_id:
- schedule.light_schedule
to: "on"
actions:
- action: light.turn_on
target:
entity_id: light.kitchen
data:
brightness_pct: "{{ state_attr('schedule.light_schedule', 'brightness') }}"
kelvin: "{{ state_attr('schedule.light_schedule', 'color_temp') }}"
Another automation can be added to turn the lights off once the schedule is inactive:
triggers:
- trigger: state
entity_id:
- schedule.light_schedule
to: "off"
actions:
- action: light.turn_off
target:
entity_id: light.kitchen
Actions
Available action: schedule.reload
.
schedule.reload
schedule.reload
action allows one to reload the schedule’s configuration without restarting Home Assistant itself.