What I’m after is an automation to run at a set time in the morning if there is a specific entry in my Google Calandar for ‘today’.
This is to remind me to take equipment with me on the days that this event happens. The event could be at any time during the day but I need the automation to run at the same time every day, while I’m getting ready to go out.
So, simply:
At 06:30, check if today has an entry containing “clarinet”, if so trigger a notification.
Any inspired ideas as the best way to approach this?
Thanks
I’ve got a calendar item that shows the next ‘clarinet’ event with a start and end date\time.
I have an automation that runs at 06:30, and I’m now struggling for the logic for a condition to check whether the next event in this calendar is ‘today’.
The entity and attribute I’m after are calendar.clarinet and start_time, it’s format is ‘yyyy-mm-dd hh:mm:ss’, but I can’t see how to compare this to ‘today’.
If I understand your problem correctly I accomplish this by using the calendar state as a trigger. When the calendar start time is met the state turns to on. The time is triggered from the calendar event.
trigger:
- platform: state
entity_id: calendar.clocktalk_google_1
to: "on"
I’m just about to embark on creating a similar automation - albeit with an ‘all-day’ event rather than a specific timed calendar entry.
Did your automation prove itself over time? as @Gladz0r also requests, is there any chance we could review your automation? Your leg-work could prove helpful
This creates a sensor called Clarinet that has a start_time and an end_time attribute showing when the next event on that calendar that matches the search term is.
I then create an automation that runs at a specific time in the morning (7:45) that checks if the start_time is today, I know that this particular event will only be during the daytime, so will be in less than 43200 seconds (12 hours) but also after now (I had a few false triggers before adding this).
My action here is to announce at breakfast time to remember to take the clarinet that day.
Hi everyone. I know this topic has already been solved, but as of June 2021 (Probably before this date), this is really easy to set up in the UI so I wanted to share it here in case someone needs help in the future.
In the UI for Automations, I set up a trigger when the state of my calendar is on. Next, under Conditions, select State, then the calendar entity that your event is created under. I just typed in “cal” & all of my options showed up. For the optional Attribute, I selected Message & for State I wrote the name of my event (i.e. School Day).
The Message tells HA that you are searching for an event with the name. The field for the state shows HA what to search for. I shared an example picture below. I hope this helps.
Thanks for the post…
Have you tried a condition set by any other Attribute? I have set my attribute to Description and my state is a single work (or phrase) and HA does not seem to be catching it. Only catching the Message attribute.
Would anyone have ideas?
I have not tried any other attributes other than the message, so I will not be of much use here. I’ll admit that it took me a while of trial & error to figure it out above. It helped me to use the Developer Tools tab & search for the calendar there. It will show you what sorts of attributes HA is reading from the calendar event, & maybe that can help point you in the right direction for what to try.
@atv Hmm, I’m not sure. This is probably where understanding the code would make this easier, but I never did figure out how to make this automation work without the UI. Have you already given this a try? If not, I would try it. My post above was just the first thing I tried that got the automation to run successfully, but it’s not to say that other variations won’t work.
What I know is that when I checked my calendar under the Developed Tools I noticed the message section had the “School Day” message, so I tried what I could to work that in. If I remember correctly, the trigger did not work for me without this condition being set the way it is shown.
I hope this could help some. Maybe someone else has a better answer.
I think i remember it reading somewhere the way you did it as well, i’m sure it’s correct. I have an appointment setup this afternoon so i’ll know soon. Thanks again.