Another thread about how to get multiple doors in one automation

I have spent about two weeks on this and after reading multiple threads and getting it REALLY close, I am afraid I need guidance. I have been using home assistant for about 2 months now and I have made great strides, however this is something that I have not been able to get working all the way. I have used some code from the excellent @petro as well and that has brought me almost to the finish line.

My use case:

I have 5 doors and a carport bay door that I am trying to reduce from 18 automations and 6 scripts down to 2 automations (or less) and 2 scripts (or less).

I have the trigger for when the a door is noted to be open for a given time. In this case I have 10 seconds for testing:

alias: Snapshot and Script for Open Doors
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sensor_backdoor_contact
      - cover.garage_door_controller
      - binary_sensor.sensor_frontdoor_contact
      - binary_sensor.sensor_garagedoor_contact
      - binary_sensor.sensor_sheddoor_contact
      - binary_sensor.sensor_sunroomdoor_contact
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
action:
  - service: script.1713838195721
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: script.1713830770799
    data: {}

and this then calls the 2 scripts. One for the snapshot of the appropriate camera that corresponds to the door that has set the trigger:

alias: snapshot test
sequence:
  - condition: template
    value_template: >
      {% set snapshot_sensors = [
            'binary_sensor.sensor_backdoor_contact',
            'cover.garage_door_controller',
            'binary_sensor.sensor_frontdoor_contact',
            'binary_sensor.sensor_garagedoor_contact',
            'binary_sensor.sensor_sheddoor_contact',
            'binary_sensor.sensor_sunroomdoor_contact'] %}
      # Is the entity_id inside the sensor map that displays the snapshot? # yes
      = move forward, no = stop {{ snapshot_entity_id in snapshot_sensors }}
  - service: camera.snapshot
    data_template:
      entity_id: |
        {% set mapper = {
          'binary_sensor.sensor_backdoor_contact':'camera.back_yard',
          'cover.garage_door_controller':'camera.garage',
          'binary_sensor.sensor_frontdoor_contact':'camera.front_porch',
          'binary_sensor.sensor_garagedoor_contact':'camera.garage',
          'binary_sensor.sensor_sheddoor_contact':'camera.shed',
          'binary_sensor.sensor_sunroomdoor_contact':'camera.back_porch' } %}
        {{ mapper[trigger.entity_id] }}
        filename: |
              {% set mapper = {
                'binary_sensor.sensor_backdoor_contact':'/config/www/images/backdoor.jpg',
                'cover.garage_door_controller':'/config/www/images/garage.jpg',
                'binary_sensor.sensor_frontdoor_contact':'/config/www/images/frontdoor.jpg',
                'binary_sensor.sensor_garagedoor_contact':'/config/www/images/garage.jpg',
                'binary_sensor.sensor_sheddoor_contact':'/config/www/images/shed.jpg',
                'binary_sensor.sensor_sunroomdoor_contact':'/config/www/images/sunroom_door.jpg' } %}
              {{ mapper[trigger.entity_id] }}
      filename: /config/www/images/snapshot_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg

and then followed by the script that sends the actionable notification to my phone:

alias: door_open_reminder
sequence:
  - condition: template
    value_template: >
      {% set snapshot_sensors = [
            'binary_sensor.sensor_backdoor_contact',
            'cover.garage_door_controller',
            'binary_sensor.sensor_frontdoor_contact',
            'binary_sensor.sensor_garagedoor_contact',
            'binary_sensor.sensor_sheddoor_contact',
            'binary_sensor.sensor_sunroomdoor_contact'] %}
      # Is the entity_id inside the sensor map that displays the snapshot?  #
      yes = move forward, no = stop  {{ snapshot_entity_id in snapshot_sensors
      }}
  - service: notify.mobile_app_pixel_6_pro
    data_template:
      message: The {{ trigger.to_state.attributes.friendly_name }} is open.
      title: Door Open
      data:
        image: /local/images/{{ trigger.to_state.entity_id.split(".")[1] }}.jpg
        clickAction: app://com.ubnt.unifi.protect
        ttl: 0
        priority: high
        actions:
          - action: REMIND
            title: Remind Me
          - action: IGNORE
            title: Ignore
            destructive: true
          - action: URI
            title: Open Camera
            uri: >-
              /dashboard-unifiprotect/{{
              trigger.to_state.entity_id.split(".")[1] }}
mode: single
icon: mdi:reminder

then lastly and I havent made it to this part yet, is the actual remind part of the notification… the actual reminder:

alias: Send New Snapshot and Reminder Notification
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.remindme_backdoor
      - input_boolean.remindme_carport
      - input_boolean.remindme_frontdoor
      - input_boolean.remindme_garage
      - input_boolean.remindme_sheddoor
      - input_boolean.remindme_sunroom
    to: "on"
action:
  - service: camera.snapshot
    data_template:
      entity_id: >
        {{ 'camera.back_yard' if trigger.entity_id ==
        'input_boolean.remindme_backdoor' else
           'camera.garage' if trigger.entity_id == 'input_boolean.remindme_carport' else
           'camera.front_porch' if trigger.entity_id == 'input_boolean.remindme_frontdoor' else
           'camera.garage' if trigger.entity_id == 'input_boolean.remindme_garage' else
           'camera.shed' if trigger.entity_id == 'input_boolean.remindme_sheddoor' else
           'camera.back_porch' }}
      filename: /config/www/snapshot_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg
  - service: script.door_open_reminder
    data_template:
      entity_id: "{{ trigger.entity_id }}"

So… thats it, I am not getting any errors per se, but I am also not getting any notifications. I am SUPER sorry to add yet another post about this, but I have really tried and if there is something I have missed, by all means let me know. I really want this one behind me. I have wasted a lot of time on it. lol

EDIT:
It should be noted that no matter what I do, the yaml format is absolutely not honored by home assistant. What you see is how I get it back and if I try to “fix” it, then it errors out.

  • You are not using commenting properly, and it is causing your conditions to misbehave
  • There are two entries for filename.
  • Values need to be passed from the aautomation to the scripts for snapshot_entity_idand anything trigger variable related… the variable trigger and all it’s properties are non-existent in the called script unless you define them and pass them in the service call.

ok, how would I correct that?

Every line for a comment should start with ‘#’

# Is the entity_id inside the sensor map that displays the snapshot?  #
      yes = move forward, no = stop

The yes/no part.

Not inside a template… there you have to use Jinja comment delimiters {# #}.

I am very well aware that each comment should start with a #, however as I have explained, no matter what I do, it moves my yaml formatted text around to suit its needs.

I did remark on this at the end of my original post.

If I am misunderstanding your point, I apologize

I stand corrected.

The variable trigger has value in the automation, you must assign the value of trigger to one or more variables and pass those variables to your scripts if you want access to that data. Usually it is best to split the values out and not try to pass the entire trigger variable… there can be issues passing complex objects.

alias: Snapshot and Script for Open Doors
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sensor_backdoor_contact
      - cover.garage_door_controller
      - binary_sensor.sensor_frontdoor_contact
      - binary_sensor.sensor_garagedoor_contact
      - binary_sensor.sensor_sheddoor_contact
      - binary_sensor.sensor_sunroomdoor_contact
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
action:
  - service: script.1713838195721
    data:
      original_entity_id: "{{ trigger.entity_id }}"
      snapshot_entity_id: #I DON'T KNOW WHERE THIS VALUE IS COMING FROM
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: script.1713830770799
    data: {}

It looks like the variable snapshot_entity_id may have been planned to hold the value from trigger.entity_id, but it is unclear, so I left it in place.

alias: snapshot test
sequence:
  - condition: template
    value_template: >
      {% set snapshot_sensors = [
        'binary_sensor.sensor_backdoor_contact',
        'cover.garage_door_controller',
        'binary_sensor.sensor_frontdoor_contact',
        'binary_sensor.sensor_garagedoor_contact',
        'binary_sensor.sensor_sheddoor_contact',
        'binary_sensor.sensor_sunroomdoor_contact'] %}
      {# Is the entity_id inside the sensor list that displays the snapshot? yes = move forward, no = stop #} 
      {{ snapshot_entity_id in snapshot_sensors }}
  - service: camera.snapshot
    data:
      entity_id: |
        {% set mapper = {
          'binary_sensor.sensor_backdoor_contact':'camera.back_yard',
          'cover.garage_door_controller':'camera.garage',
          'binary_sensor.sensor_frontdoor_contact':'camera.front_porch',
          'binary_sensor.sensor_garagedoor_contact':'camera.garage',
          'binary_sensor.sensor_sheddoor_contact':'camera.shed',
          'binary_sensor.sensor_sunroomdoor_contact':'camera.back_porch' } %}
        {{ mapper[original_entity_id] }}
      filename: |
        {% set mapper = {
          'binary_sensor.sensor_backdoor_contact': 'backdoor.jpg',
          'cover.garage_door_controller': 'garage.jpg',
          'binary_sensor.sensor_frontdoor_contact': 'frontdoor.jpg',
          'binary_sensor.sensor_garagedoor_contact': 'garage.jpg',
          'binary_sensor.sensor_sheddoor_contact': 'shed.jpg',
          'binary_sensor.sensor_sunroomdoor_contact': 'sunroom_door.jpg' } %}
        {% set file_default = 'snapshot_'~now().strftime("%Y%m%d-%H%M%S")~'.jpg'%}
        /config/www/images/{{- mapper[original_entity_id] if original_entity_id in mapper.keys() else file_default }}

The second example script also needs to have values passed to it for:

  • trigger.to_state.attributes.friendly_name
  • trigger.to_state.entity_id.split(".")[1]
  • snapshot_entity_id

Thank you. When I get done with work today I will take a look at this and figure out how I got that variable you questioned.

I think you’ve got some issues with redundant code and also old formatting that isn’t supported any longer. You’ve got multiple file names for camera snapshots (one with date & time, one with camera names) so not sure which one was desired. The scripts didn’t seem to be set up to be generic enough for use elsewhere, so I couldn’t follow why they were broken out separately from the automation.

Here’s my attempt to distill down what I think you’re trying to achieve, as a single automation:

alias: Notification with Snapshots for Open Doors
description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sensor_backdoor_contact
      - binary_sensor.sensor_frontdoor_contact
      - binary_sensor.sensor_garagedoor_contact
      - binary_sensor.sensor_sheddoor_contact
      - binary_sensor.sensor_sunroomdoor_contact
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - cover.garage_door_controller
    to: open
    for:
      hours: 0
      minutes: 0
      seconds: 10
condition: []
action:
  - variables:
      mapping:
        binary_sensor.sensor_backdoor_contact:
          camera: camera.back_yard
          filename: backdoor.jpg
        cover.garage_door_controller:
          camera: camera.garage
          filename: garage.jpg
        binary_sensor.sensor_frontdoor_contact:
          camera: camera.front_porch
          filename: frontdoor.jpg
        binary_sensor.sensor_garagedoor_contact:
          camera: camera.garage
          filename: garage.jpg
        binary_sensor.sensor_sheddoor_contact:
          camera: camera.shed
          filename: shed.jpg
        binary_sensor.sensor_sunroomdoor_contact:
          camera: camera.back_porch
          filename: sunroom_door.jpg
  - condition: template
    value_template: "{{ trigger.to_state.entity_id in mapping.keys() }}"
  - variables:
      camera: "{{ mapping[trigger.to_state.entity_id]['camera'] }}"
      filename_save: /config/www/images/{{ mapping[trigger.to_state.entity_id]['filename'] }}
      filename_retrieve: /local/images/{{ mapping[trigger.to_state.entity_id]['filename'] }}
  - service: camera.snapshot
    target:
      entity_id: "{{ camera }}"
    data:
      filename: "{{ filename_save }}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: notify.mobile_app_pixel_6_pro
    data:
      message: The {{ trigger.to_state.attributes.friendly_name }} is open.
      title: Door Open
      data:
        image: "{{ filename_retrieve }}"
        clickAction: app://com.ubnt.unifi.protect
        ttl: 0
        priority: high
        actions:
          - action: REMIND
            title: Remind Me
          - action: IGNORE
            title: Ignore
            destructive: true
          - action: URI
            title: Open Camera
            uri: >-
              /dashboard-unifiprotect/{{
              trigger.to_state.entity_id.split(".")[1] }}

Wow! That works with no intervention from me at all! Thats pretty amazing! Many many thanks for your help on this.

I do still have the remind and ignore actions I need to get added, but I do believe those would need to be separate automations to manipulate the input_boolean I have for the reminder, correct? And would the reminder then fire off this automation again?

I have this automation for the REMIND_ME action, but I have 6 of them and my hope is to do condense it down to one. I should be able to use your example to do it.

alias: Backdoor Reminder - Door Open
description: “”
trigger:

  • platform: state
    entity_id:
    • input_boolean.remindme_backdoor
      to: “on”
      from: null
      condition:
      action:
  • delay:
    hours: 0
    minutes: 5
    seconds: 0
    milliseconds: 0
  • service: camera.snapshot
    data:
    filename: /config/www/images/backdoor.jpg
    target:
    entity_id: camera.back_yard
  • service: script.back_door_open_reminder
    data: {}
  • service: input_boolean.turn_off
    target:
    entity_id: input_boolean.remindme_backdoor
    data: {}
    mode: single

Ok well I tried to get the 2 automations to work into a kind of “yaml reduction” lol but I have failed. :expressionless:

Here is the yaml for the poor attempt to change the input_boolean to either on or off depending on what is pressed for the actionable notification for whatever door that triggered in the first place. I think I know why it is giving me an error, but I dont know how to set this one up as it is different than the one that you helped with I believe:

alias: Action for Door Open notificaiton response
mode: single
description: >-
  This automation handles what to do when the action is selected in the push
  notification for all door open notifications
trigger:
  - alias: When a 5 minute reminder event is fired for back door
    platform: event
    event_type: mobile_app_notification_action
    id: set-reminder
    event_data:
      action: REMIND
  - alias: When ignore event is fired
    platform: event
    event_type: mobile_app_notification_action
    id: set-ignore
    event_data:
      action: IGNORE
condition: []
action:
  - variables:
      mapping:
        binary_sensor.sensor_backdoor_contact:
          remind: input_boolean.remindme_backdoor
        cover.garage_door_controller:
          remind: input_boolean.remindme_carport
        binary_sensor.sensor_frontdoor_contact:
          remind: input_boolean.remindme_frontdoor
        binary_sensor.sensor_garagedoor_contact:
          remind: input_boolean.remindme_garage
        binary_sensor.sensor_sheddoor_contact:
          remind: input_boolean.remindme_sheddoor
        binary_sensor.sensor_sunroomdoor_contact:
          remind: input_boolean.remindme_sunroom
  - condition: template  
    value_template: "{{ trigger.to_state.entity_id in mapping.keys() }}"
  - variables:
    remind: "{{ mapping[trigger.to_state.entity_id]['remind'] }}"
  - choose:
      - conditions:
          - alias: When triggered by set-reminder
            condition: trigger
            id: set-reminder        
      - sequence:
        service: input_boolean.turn_on
          target:
            entity_id: "{{ remind }}"
      - conditions:
          - alias: When triggered by set-ignore
            condition: trigger
            id: set-ignore
      - sequence:
        service: input_boolean.turn_off
          target:
            entity_id: "{{ remind }}"

and here is the yaml for the reminder automation that I am hoping will work once I get the automation above worked out.

alias: Backdoor Reminder - Door Open
description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - input_boolean.remindme_backdoor
      - input_boolean.remindme_carport
      - input_boolean.remindme_frontdoor
      - input_boolean.remindme_garage
      - input_boolean.remindme_sheddoor
      - input_boolean.remindme_sunroom
    to: "on"
    from: null
condition: []
action:
  - variables:
      mapping:
        binary_sensor.sensor_backdoor_contact:
          camera: camera.back_yard
          filename: backdoor.jpg
          remind: input_boolean.remindme_backdoor
        cover.garage_door_controller:
          camera: camera.garage
          filename: garage.jpg
          remind: input_boolean.remindme_carport
        binary_sensor.sensor_frontdoor_contact:
          camera: camera.front_porch
          filename: frontdoor.jpg
          remind: input_boolean.remindme_frontdoor
        binary_sensor.sensor_garagedoor_contact:
          camera: camera.garage
          filename: garage.jpg
          remind: input_boolean.remindme_garage
        binary_sensor.sensor_sheddoor_contact:
          camera: camera.shed
          filename: shed.jpg
          remind: input_boolean.remindme_sheddoor
        binary_sensor.sensor_sunroomdoor_contact:
          camera: camera.back_porch
          filename: sunroom_door.jpg
          remind: input_boolean.remindme_sunroom
  - condition: template
    value_template: "{{ trigger.to_state.entity_id in mapping.keys() }}"
  - variables:
      camera: "{{ mapping[trigger.to_state.entity_id]['camera'] }}"
      filename_save: /config/www/images/{{ mapping[trigger.to_state.entity_id]['filename'] }}
      filename_retrieve: /local/images/{{ mapping[trigger.to_state.entity_id]['filename'] }}
      remind: "{{ mapping[trigger.to_state.entity_id]['remind'] }}"
  - service: camera.snapshot
    target:
      entity_id: "{{ camera }}"
    data:
      filename: "{{ filename_save }}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: notify.mobile_app_pixel_6_pro
    data:
      message: >-
        This is your reminder that the {{ trigger.to_state.attributes.friendly_name }} is still open.
      title: Reminder
      data:
        image: "{{ filename_retrieve }}"
        clickAction: app://com.ubnt.unifi.protect
        ttl: 0
        priority: high
        actions:
          - action: REMIND
            title: Remind Me
          - action: IGNORE
            title: Ignore
            destructive: true
          - action: URI
            title: Open Camera
            uri: >-
              /dashboard-unifiprotect/{{
              trigger.to_state.entity_id.split(".")[1] }}
  - service: input_boolean.turn_off
    target:
      entity_id: "{{ remind }}"
    data: {}

Im close! I think! :thinking:

I understand what you are saying here, but I am at a loss as to how to go about doing that for when i want to send a reminder that is triggered not by anything but an actionable notification.

You will need to use a Wait for trigger with an Event trigger as shown in the actionable notification example.

What behavior do you want when a notification is issued but no response is sent back?

Do you want notifications for the different doors to all happen independent of each other?

@mekaneck

“What behavior do you want when a notification is issued but no response is sent back?”

I would like it to just wait for an action to be taken and if nothing happens after X minutes, then resend a new notification I guess? There might be a reason like I didnt get the notification, etc. If that is too difficult, then I am certainly open to suggestions.

“Do you want notifications for the different doors to all happen independent of each other?”

That is the goal, yes. The version that you did does just that. However, I am still working on the Remind Me and Ignore actions. I have 6 of each, but that is crazy if there is a way to condense this all down to one or two as I have tried.

Thank you for that. That will point me in a good direction to read up and learn something new.

I would advise against putting mapping variables in different places throughout your various scripts and automations unless they are truly independent of each other. If they are dependent on each other, you want them in one place (ideally in one variable) so that your code is easy to maintain.

I would take my original suggestion and delete everything starting when the camera.snapshot service is called. Instead, you can move that and everything afterwards into a script, and so then in the original automation you can call that new script.

In your new script, you can have the camera snapshot and notification occur, and then also have a wait_for_trigger to capture the mobile phone response. If you need to create a notification again, you can have the script call itself so that the process repeats. As long as the script is set to run in parallel mode, it can handle the notifications and responses for all the different triggers simultaneously.

You’ll have to replace the script entity_id with whatever yours is. It appears at the end of the automation and at the end of the script. I used script.camera_snapshot_and_notification in this code:

alias: Notification with Snapshots for Open Doors
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sensor_backdoor_contact
      - binary_sensor.sensor_frontdoor_contact
      - binary_sensor.sensor_garagedoor_contact
      - binary_sensor.sensor_sheddoor_contact
      - binary_sensor.sensor_sunroomdoor_contact
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - cover.garage_door_controller
    to: open
    for:
      hours: 0
      minutes: 0
      seconds: 10
condition: []
action:
  - variables:
      mapping:
        binary_sensor.sensor_backdoor_contact:
          camera: camera.back_yard
          filename: backdoor.jpg
        cover.garage_door_controller:
          camera: camera.garage
          filename: garage.jpg
        binary_sensor.sensor_frontdoor_contact:
          camera: camera.front_porch
          filename: frontdoor.jpg
        binary_sensor.sensor_garagedoor_contact:
          camera: camera.garage
          filename: garage.jpg
        binary_sensor.sensor_sheddoor_contact:
          camera: camera.shed
          filename: shed.jpg
        binary_sensor.sensor_sunroomdoor_contact:
          camera: camera.back_porch
          filename: sunroom_door.jpg
  - condition: template
    value_template: "{{ trigger.to_state.entity_id in mapping.keys() }}"
  - variables:
      trigger_entity: "{{ trigger.to_state.entity_id }}"
      camera: "{{ mapping[trigger.to_state.entity_id]['camera'] }}"
      filename_save: /config/www/images/{{ mapping[trigger.to_state.entity_id]['filename'] }}
      filename_retrieve: /local/images/{{ mapping[trigger.to_state.entity_id]['filename'] }}
  - service: script.turn_on
      target:
        entity_id: script.camera_snapshot_and_notification
      metadata: {}
      data:
        variables:
          trigger_entity: "{{ trigger_entity }}"
          camera: "{{ camera }}"
          filename_save: "{{ filename_save }}"
          filename_retrieve: "{{ filename_retrieve }}"
mode: parallel
max: 15
alias: Camera snapshot and notification
sequence:
  - service: camera.snapshot
    target:
      entity_id: "{{ camera }}"
    data:
      filename: "{{ filename_save }}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: notify.mobile_app_pixel_6_pro
    data:
      message: The {{ state_attr(trigger_entity, 'friendly_name') }} is open.
      title: Door Open
      data:
        image: "{{ filename_retrieve }}"
        clickAction: app://com.ubnt.unifi.protect
        ttl: 0
        priority: high
        actions:
          - action: REMIND
            title: Remind Me
          - action: IGNORE
            title: Ignore
            destructive: true
          - action: URI
            title: Open Camera
            uri: >-
              /dashboard-unifiprotect/{{
              camera.split(".")[1].replace("_","") }}
  - wait_for_trigger:
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: REMIND
        id: remind
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: IGNORE
        id: ignore
    timeout:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ wait.trigger.id == 'remind' }}"
        sequence:
          - delay:
              hours: 0
              minutes: 5
              seconds: 0
              milliseconds: 0
      - conditions:
          - condition: template
            value_template: "{{ wait.trigger.id == 'ignore' }}"
        sequence:
          - stop: Reminder was ignored
  - condition: template
    value_template: "{{ states(trigger_entity) in ['on','open'] }}"
  - service: script.turn_on
      target:
        entity_id: script.camera_snapshot_and_notification
      metadata: {}
      data:
        variables:
          trigger_entity: "{{ trigger_entity }}"
          camera: "{{ camera }}"
          filename_save: "{{ filename_save }}"
          filename_retrieve: "{{ filename_retrieve }}"
mode: parallel
max: 15

Thank you for the help on this. I will get this sorted this afternoon and let you know how it turns out.

I have had a chance to implement your suggestion and accompanying code and it appears to be working as expected mostly. I am extremely happy for your help as I honestly dont think I would have been able to pull this one off.

I am certain that this will help a lot of people in the future as well. I think it should be made a sticky so its easily accesible to everyone.

There are a couple of things:

I am wondering if the automation is supposed to be using ‘queued’ or parallel’? Currently, its using ‘queued’ and the script is using ‘parallel’ I ask this because I have a lot of automations that are just “running” and dont seem to be stopping.

image

I think this may be related to the other issue which is I am not getting a notification for about half of the doors, but maybe because the automation is still running for one door and those are queued and waiting for it to finish?

The other issue is minor (and I dont care) is when I choose open camera, it goes to the dashboard for all cameras instead of the actual camera. Again, I dont care since its really easy to get to the camera of choice from there and I also have a clickAction taking me directly to the unifi app as well. I almost always use that because when I am away, the cameras integrated in home assistant never actually show a feed even though I am using RTSPtoWebRTC. It just wont start actually showing the feed and only shows an image until I am here on wifi. Odd for sure.

Anyway, thanks again and the only thing that stands out is how to get the automation to complete as there are 5 that are just kind of running… lol