šŸ“† Calendar Notifications & Actions

Unfortunately it didnā€™t trigger today with the changes Iā€™ve made. Hereā€™s the config:

alias: An das Rausstellen der MĆ¼lleimer erinnern
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.mullabfuhr
    include_calendar_trigger: disable_key_word
    start_calendar_offset:
      hours: -8
      minutes: 0
      seconds: 0
      days: 0
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 96409aace9c9580fe919a2115c4e590e
      - 683560d2c3ef68bcab17547b24cba8fa
    start_message: MĆ¼lleimer bitte rausstellen!
    start_notify_interruption_level: active
    include_start_action_buttons:
      - enable_start_action_button_1
    start_action_button_1: Erledigt, MĆ¼lleimer steht an der StraƟe.
    start_time_delay:
      hours: 3
      minutes: 0
      seconds: 0
    include_start_action_button_confirmation: enable_start_action_button_confirmation
    start_action_button_confirmation_title: Erledigt, MĆ¼lleimer steht jetzt an der StraƟe.
    start_time_delay_confirmation_message: Denk dran den MĆ¼lleimer raus zu stellen!
    start_action_button_confirmation_message: Erledigt, MĆ¼lleimer steht jetzt an der StraƟe.
    end_calendar_offset:
      hours: -9
      minutes: 0
      seconds: 0
      days: 0
    include_end_notify: enable_end_notify_options
    end_notify_device:
      - 96409aace9c9580fe919a2115c4e590e
    end_title: MĆ¼lleimer rein holen.
    end_message: >-
      Bitte den {{ trigger.calendar_event.description }} Eimer wieder rein
      holen.
    start_action_button_stop: Abbrechen
    start_action_button_stop_confirmation_message: Abbrechen

Iā€™ve had this event in the calendar:
image

expected it to notify me today at 16:00ā€¦ Right?

@MS27HA

Everything looks good, just about identical to mine.

Is your phone iOS or Android. I say this because Android devices sometimes donā€™t get notified and it has to do this how they control things. Creating a channel for Android and making sure the settings will wake the phone can help or check your settings on the phone in channel. iOS works every time.

What you can do is add an all day event in for tomorrow and wait for the 15min is up. You then can keep adjusting your Calendar Start - Offset for testing. Keep changing your Offset so you can test it quick as many times you like to make sure you phone receives the message. Once you know your phone receives the message for that automation you know it works, then adjust your offset back to your -8 setting.

Blacky :smiley:

Thanks for your help! Iā€™m using an iPhone.
I donā€™t think itā€™s the phone. The automation doesnā€™t trigger at all.
Iā€™ll rebuild the automation and keep testing :ok_hand:t2:

@MS27HA

No problem.

I just ran a test using your YAML to be 100% sure you got it all correct and it worked perfectly. The only changes I made were the calendar, offsets and the device to be notified. I got the start and end notifications. Remember when testing you will have to do -1 day with your - hours / minutes for the end action as that time is the end of the day and not the start of the day. Just checking your all day event is entered in for tomorrow not today, so if toady is the 30th then your calendar event should be for 31st.

Rest assured that your code is good.

Have you got a notification from HA before? if not on your iPhone go into settings > Home Assistan > notifications and check you have it turned ON.

Blacky :smiley:

Happy New Year! Hello I was wondering how do I setup a text function instead of regular notifications through the HA app? My wife will be more inclined to read a text than see a notification. Thanks!

I would really like HA to develop their own messaging service. I think it would add heaps of value to HA. Vote here

For sending a text through HA, I have never done that.

Blacky :smiley:

I would like to play a notification text on my Alexa device. Is that possible with this blueprint?

Any chance of additional triggers? Iā€™d like to trigger when there is an event in my calendar that has an additional person invited that has accepted.

I have it running against CalDAV :slight_smile:

Great to hear. Did you have to do smth special?
Iā€™m not getting it to trigger on the start time, just on the end timeā€¦

@Quax1507

Try using the start or end actions

Blacky :smiley:

@benflux

Maybe you can use a keyword.

Blacky :smiley:

Hi.
I am slightly puzzled with my problem :slight_smile:
I created CalDAV calendar and linked it with blueprint.

Automation as follows:

alias: Tesla ogrzewanie
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.tesla
    calendar_trigger: "#Ogrzewanie"
    start_calendar_offset:
      hours: 0
      minutes: -30
      seconds: 0
      days: 0
    start_notify_device:
      - 1193693ddd1d4451aa997d4e3e300d57
      - 4faae792f0475757ca69d6afec4c7c5c
      - 9a63da0a2b57d0e5b6901eb03da672c6
    start_title: >-
      Ogrzewanie Tesi - {{ (trigger.calendar_event.start |
      as_datetime).strftime('%H:%M') }}
    start_message: Naciśnij i przytrzymaj TYLKO jeśli chcesz anulować.
    start_notify_interruption_level: critical
    include_start_action_buttons:
      - enable_start_action_button_2
    start_action_button_stop: Anuluj ogrzewanie
    start_time_delay:
      hours: 0
      minutes: 1
      seconds: 0
    include_start_auto_actions:
      - enable_start_action_1
    start_action_1:
      - action: notify.domoticz
        metadata: {}
        data:
          data:
            disable_notification: true
          message: Grzejemy...................
        enabled: true
      - action: notify.domoticz
        metadata: {}
        data:
          data:
            disable_notification: true
          message: >-
            Event {{ trigger.calendar_event.summary }} @ {{
            (trigger.calendar_event.start | as_datetime).strftime('%H:%M') }} @
            {{ (trigger.calendar_event.start | as_datetime).strftime('%H') }} @
            {{ (trigger.calendar_event.start | as_datetime).strftime('%M') }} @
            {{ trigger.calendar_event.description }}
        enabled: true
      - action: input_number.set_value
        target:
          entity_id: input_number.tesla_heater_time
        data:
          value: >
            {% set remaining_time = ((trigger.calendar_event.start |
            as_datetime).strftime('%H:%M')).split(':') %} {{remaining_time[0] |
            int * 60 + remaining_time[1] | int }}
        enabled: true
      - action: input_text.set_value
        target:
          entity_id: input_text.tesla_heater_day_of_week
        data:
          value: >
            {{as_timestamp(trigger.calendar_event.start) |
            timestamp_custom('%A',false) }}
        enabled: true
      - action: notify.domoticz
        metadata: {}
        data:
          data:
            disable_notification: true
          message: >
            tesla-heater-time:
            {{states('input_number.tesla_heater_time')|string}}

            tesla-heater-day-of-week:
            {{states('input_text.tesla_heater_day_of_week')}}
        enabled: true
      - action: rest_command.tesla_heater_on
        metadata: {}
        data: {}
        enabled: true
    include_start_notify: enable_start_notify_options
    include_start_action_button_confirmation: disable_start_action_button_confirmation
    include_end_auto_actions:
      - enable_end_action_1
    end_action_1:
      - action: rest_command.tesla_heater_delete_entry
        metadata: {}
        data: {}
    end_action_2: []
    end_time_delay:
      hours: 0
      minutes: 0
      seconds: 0
    start_action_button_2: Jednak grzejemy
    start_action_2:
      - action: notify.domoticz
        metadata: {}
        data:
          message: start akcji 2
    global_conditions:
      - condition: numeric_state
        entity_id: sensor.oczyszczalnia_zewn_trzna_temperatura
        below: 5


The entries are punched in calendar way ahead of the scheduled start.

image

The automation started at 7:30 with (#Odpady plastiki) and stopped while it has no found expected keyword in calendar entry (that is clear) BUT it did not start with next schedule (#Ogrzewanie) at 7:40 - WHY ?

Could be the reason that entry (#Odpady plastiki) is from 8:00 till 9:00 (1 hour long) and is overlapping the next entry (#ogrzewanie) which is only 5 minutes long ?

Best Regards

Hello.
First of all thank You for that blueprint, hopefully it will become handy for me as I am still trying to set it up.

Major question from my side is if manual trigger in 3 dot menu right beside automation should really start it or not? For me it is not working so I am unable to test it at this point.

What I did so far:
As I only have 2 events in calendar I didnā€™t use any keywords, I picked them directly in trigger menu (so I have 2 separate automations, one for each event).
Then I:

  • unchecked ā€œuse calendar keywordā€
  • set ā€œcalendar start offsetā€ to -8h as I want to get notification on 4PM day before and calendar event are set for whole day
  • moved to ā€œstart actionsā€ part and checked ā€œEnable start auto action 1ā€
  • in Start Action - Action 1 I added telegram bot notify action which I already use for few other things and put ā€œBins tomorrowā€ as a message

Will this work? As I mentioned earlier clicking Run Actions doesnā€™t do anything for me, I still have ā€œNeverā€ in ā€œLast triggeredā€ column.

@ilexpl01

No

In your trigger you have a start offset of -30 min. So it should of sent the notification at 07:40.

I havenā€™t looked at your actions. If you are having problems, I would add one easy action (basic notify) to seeā€¦ but it should work anyway.

Also note you global condition :thinking: Your sensor.oczyszczalnia_zewn_trzna_temperatura must be below 5 for it to run. You could try disabling this for testing.

Hope this helps you find it.

Blacky :smiley:

@Gutek

You must let it run live, you canā€™t click the run action.

For testing you can change your offset to suit the time you are curently in. You can keep editing the offset and it will work instantly but if you edit the calendar event you have to wait 15min for HA to see it.

Note: if you have 2 automations and your not using a keyword then both will run. The keyword is the link to an automation and without it, it will fire on every calendar event.

Blacky :smiley:

1 Like

The thing is, that automation did not start at 7:40. There was no trace of it. It is not an issue of sensor.oczyszczalnia_zewn_trzna_temperatura entity. :confused:

@ilexpl01

I tested everything and it worked perfectly using your YAML. All I changed is the device to notify and the entity in the condition.

With all your actions I get an error obviously but I get the first message came through.
Removing your actions and I added my own actions to just notify myself I have no problem.

Note that when you push your action button 2 you will get action 1 & 2 and I am not sure if this is what your after.

Blacky :smiley:

Note that when you push your action button 2 you will get action 1 & 2 and I am not sure if this is what your after.

It is on purpose.

Had an issue when push action 1 was used then action 1 was executed twice - do not know why :confused:

1 Like

Works like a charm, Thank You again.!

1 Like