The Daily Schedule integration provides a binary sensor that gets its on / off state according to the user-defined schedule of time ranges.
There is a corresponding Lovelace card which should be used for configuration. To open the card installation page inside HACS click here.
Automation rules can be built with the daily schedule entities as demonstrated here.
Note: The built-in Schedule integration can be used when a weekly schedule is needed.
HACS is the preferred and easier way to install the component. When HACS is installed, the integration can be installed using this My button:
Otherwise, download daily_schedule.zip from the latest release, extract and copy the content into custom_components/daily_schedule directory.
📌 Home Assistant core restart is required once the integration files are copied (either by HACS or manually).
Use this link:
Or, in the Home Assistant UI go through the following path:
=> Click "+ Create helper" button and search for "Daily Schedule".
Each range has from and to. If the to is less than or equal from it's treated as time in the following day. One interesting case is when from equals to. This type of range covers the whole day (always on).
There are 3 ways to specify time:
- An absolute time (e.g. 12:30).
- Sunset with an optional negative or positive minutes offset.
- Sunrise with an optional negative or positive minutes offset.
The binary sensor has the following attributes:
Schedule: the list ofontime ranges as provided by the user.Effective schedule: the actualontime ranges: (1) disabled ranges are ignored, (2) dynamic times (sunrise / sunset) are resolved to absolute time (changing daily), (3) the user-provided ranges are merged and duplications are removed, i.e. the list doesn't have overlapping or adjusting ranges.Next toggle: the next time when the binary sensor is going to change its state.Next toggles: a list with the 4 next times when the binary sensor is going to change its state. The 1st element is identical toNext toggle.
daily_schedule.set action can be used to configure the time ranges. Here is an example:
action: daily_schedule.set
data:
schedule:
- from: "↓-30"
to: "22:00"
target:
entity_id: binary_sensor.backyard_lights
The format of from and to can be one of the 3 options:
- Absolute time: a 24h time in this format.
- Sunset: start with "↓" and can have an optional positive or negative offset in minutes. For example: "↓", "↓-20", "↓+30".
- Sunrise: start with "↑" and can have an optional positive or negative offset in minutes.
Notes:
- It's uncommon to perform this action directly. Its main usage is indirectly via the Lovelace card.
- There is no corresponding
get. The data already exists as attributes:
{{ state_attr('binary_sensor.backyard_lights', 'schedule') }}
{{ state_attr('binary_sensor.backyard_lights', 'effective_schedule') }}
Timer Bar Card supports this integration. end_time must be configured as follow:
end_time:
attribute: next_toggle
By default it countdowns the time till the end of the current time range. active_state can be used for counting down the time to the beginning of the next range (instead):
active_state: 'off'
When UTC option is set (not the default), the time should be expressed in UTC instead of local time. This option can be used when absolute time is needed, which is not impacted by daylight saving changes throughout the year. This is an advanced option that should not be used in the majority of the use cases. It should be used only if there is a very concrete reason to do so. This option should not be used when sunrise or sunset are used since they are resolved by using the local time zone.
When enabled (disabled by default), this option ignores any time range with sunrise or sunset where the to time is earlier than or equal to the from time. This behavior is dynamic. For example, a range defined as sunrise → 7:00 AM may become reversed during parts of the year if sunrise occurs after 7:00 AM. In such cases, the range is applied only when sunrise is earlier than 7:00 AM, and automatically skipped when sunrise is at 7:00 AM or later.
A time range with absolute from and to times is never skipped, even if it's reversed and this option is enabled. Such a time range should be deleted or disabled manually if it's not needed.
-
Delete the configuration:
- Open the integration page (my-link). Delete all helper entities by clicking the 3‑dot menu (⋮), and selecting Delete.
-
Remove the integration files:
- If the integration was installed via HACS, follow the official HACS removal instructions.
- Otherwise, manually delete the integration’s folder
custom_components/daily_schedule.
📌 A Home Assistant core restart is required to fully apply the removal.
If you want to contribute to this please read the Contribution guidelines