Can someone show me how to write the below conditions section properly. I don’t think I have done it right but don’t really know what is the proper way.
What I am attempting to do is disarm the alarm only when the “trigger.event.data.entity_id” matches one of the 3 below and only when the “trigger.event.data.actioin_text” is “Keypad unlock operation” and the last condition is only do this when the alarm is not already disarmed.
The thing I’m struggling with is are these all supposed to be nested differently? I don’t think what I have done is correct but maybe it is. Hoping someone can teach me a bit.
Thank you all for all of the help you have given me!!
alias: '#Alarm- Disarm with Door Code Entry'
description: ''
trigger:
- platform: event
event_type: zwave_js_notification
condition:
- condition: or
conditions:
- condition: template
value_template: '{{ trigger.event.data.entity_id == ''lock.garage_entry_door_lock'' }}'
- condition: template
value_template: '{{ trigger.event.data.entity_id == ''lock.front_door_lock'' }}'
- condition: template
value_template: '{{ trigger.event.data.entity_id == ''lock.back_door_lock'' }}'
- condition: and
conditions:
- condition: template
value_template: '{{ trigger.event.data.actioin_text == "Keypad unlock operation" }}'
- condition: not
conditions:
- condition: state
entity_id: alarm_control_panel.alarmo
state: Disarmed
action:
- service: alarm_control_panel.alarm_disarm
data:
code: 'XXXX'
target:
entity_id: alarm_control_panel.alarmo
- service: notify.parents
data:
title: HA Alarm Status
message: The alarm has been disarmed by {{trigger.event.data.code_slot_name}}.
mode: single
Ahh, I remember reading that. It just didn’t trigger in my mind as I was attempting to write that one. Thank you for helping me with this @Tinkerer
Most definitely a typo
This is great. I like it. Thank you for showing me ways to make the scripting/ coding more efficient. Where I don’t know alot about the templating yet, I feel like I’m using a sledgehammer to build a piano a good amount of time.
Thank you for your response here and your help with other things here lately.
I would say it very well could be. I think I was so involved in this new “event” concept that I just now starting using/ learning about that I didn’t even think of combining my old knowledge with that. Thank you for opening my eyes/ brain a bit.
Thank you for showing me “!secret alarm_code”, I didn’t think about doing that.