Added instructions to scheduled actions

Edward Firmo
2023-10-31 14:08:47 +01:00
parent a3a5edb7f7
commit 32d5e68e2a

@@ -367,3 +367,67 @@ script:
call.perform();
}
```
 
### Scheduled actions
Although ESPHome doesn't have a Scheduler component, it is possible to use the timer to schedule actions and this is entirely managed in the device, so it will work even if Home Assistant and/or the Wi-Fi are unavailable.
Following some examples:
#### Scheduled relay
```yaml
# Scheduled relay
time:
- id: !extend time_provider
on_time:
- hours: 7
minutes: 30
seconds: 0
then:
- switch.turn_on: relay_1
- hours: 12
minutes: 15
seconds: 0
then:
- switch.turn_off: relay_1
- hours: 19
minutes: 0
seconds: 0
then:
- switch.turn_on: relay_1
- hours: 23
minutes: 30
seconds: 0
then:
- switch.turn_off: relay_1
```
#### Scheduled climate
> This requires add-on climate to be installed
```yaml
# Scheduled climate
time:
- id: !extend time_provider
on_time:
- hours: 7
minutes: 0
seconds: 0
then:
- climate.control:
id: thermostat_embedded
mode: auto
target_temperature: 22°C
- hours: 19
minutes: 0
seconds: 0
then:
- climate.control:
id: thermostat_embedded
mode: auto
target_temperature: 20°C
- hours: 23
minutes: 0
seconds: 0
then:
- climate.control:
id: thermostat_embedded
mode: auto
target_temperature: 18°C
```