📆 Calendar Notifications & Actions

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

Hi there. I have a problem with the blueprint (or I do use it incorrectly, I do not know.). I want to trigger an event 1 day 11 hours before it starts. So I enter the time as show in the screenshot. First: I get the error as shown, 2nd it does not trigger anything.
Any idea what I make wrong?

@uwefrank

Funny how other browser work, as I don’t see that error. All is good just ignore the error.

The offset works in, Days : Hours : Minutes : Seconds, so you have -1 day and -11 hours. Adjust the -1 day to 0.

Blacky :smiley:

Hay , why don’t I see any device available? ( Start Notify - Devices To Notify ) I would like to add nspanel as a notification device, can you help me with that?
I would like him to inform me about garbage collection.

Hi, I found the answer in a older post here. the error message can be negelcted. It works.The trigger worked now when I used the keyword with an @ in front of it.

@loogin72

Welcome to the community.

You will need to set up your device with the HA App. First you need to set up a user for your nspanel (user name password). The install the HA App on the nspanel and login using your user name and password. Then make sure you allow notifications in the APP. You will then see the device to select. Morer info on the HA App click here

I have done a WTH post that would work really well for your nspanel if HA develops it. You can vote on it click here

Blacky :smiley:

Hi @Blacky, do you believe it would make sense to add the possibility to “group” notifications on the device (android only)? Introduction | Home Assistant Companion Docs

I cannot create MRs on gists, but if you want to take a look at my fork diffs: https://gist.github.com/override80/544916aa45b2d54d5856fab576fd669b/revisions

Thank you for answer ,
but HA can only be installed on nspanel pro and I don’t have pro

I want to do something like that but when selecting a device it doesn’t show me anything, only the phone. It was easier for me to upload the software than to create calendar notifications on nspanel now :slight_smile: