Siren from Alarm Panel

New to HA, have all my sensors connected (windows, doors, siren). Was able to get the alarm panel working but cannot get my siren to turn on when it’s triggered from the alarm panel.

- alias: 'Activate siren when alarm triggered'
  trigger:
      - platform: state
        entity_id: alarm_control_panel.home_alarm
        to: 'triggered'
  action:
      - service: switch.turn_on
        entity_id: switch.alarm_siren
        
- alias: 'Deactivate siren when alarm turned off'
  trigger:
      - platform: state
        entity_id: alarm_control_panel.home_alarm
        to: 'disarmed'
  action:
      - service: switch.turn_off
        entity_id: switch.alarm_siren

Also receiving a error in the log, not sure if it’s related:

Logger: homeassistant.config
Source: config.py:454
First occurred: 4:22:39 PM (1 occurrences)
Last logged: 4:22:39 PM

Invalid config for [automation]: expected dictionary. Got OrderedDict([(‘default_config’, {}), (‘tts’, [OrderedDict([(‘platform’, ‘google_translate’)])]), (‘automation’, {}), (‘automation split’, [[OrderedDict([(‘alias’, ‘Activate siren when alarm triggered’), (‘trigger’, [OrderedDict([(‘platform’, ‘state’), (‘entity_id’, ‘alarm_control_panel.home_alarm’), (‘to’, ‘triggered’)])]), (‘action’, [OrderedDict([(‘service’, ‘switch.turn_on’), (‘entity_id’, ‘switch.alarm_siren’)])])]), OrderedDict([(‘alias’, ‘Deactivate siren when alarm turned off’), ('trig… (See ?, line ?).

Thanks for the help.

Hello, I have the same problem it seems to me that trigger an alarm from HA its like pressing the panic buton, so the alarm is triggered but the siren is not activated. Did you find a solution?