nielsfaber / alarmo

Easy to use alarm system integration for Home Assistant
1.4k stars 119 forks source link

Alarm Entity on event alarmo_failed_to_arm #1056

Open Belox86 opened 3 weeks ago

Belox86 commented 3 weeks ago

Checklist

Proposal

I want to create an HA automation base on event alarmo_failed_to_arm as suggested by documentation. unfortunately, i have 3 different alarmo entities and i'm not able to understand which entity triggered the event; what i would like to do is an automation that takes different actions according to which entity failed to arm.

Additional info

this is the current event structure that i see from event listener of HA, and in which i cannot find any reference to the entity which triggered it:

event_type: alarmo_failed_to_arm
data:
  command: arm_home
  context_id: null
  area_id: "1729684807"
  reason: open_sensors
  sensors:
    - binary_sensor.papa_porta_ingresso_contact
origin: LOCAL
time_fired: "2024-10-31T16:30:33.499870+00:00"
context:
  id: 01JBHPM5GVBK1GQWK76YWG26CG
  parent_id: null
  user_id: null
jamesg226 commented 1 week ago

Try {{open_sensors}} in the reason line

Belox86 commented 1 week ago

Try {{open_sensors}} in the reason line

Not sure on how to do it and if it make sense. "open_sensors" is actually the value of the field "reason" so i do not think it's expandable. I tried this automation:

alias: Fail to Arm
description: ""
triggers:
  - trigger: event
    event_type: alarmo_failed_to_arm
    event_data: {}
conditions: []
actions:
  - action: input_text.set_value
    metadata: {}
    data:
      value: "{{trigger.event.data.reason}}"
    target:
      entity_id: input_text.alarmo
mode: single

what i get in the helper input_text.alarmo is indeed open_sensors