This Home Assistant custom component allows you to schedule actions on an adhoc basis, either to run after a specified delay or at a specific time. As an added benefit, this integration also provides additional logbook entries, so you can easily track when a service was triggered by it. Another key feature is that schedules are saved to a file, ensuring they survive reboots and continue as planned.
This integration will set up the following platforms.
Platform | Description |
---|---|
sensor |
Show current number of pending actions |
- Open HACS and navigate to the "Integrations" tab.
- Click on the three dots in the top right corner and select "Custom Repositories."
- Add the URL for this repository, select "Integration" as the category, and click on "Add."
- Navigate back to the "Integrations" tab. The Adhoc Scheduler should now be available for installation.
- Restart Home Assistant
- In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Adhoc Scheduler"
This custom component provides a new service adhoc_scheduler.schedule
which you can call with various parameters to schedule an action.
name
(optional): A string that identifies your scheduled action.action
(required): The action to be executed. It follows the same schema as the action part of an automation in Home Assistant.delay
: A delay after which the action will be executed. This should be a positive time period.trigger_time
: The exact time when the action will be triggered.delay_from
(optional): The datetime from which the delay will be calculated.
Note: You must provide at either delay
or trigger_time
, but not both
Example, toggle an input boolean in 5 minutes from now
service: adhoc_scheduler.schedule
data:
delay:
minutes: 1
action:
service: input_boolean.toggle
target:
entity_id: input_boolean.test_toggle
Example: toggle an input boolean at 10:00:00
service: adhoc_scheduler.schedule
data:
action:
service: input_boolean.toggle
target:
entity_id: input_boolean.test_toggle
trigger_time: "2023-06-04 10:00:00"
name: "Toggle the Input Boolean"
This custom component provides additional logbook entries each time a scheduled service is triggered. This allows you to track when a particular action was executed and helps in debugging and monitoring your scheduled actions.
If you want to contribute to this please read the Contribution guidelines