New to HA need help with automations

So I am new to HA, been using Hubitat for a long time and used webcore for my rules. I want to slowly work on moving over to HA, but struggling with rules.

Lets start with something easy.
I have a group of doors (5), Lets call it “Exterior Doors” that I want to put into a global variable (I do this with webcore currently)

then I want to take that “Exterior Doors” group and have a rule that says if any door in the “Exterior Doors” group changes to open, then speak what door triggered it and then opened.

so it would end up like “Front Door Opened” But I have no idea how to set that is or where to do glabal variables and such.

So here is an example of what I have. But it keeps saying triggered, like every second. everything seems to be triggering it:

ChatGPT Helped Provide This:

Don’t listen to the bullshit engines.

That trigger fires on every state and attributes change of every entity in your system. Even with a small number of entities it is practically useless, because it fires so often it will overwhelm the queue.

yes I noticed, but cant figure it out. otherwise

Just use a State trigger that lists the door sensors.

alias: Door Opened
description: ""
mode: queued
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.front_door
      - binary_sensor.back_door
      - binary_sensor.side_door
    from:
      - "off"
    to:
      - "on"
conditions: []
actions:
  - action: tts.speak
    data:
      media_player_entity_id: media_player.albert_s_office
      message: "{{ trigger.to_state.attributes.friendly_name }} Opened"
    target:
      entity_id: tts.piper

I know I can do it off "Device, trigger, contact, but how can I do it for a helper where I list the ones I want. I have 100’s of rule I need to move over and if I need to make a change, updating a global is way easier than editing 100’s of rules. Like if a device dies and needs to be replaced. I don’t want to edit every rule.

I have tried this but that does not work at all.

What I have told you above is the current best option.

Triggers are currently being overhauled, but what you are asking for is not available yet.

Also, please follow the community guidelines and do not post config as screenshots, copy and paste it using the “preformatted text” option.

aw ok. I guess I continue to wait. THey really need this feature, I use it in most of my rules

That will fire on any state or attribute change of that binary sensor, but the template is non-sense for that trigger.

You could use that, and then use templating to get the most recently changed entity, but it will leave a lot of edge cases where you won’t get a message.

here is my webcore piston that i wanted to replicate:

I have also tried node red, but cant seem to get very far. seems like programming HA is way harder and not as straight forward. I want to switch as Habitat seems to be slowly going away.

How to help us help you - or How to ask a good question

In your 5 door example you could have potential triggers.

In the trigger section, give each trigger a trigger id.

In the action section, use choose and you could then act on that trigger, having your “voice” say, “Door N opened”

alias: A_Door_Opened
description: ""
mode: single
triggers:
  - trigger: state
    entity_id:
      - script.test_uls_deskights
    from:
      - "off"
    to:
      - "on"
    for:
      hours: 0
      minutes: 0
      seconds: 5
    id: door1
  - trigger: state
    entity_id:
      - binary_sensor.33sumpempty
    from:
      - "off"
    to:
      - "on"
    for:
      hours: 0
      minutes: 0
      seconds: 5
    id: Door2
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - door1
        sequence:
          - action: light.turn_on
            metadata: {}
            target:
              entity_id: light.dininglight
            data: {}
      - conditions:
          - condition: trigger
            id:
              - Door2
        sequence:
          - action: light.turn_on
            metadata: {}
            target:
              entity_id: light.tasmota_sonoff_d1_dimmer01
            data: {}

Welcome to Home Assistant. It is a steep learning curve, especially if you’re not coming from a python background.

You can create a group of your door sensors. that’s kind of similar to a global variable but not really. then you can trigger off the state change of that group since the group will be on/off depending on the state of each door sensor in the group. If one binary sensor in the group is on (door open) then the group will be on.

then to read out which door or doors are open you can read template out each member of the group to tell you which entities are on.

I use this exact setup (except I don’t use the group as a trigger) in my alarm setting automation.

here is basically my setup:

group:
  access_sensors:
    name: Access Sensors
    icon: mdi:walk
    entities:
      - binary_sensor.computer_room_window_sensor
      - binary_sensor.foyer_door_sensor
      - binary_sensor.garage_man_door_sensor
      - binary_sensor.kitchen_door_sensor
      - binary_sensor.main_bath_window_sensor
      - binary_sensor.sunroom_door_sensor
      - binary_sensor.sunroom_east_pe_beam

automation:
  triggers: lots of stuff
  actions:
    - other stuff
    # the one you care about...
    - service: notify.alexa_media
      data:
        target: 
          - media_player.kitchen_dot
        data:
          type: announce 
          message: >
            {% set open =  expand('group.access_sensors') | selectattr('state', 'eq', 'on') | map(attribute='attributes.friendly_name') | join(',') %}
            {% if expand('group.access_sensors') | selectattr('state', 'eq', 'on') | list | count > 1 %}
              "You tried to activate the alarm system but some doors or windows aren't closed yet. The  {{ open |replace(',' , " and ") }} are open.
            {% else %} 
              "You tried to activate the alarm system but some doors or windows aren't closed yet. The {{ open }} is open.
            {% endif %}

What outward signs suggest the Hubitat product is “going away”?