My working and tested solution (for alarming purposes)…
# ALARM - vklopi alarm DSC spodaj (RF ključ C)
- id: '30006'
alias: 'ALARM - vklopi alarm DSC spodaj (RF ključ C)'
hide_entity: true
trigger:
- platform: mqtt
topic: "tele/Sonoff-RF-Bridge/RESULT"
- platform: mqtt
topic: "tele/Sonoff-RF-Bridge2/RESULT"
condition:
condition: and
conditions:
- condition: template
value_template: "{{ trigger.payload_json.RfReceived.Data == '!RF-SECRET-RECEIVED-CODE-KEY-C' }}"
- condition: state
entity_id: alarm_control_panel.DSC5020
state: disarmed
action:
service: alarm_control_panel.alarm_arm_away
data:
entity_id: alarm_control_panel.DSC5020
code: !SECRET-DSC-ALARM-CODE
# ALARM - izklopi alarm DSC spodaj (RF ključ D)
- id: '30007'
alias: 'ALARM - izklopi alarm DSC spodaj (RF ključ D)'
hide_entity: true
trigger:
- platform: mqtt
topic: "tele/Sonoff-RF-Bridge/RESULT"
- platform: mqtt
topic: "tele/Sonoff-RF-Bridge2/RESULT"
condition:
condition: or
conditions:
- condition: template
value_template: "{{ trigger.payload_json.RfReceived.Data == '!RF-SECRET-RECEIVED-CODE-KEY-D' }}"
- condition: state
entity_id: alarm_control_panel.DSC5020
state: armed_away
- condition: state
entity_id: alarm_control_panel.DSC5020
state: armed_home
action:
service: alarm_control_panel.alarm_disarm
data:
entity_id: alarm_control_panel.DSC5020
code: !SECRET-DSC-ALARM-CODE