📆 Calendar Notifications & Actions

I have a simple solution for you.
In your Google Calendar, create another calendar Abfall (Garbage Pickup in my example)

(*)

and then that calendar will automatically show up in HA (afer 15 minutes or after a reload of the Google Calendar Integration).
When you upload that yearly garbage schedule, do that in the Garbage Pickup calendar as a all-day event, and voila !! Now you can create the desired automation with the Garbage Pickup calendar as trigger, using the appropriate time offset.

(*) In this example Casa Aventura is the Google Calendar used for the HA Integration and the Garbage Pickup calendar is basically a sub-calendar that will show automatically in HA.

hi blacky,

First of all, thank you very much for your blueprints. - they help people like me a lot who aren’t quite good at juggling code yet.

I am currently using the blueprint for my garbage collection. - Now that I’ve finally figured out where to find the action buttons, the whole thing is a bit too fiddly for me. At least it often happens to me that the whole notification is gone. Unfortunately, from this moment on, I’m stuck in an automation process that I can no longer complete in a meaningful way.

alias: Müllerinnerung
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.mullabfuhr
    calendar_trigger: Restmüll
    start_calendar_offset:
      hours: -8
      minutes: 0
      seconds: 0
      days: 0
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - d0a474exxxx709f02091axxxa339bbe0
      - 31a9561xxxx26464a7xxx9a3bf9c6d37
    start_message: Bitte die schwarze Mülltonne an die Straße bringen.
    start_title: "Müllmann sagt:"
    include_start_action_buttons:
      - enable_start_action_button_2
    start_action_button_2: Erledigt!
    start_time_delay:
      hours: 3
      minutes: 0
      seconds: 0
    include_start_action_button_confirmation: enable_start_action_button_confirmation
    start_action_button_confirmation_title: "Müllmann sagt:"
    start_action_button_confirmation_message: Mülltonne steht an der Straße.
    start_time_delay_confirmation_message: Mülltonne muss noch immer an die Straße!
    include_start_auto_actions:
      - enable_start_action_1
    start_action_1:
      - repeat:
          sequence:
            - service: tts.cloud_say
              metadata: {}
              data:
                cache: false
                entity_id: media_player.flur_homepod
                message: Bitte die schwarze Tonne an die Straße stellen!
                language: de-DE
            - delay:
                hours: 0
                minutes: 30
                seconds: 0
                milliseconds: 0
          until:
            - condition: state
              state: "on"
              entity_id: input_boolean.mull_restmull_an_der_strasse
    start_action_2:
      - service: input_boolean.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.mull_restmull_an_der_strasse
    include_end_notify: disable_end_notify_options
    include_end_action_buttons: []
    end_time_delay:
      hours: 0
      minutes: 0
      seconds: 0
    include_end_auto_actions:
      - enable_end_action_1
    end_action_1:
      - service: input_boolean.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.restmull_morgen

So I trigger 8 hours before the calendar event and notify myself and my friends on my cell phone first. If one of the two of us uses the button to indicate that he has taken the bin to the street, everything is done.

If this doesn’t happen, after three hours the HomePod should ask the hallway to take the bin out to the street every 30 minutes. - and that until that happened.

So I can’t choose any auto action because I want to keep annoying myself until the garbage can is actually on the street.
But if I have lost or closed the notification, what is the most user-friendly alternative to the action button? Is it possible to use an input_bool as an alternative? That could be “everything” without me even having to pick up my cell phone when the HomePod and my wife are screaming at me.

In the future, I can also imagine that the “Bin at the street” entity will be switched, for example, by a device tracker attached to the garbage can.

Do you understand what I mean, or am I still so clueless that I just don’t recognize the obvious solutions yet?

Of course, everyone else can help me too - thank you in advance.

Alex

It will send you a reminder once but not every 30 min and currently there are no action buttons for the reminder. So it is best to then call a script in the action.

In your actions you will need to call service / and script turn on. So when it times out after 30 min after doing nothing the action happens and then calls your script annoying you until it is done.

The script / blueprint I recommend for this is below. It is nicely done, easy to follow and the developer @samuelthng supports it to date if you have any questions regarding his blueprint. Link is below.

Hope this helps you.

Blacky :smiley:

2 Likes

what about adding data to notification service? So iOS sticky does not work, but critical: works, could be nice to add these

@Trilis29

Thanks for your suggestions, we will add this to the list.

Blacky :smiley:

Thank you so much for sharing this blueprint, I’m still learning and this is so helpful!

I’m struggling to get one of my notifications to work… I set up a reminder for every birthday. It works great, except when there is more than one birthday on a day… they are separate calendar entries, but I only get one notification. I’m sure it’s user error, just can’t figure out what I’m doing wrong.

@VT_HomeAssistant

Firstly welcome to the community.

Thanks for the heads up. I will need to look into this as I can see what you are saying. I have put this on my list to do.

Blacky :smiley:

Thanks for this blueprint, it helped me a lot!
I want to close the notification when I press an action. Is there a way to add a tag to the notification? So I can send a “clear_notification” as an action on the button?

The cancel button also doesn’t seem to close the notification, but possibly I’m doing something wrong.

I use IOS. so the cancel is there for that.

This is the information in the docs for Android.
When a notification is cleared Android will notify the Companion app of the event. A notification is considered cleared if you either manually swipe it away from the notification status bar or if you click on the Clear All button.

Blacky :smiley:

I saw that also on the documentation, but that didn’t look correct.
On Android it can be cleared with a tag. I made an example that clears the notification after 30 seconds (But in my case I would perform that as an action when the button is pressed).

alias: Notification Test
description: “”
trigger:
condition:
action:

  • service: notify.mobile_app_home_samsung_s21
    metadata: {}
    data:
    title: Test
    message: Test notification
    data:
    tag: testnotificatie
    actions:
    - action: URI
    title: Open Url
    uri: https://google.com
  • delay:
    hours: 0
    minutes: 0
    seconds: 30
    milliseconds: 0
  • service: notify.mobile_app_home_samsung_s21
    metadata: {}
    data:
    message: clear_notification
    data:
    tag: testnotificatie
    mode: single

So for it to work on Android, the cancel-button would have to send the clear_notification - message with the tag (or just be invisible so one of the action buttons can be setup for it).

Thank you for this incredible blueprint!

Is there a way I can configure this to send me a notification for each event on that particular day, at a particular time?
For example, let’s say I have 3 events today and at 10h00 I would receive 3 different notifications, or even a single notification with all relevant information.

Thanks!

Thanks for this information I will look into it.

Blacky :smiley:

Hi Ricardo, welcome to the community.

Yes you can do this. It is really up to you if you would like to use key word or on every calendar event. If you use key word you can have one automation an you may choose your key word to be @notifications and use the same key word in the events you would like to be notified of or you can use multiple automation and or different key words it is totally up to you.

Please note that I do have an item on my list to look at calendar events at the same time only sending the first event. So for now you may have to adjust the time of the events to be slightly different.

Blacky :smiley:

Can you add a trigger key word option is similar to “don’t use key word” but will trigger on ANY word EXCEPT a string I specify? Basically “Always trigger except for “key word” in calendar”.

My use case: Fantastical for Mac leaves events on my calendar that are “cancelled”. They show up as “Cancelled:”. I want your automation to trigger in ALL events EXCEPT for the ones that start with “Cancelled:” in them.

Thank you!

@DuckDuck25

Have you tried using the global conditions. In a template maybe something like this.

{{ is_state_attr('calendar.YOUR_CALENDAR_ENTITY_ID', 'description', 'Cancelled:') }}

Blacky :smiley:

Most excellent, beautiful work, much, much thanks for sharing it :sparkling_heart:

@rudolff

Your welcome, glad you like it and thanks for you kind words. It nice to get these ones every now and then :smiling_face_with_three_hearts:

Blacky :smiley:

It was such a nice surprise to find this blueprint. It is amazing, can’t wait to start using it and recommend it!

Thanks for your feedback, hope you like it.

Blacky :smiley:

Hi,

First thanks for the nice blueprint!!
Is it also possible to use multiple keywords for searching?
It would be nice if you can dynamically set the temperature based on the keyword. For example if the keyword is temp17 set the temperature to 17 degrees and if the keyword is temp19 set the temperature to 19 degrees. In my opinion you now have to make to separate automations or am I wrong?