📆 Calendar Notifications & Actions

@MarkWeber1979

Your welcome.

I think I am understanding what you are trying to do is be notified when to change the temp. If this is correct what you could do is set a keyword for when you need to change the temp… say your keyword is #settemp, then in every calendar event you would like to be notified to change the temp use this keyword. Then in a calendar event have the summary say ‘Set The Temperature To 17’ and/or ‘Set The Temperature To 19’. In your discription add your keyword #settemp. Then make sure you use {{ trigger.calendar_event.summary }} in your title of the message so it will use your summary you entered into your calendar event and you will know what temp to set :wink:

This way you will have one automation that will handle all your calendar events to set the temp but in the notification it will change and use the summary in your notification. You can also use action buttons so if sending it to multiple people when they change the temp they can notify everyone that it has been done. You can also use the ‘Time Delay Confirmation Message’ to remind you again if no one uses the action button :wink:

Hope this make sense.

I do the same thing for reminding me to take out the rubbish and what bins I need to take out. I do have a FAQ on this that can provide more information on how to do this just rather than bins for you it is set temp and probably don’t use the ‘Offset’.

If you get creative you could probably use the action buttons to change the temp. Use action 1 for 17 deg, action 2 for 19 deg.

Let us know if this works for you.

Blacky :smiley:

1 Like

Hi @Blacky
Thanks for the sharing !
It’s possible to add notification with discord ?

@hopyk8

Have a look at discord on the Home Assistant Official Web Site. I don’t use it.

Blacky :smiley:

Hi,
Thanks for your answer

I have discord in my HA, but with your blueprint i can’t select him, i only have my iPhone in the list

Perhaps because of this :

The notification will be slightly different and because I don’t use it I have no way of testing it.

Blacky :smiley:

Hey @Blacky that’s a great blueprint. Thanks for your hard work.

As I’m struggling a bit, I hope somebody can help me out setting it up.

What I try to achieve is to look in different calendars whether there is an event with “Urlaub” as a trigger word in the event title and set an input_boolean to true if so. These events are all-day events normally. I don’t need any notifications send - just set the boolean value.
I figured that I have to do multiple automations for each calendar, but none of my automations trigger.

Here is one example - they are all the same except of different calendars selected:

alias: Set Urlaub Kalender "Kalender Mirko"
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.kalender
    calendar_trigger: Urlaub
    start_calendar_offset:
      hours: -3
      minutes: 0
      seconds: 0
      days: 0
    include_start_auto_actions:
      - enable_start_action_1
    start_action_1:
      - service: input_boolean.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.urlaubsmodus
    include_end_action_button_confirmation: disable_end_action_button_confirmation
    include_end_auto_actions:
      - enable_end_action_1
    end_action_1:
      - service: input_boolean.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.urlaubsmodus
    start_time_delay:
      hours: 0
      minutes: 0
      seconds: 0
    end_time_delay:
      hours: 0
      minutes: 30
      seconds: 0
    start_notify_device: []
    include_start_notify: disable_start_notify_options

For a different scenario I let me send notifications. Those automations work without any problem, but - besides the setting of that switch I don’t get what’s really different here

alias: "Push: Restmüll (Müll)"
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.mull
    calendar_trigger: Restabfall
    start_calendar_offset:
      hours: -12
      minutes: 0
      seconds: 0
      days: 0
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 895577d03871f3b7505f483f5ae5b18e
      - 39178b47871744fffff2067bf8cbc88a
    start_message: Morgen wird der Restmüll abgeholt

Did some more testing. It seems it has something to do with all-day events. When I change the definition to start an event for example at 00:03 am it will trigger like it should.

What am I missing?

@mirkokas

Your YAML looks all good. This one below.

alias: Set Urlaub Kalender "Kalender Mirko"
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.kalender
    calendar_trigger: Urlaub
    start_calendar_offset:
      hours: -3
      minutes: 0
      seconds: 0
      days: 0
    include_start_auto_actions:
      - enable_start_action_1
    start_action_1:
      - service: input_boolean.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.urlaubsmodus
    include_end_action_button_confirmation: disable_end_action_button_confirmation
    include_end_auto_actions:
      - enable_end_action_1
    end_action_1:
      - service: input_boolean.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.urlaubsmodus
    start_time_delay:
      hours: 0
      minutes: 0
      seconds: 0
    end_time_delay:
      hours: 0
      minutes: 30
      seconds: 0
    start_notify_device: []
    include_start_notify: disable_start_notify_options

You can use all day events with an offset as I use it here every week. I think the challenge that may catch you out is when testing.

  • Your calendar event must be set for at least 15 min before you can test it / trigger the automation. It is just the way HA works. I think it is to make HA preform better.
  • When you set your offsets for testing make sure your have a minus. This is for all the time. You are probably putting -3 hours and in your min your putting 34 or what ever. It must be -34. Don’t ask me how I know this.

I just tested your YAML using auto action 1 as per your YAML. No notification your exact YAML but I changed the calendar, offset & input boolean. It worked… just make sure you have your offsets correct. Here is an example to follow when testing.

  • Set your test calendar event up for all day tomorrow. Wait 15 min.
  • After the 15 min say the time to trigger is 4:41 pm. The start offset will be -7 hours & -19 min. That is 4:41 + 19 = 5 + 7 = 12.
  • Wait for that time 4:41 pm and it should work.

Let us know how you go.

PS: Hope you have a good Vacation.

Blacky :smiley:

First, thx for your reply.

I completely set up the automation again from the start and activated notification to see if it works but still no luck. The automation doesn’t run at all.

Here’s what I did
I added an all-day event for tomorrow a few hours ago and it shows up in HA.

Then set up the automation using your blueprint with the following code. The offset was set so that the automation would run at 12:10 (so offset of -11:-50:00).

alias: TEST Kalender Calendar Notifications & Actions
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.kalender
    calendar_trigger: Urlaub
    start_calendar_offset:
      hours: -11
      minutes: -50
      seconds: 0
      days: 0
    start_notify_device:
      - 895577d03871f3b7505f483f5ae5b18e
    include_start_notify: enable_start_notify_options
    start_time_delay:
      hours: 0
      minutes: 0
      seconds: 0
    include_start_auto_actions:
      - enable_start_action_1
    start_action_1:
      - service: input_boolean.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.urlaub_mirko
    end_action_1:
      - service: input_boolean.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.urlaub_mirko

At 12:10 nothing happened and the automation shows as not running at all.

@mirkokas

Just tested it again using this YAML and it works. I had some of the community have this problem and then they get it working and I never find out what the did. Everything that you are doing is perfect. This must be frustrating. Please be assured it is working here.

Lets check your time in HA. Go into developer tools > templates and paste this code into the editor. You time should be shown. Make sure it is correct.

{{ now().now() }}

Maybe try a reboot if the time is correct.

Blacky :smiley:

@Blacky
Time is correct and sadly also a restart of HA didn’t change anything.

I switched now to a different solution that works while it’s not that nice:

alias: "Urlaub: Mirko"
description: ""
trigger:
  - platform: time_pattern
    hours: /1
condition: []
action:
  - if:
      - condition: template
        value_template: "{{ 'Urlaub' in state_attr('calendar.kalender', 'message') }}"
    then:
      - service: input_boolean.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.urlaub_mirko
    else:
      - service: input_boolean.turn_off
        target:
          entity_id:
            - input_boolean.urlaub_mirko
        data: {}
mode: parallel
max: 10

Not using the calendar trigger for this one.

It’ still unclear to me, why your blueprint won’t work for this scenario, but for a different one with a different calendar where I let me notify when my trash has to be taken out.

No problem, if you need any help just ask.

Blacky :smiley:

1 Like

Hi there !

First i give you my congratulations on your blueprint ! if this works for my case, it makes my life alot easier !

I have a store that is closed on holidays and, on special day, even if it is a holiday i have to be opened.

The blueprint will control several automation for the lights and digital signage, ive set this blueprint for holidays, turns out that it didnt trigger any of the automations am i doing something wrong ? (Set the calendar and “call it” calendar.duty and set the trigger word to @Holiday in the description for all of the holidays in this year manually).

Ill leave here my yaml file.

Thank You !

alias: EXPERIMENTAL - Holiday Mode
description: Holiday Mode
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.duty
    calendar_trigger: "@Holiday"
    start_action_1:
      - service: automation.turn_off
        metadata: {}
        data:
          stop_actions: true
        target:
          entity_id:
            - automation.off_screens_alarm_scale_12h59m_saturdays
            - automation.off_screens_at_13h
            - automation.off_screens_at_19h
            - automation.on_lights_window_shop
            - automation.on_scrrens_at_8_59
            - automation.on_screens_at_13h
    end_action_1:
      - service: automation.turn_on
        metadata: {}
        data: {}
        target:
          entity_id:
            - automation.off_screens_alarm_scale_12h59m_saturdays
            - automation.off_screens_at_13h
            - automation.off_screens_at_19h
            - automation.on_lights_window_shop
            - automation.on_scrrens_at_8_59
            - automation.on_screens_at_13h

@Kry0h

Hi Pedro

Thanks for your YAML.

You will need to enable the start and end auto actions. Also note, your key word is also case sensitive.

Let us know how you go.

Blacky :smiley:

Thank you so much ! Silly me, didnt activate the 2 options :person_facepalming: :sweat_smile: Saturday at afternoon ill report back :ok_hand:

I’m trying to get alerted the night before for an all-day event. Is this correct, because it never triggered? The UI gives an error saying I can’t have a negative number there.

@flyize

Yes that is correct. With -6 it will send you a notification at 6pm the day before. It is strange that the UI gives you an error. I just tested a fresh automation and it worked for an all day event with a minus value. I also have an all day automation running every week for my bins and it always works.

Some things to be aware of.

When testing your calendar event must be saved for at least 15 min before HA will accept it. So if it is an all day event and the time now is 6pm and you just created the calendar event earliest time you can have it work in the automation is 6:15pm.

If you would like me to look at it could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Blacky :smiley:

Thanks! Not much to it. Not sure where I went wrong.

alias: Trash Bin Reminder
description: ""
use_blueprint:
  path: Blackshome/calendar-notifications-and-actions.yaml
  input:
    calendar: calendar.trash_pickup
    include_calendar_trigger: disable_key_word
    start_calendar_offset:
      hours: -6
      minutes: 0
      seconds: 0
      days: 0
    start_notify_device:
      - a5591420ca3af71b85fa2d46f58dc7e5
    start_action_1:
      - service: notify.alexa_media_everywhere
        metadata: {}
        data:
          message: "{{ trigger.calendar_event.description }}"
    include_start_notify: enable_start_notify_options

It has never run, so the calendar trigger isn’t working.

@flyize

Thanks for your YAML.

I just ran a test using your YAML replacing calendar with my one and my device. Work perfectly, got the message to my device. One thing to note and I am not sure if you wanted this part but you have not enabled your ‘Start Auto Action’ for Alexa. See below.

Blacky :smiley:

1 Like