Be aware that there’s a potential problem with using any condition to check a calendar entity.
If you have an all-day event, its details will appear in the calendar entity and not any of the other events scheduled that day.
If you more than one event scheduled at the same time, only one of them will appear in the calendar entity.
That’s why it’s recommended to use a Calendar Trigger to detect the desired calendar event.
In your case, you can create a Trigger-based Template Binary Sensor with a Calendar Trigger that detects if the cleaning lady is scheduled to arrive today. Then your automation can use a State Condition to check the binary_sensor’s state.EDIT see TheFes’s post below
Thank you very much for your feedback. I must admit that I do not understand much of what you are talking about. I am quite new and still trying to find my way around
Do you eventually have an example for me how to set up a trigger-based template binary sensor?
Note, you need to adjust the entity of the calendar in two places. In the service call to get the events, and in the template of the if action.
BTW, there is no need to censor device_id’s. They are randomly generate unique identifiers for the HA backend, nobody can do anything with them.
But I would advice to use entity_id’s instead of device id’s anyway
thank you I will give this a try. But one question. If I set it up like this, then the vacuum will only run when the calendar entry “Reinigung” exists, right? It’s supposed to be the other way around. If calendar entry “Reinigung” exists for today, then do not start cleaning.
With the code above it should always start on the trigger with id 2 and on the right weekdays, as you also have the vacuum.start service call before the if-then action.
But you should be able to tell where it goes wrong from the automation trace
I tried @TheFes way of using the calendar as a condition to turn some lights on at sunset (only if there are guests). But no matter which calendar I use or which word I am searching for, the visual editor always says that the condition is not met.
Hi @TheFes
I wanted to use this script to solve my problem (see this post) but it still gives me false triggers. I think it can be solved by checking whether the current date-time is within the start and end date of the found event.
Could you help me out here?
Thank you !
That’s exactly what I was looking for.
Is it possible to get info from the event (when count ==1), and use it in the “then” section ?
I want to send a notification with some detail of the event.