-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e7d823
commit 5c93bcf
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
I have had a play and found this works. | ||
|
||
1. Create a local calendar, https://www.home-assistant.io/integrations/calendar, I named mine 'local' | ||
2. Add the 'Watering Season' entry with the desired start and end dates, using the calendar link in the sidebar | ||
3. For testing, the calendar does not refresh immediately so set the start at least 15 minutes into the future. | ||
4. Check that the 'enable_program' switch name is consistent with your implementation | ||
``` | ||
alias: Calendar | ||
description: "" | ||
triggers: | ||
- trigger: calendar | ||
entity_id: calendar.local | ||
event: start | ||
offset: "0:0:0" | ||
- trigger: calendar | ||
entity_id: calendar.local | ||
event: end | ||
offset: "0:0:0" | ||
mode: parallel | ||
max: 10 | ||
conditions: | ||
- condition: template | ||
value_template: "{{ 'Watering Season' in trigger.calendar_event.summary }}" | ||
actions: | ||
- if: | ||
- condition: template | ||
value_template: "{{ trigger.event == 'start' }}" | ||
then: | ||
- data: {} | ||
target: | ||
entity_id: switch.enable_program | ||
action: switch.turn_on | ||
- action: notify.persistent_notification | ||
metadata: {} | ||
data: | ||
message: Watering Season started | ||
else: | ||
- data: {} | ||
target: | ||
entity_id: switch.enable_program | ||
action: switch.turn_off | ||
- action: notify.persistent_notification | ||
metadata: {} | ||
data: | ||
message: Watering Season ended | ||
``` |