Have you tried using the UI to create your automations? It might be easier for you until you get used to how they are structured. Then you can focus on the logic instead of the syntax.
The reason it’s not working is because you have automation: several times in the file.
This is a header, it should only exist once, like here is a list of automations:
Each automation start with - saying this is one automation.
Or you have a header saying action: then below it is a list of actions each starting with -.
So… This is correct syntax, not sure about the entities though.
automation:
- alias: 'Send notification when alarm triggered'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: "triggered"
action:
- service: notify.notify
data:
message: "ALARM! The alarm has been triggered"
- alias: 'Send notification when alarm is Disarmed'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: "disarmed"
action:
- service: notify.notify
data:
message: "ALARM! The alarm is Disarmed at {{ states('sensor.date_time') }}"
- alias: 'Send notification when alarm is Armed in Away mode'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: "armed_away"
action:
- service: notify.notify
data:
message: "ALARM! The alarm is armed in Away mode {{ states('sensor.date_time') }}"
- id: disable_alarm_away
alias: 'Disable Alarm Away'
trigger:
- platform: zone
entity_id:
- mornephone
zone: zone.home
event: enter
condition:
- condition: state
entity_id: alarm_control_panel.ha_alarm
state:
- 'arming'
- 'armed_away'
action:
- service: alarm_control_panel.alarm_disarm
data:
entity_id: alarm_control_panel.ha_alarm
code: MECODE
- service: alarm_control_panel.alarm_disarm
data:
entity_id:
- alarm_control_panel.aarlo_m
I moved the system to Alarmo for easy setup and triggers ect. this works great now I just need to add the geo arming to it. Thanks guys sorry I havent posted in a while the circuit i designed for the alarm control unit died so I went back to the drawing board. its now functioning better than before with more accurate detections too.
So now I am back here about the geo arm and disarm