Paradox Alarm Interface alerts

Hi All

I need assistance please. Recently got my PAI working for arming and disarming. I am not trying to get notifications sent when the alarm is armed\disarmed. I have tried a few configs from other threads but none work. I tried using the UI only for a simple config not working. I tried the config that is on the official PAI Wiki but this does not eve save.

I would like to this one because it tells me who armed and disarmed. Below is the config I use and the error code I get when a try and save it.

- alias: ArmedBy
  trigger:
    platform: mqtt
    topic: 'paradox/events/raw'
  condition:
    condition: template
    value_template: >
      {{ trigger.payload_json['change']['arm'] == True or
         trigger.payload_json['change']['arm'] == False }}
  action:
    service: notify.pushover
    data:
      message: >
        {% if 'master' in trigger.payload_json['message'] and trigger.payload_json['change']['arm'] == True -%}
            House armed by {{ trigger.payload_json['message'][17:-12] }}
        {%- elif 'master' in trigger.payload_json['message'] and trigger.payload_json['change']['arm'] == False -%}
            House disarmed by {{ trigger.payload_json['message'][19:-12] }}
        {%- elif trigger.payload_json['change']['arm'] == True -%}
            House armed by {{ trigger.payload_json['message'][17:-5] }}
        {%- else -%}
            House disarmed by {{ trigger.payload_json['message'][19:-5] }}
        {%- endif %}'

when I try and save the config I get “Message malformed: expected dictionary”