Maybe you have a better solution. This is how I currently do it: I rent out vacation apartments and have a separate Google Calendar for each apartment. When I have guests in an apartment for a week, for example, it is marked as an all-day event. This means the guest’s name appears on each day they are staying in the apartment.
Now, when the guest checks out and there is no new booking on the following day (the check-out day), I want the heating to switch to an alternative energy-saving profile at around 10 AM—roughly the time the guest leaves.
However, if a new guest is arriving on the same day, meaning the all-day event ends at midnight and a new all-day event begins for the next guest, then the heating should not change and should remain on the standard profile.
I want to avoid a situation where the heating switches to the energy-saving mode at midnight when the all-day event ends. Instead, I want it to change only around the check-out time (10 AM) and only if there is no new all-day event.
I hope you understand what I am trying to achieve. Maybe you have an alternative idea for how I can implement this.
I should also add that I have a second automation that activates 12 hours before the start of an all-day event. This means that the heating switches to the standard profile 12 hours before a booking appears in the calendar.
this is to activate the sdandard profile
alias: Mitte Standardprofil
description: ""
triggers:
- trigger: calendar
entity_id: calendar.bergdohle_mitte
event: start
offset: "-12:0:0"
conditions: []
actions:
- device_id: 775ee32b051c6a9465294013e746b775
domain: climate
entity_id: 7e87995032ae011081e2627dfa4bfdcc
type: set_preset_mode
preset_mode: Default
- device_id: 5151e1a9b90e874235f1783720046f32
domain: climate
entity_id: cb30400cf6d4458fedc388bba4ce392b
type: set_preset_mode
preset_mode: Default
- device_id: e4d7b7997487cac2a9cc97b729996972
domain: climate
entity_id: c364e54e25ccfea5c3f429ecc63449d1
type: set_preset_mode
preset_mode: Default
- device_id: 7ae08e56e1acc7140fc167422c5d67ed
domain: climate
entity_id: 856c1345ce8f23f5a180459a3ef23478
type: set_preset_mode
preset_mode: Default
- device_id: 6e1b036f8a80aa6932dde908c3524a1a
domain: climate
entity_id: e40c22529deb1f2f24f3bbd022e68ba4
type: set_preset_mode
preset_mode: Default
- device_id: 2c02664258f773045d3083ecafcfe228
domain: climate
entity_id: 34f5f3251a03f8557b35cc4a5c20982b
type: set_preset_mode
preset_mode: Default
- device_id: ffe9bf7987e50e1c63fcadcafd5fc4c2
domain: climate
entity_id: 5e1a3ef56666b5e81fd168a105bf01f6
type: set_preset_mode
preset_mode: Default
mode: single
And this to activate the energy saving profile, 10h after the all day event is finisehd and if no new all day event is there
alias: Mitte Alternativprofil 2
description: ""
triggers:
- trigger: state
entity_id:
- calendar.bergdohle_mitte
attribute: all_day
from: true
to: false
conditions: []
actions:
- delay:
hours: 10
minutes: 0
seconds: 0
- device_id: 775ee32b051c6a9465294013e746b775
domain: climate
entity_id: 7e87995032ae011081e2627dfa4bfdcc
type: set_preset_mode
preset_mode: Alternative 2
- device_id: 5151e1a9b90e874235f1783720046f32
domain: climate
entity_id: cb30400cf6d4458fedc388bba4ce392b
type: set_preset_mode
preset_mode: Alternative 2
- device_id: e4d7b7997487cac2a9cc97b729996972
domain: climate
entity_id: c364e54e25ccfea5c3f429ecc63449d1
type: set_preset_mode
preset_mode: Alternative 2
- device_id: 7ae08e56e1acc7140fc167422c5d67ed
domain: climate
entity_id: 856c1345ce8f23f5a180459a3ef23478
type: set_preset_mode
preset_mode: Alternative 2
- device_id: 6e1b036f8a80aa6932dde908c3524a1a
domain: climate
entity_id: e40c22529deb1f2f24f3bbd022e68ba4
type: set_preset_mode
preset_mode: Alternative 2
- device_id: 2c02664258f773045d3083ecafcfe228
domain: climate
entity_id: 34f5f3251a03f8557b35cc4a5c20982b
type: set_preset_mode
preset_mode: Alternative 2
- device_id: ffe9bf7987e50e1c63fcadcafd5fc4c2
domain: climate
entity_id: 5e1a3ef56666b5e81fd168a105bf01f6
type: set_preset_mode
preset_mode: Alternative 2
mode: single
would be great if you or anybody could help me to get this done in the best ever way. thank you