Automation with template for Verisure not working

Hi I am trying to automate so that my Sonos system turns on when I disarm the alarm, but not when anyone else does.
I can’t get it to work. What have I missed?

     platform: state
     entity_id: alarm_control_panel.alarm_1
     state: disarmed
     condition: template
     value_template: "{{ states.alarm_control_panel.alarm_1.attributes.changed_by = 'Nnnnn Nnnnn' }}"
     service: media_player.turn_on
     entity_id: media_player.kok```

What does that template render in the Dev Tools?

I had the same problem and finally found the solution. While looking for answers I found your post to and figured I should share how I got it working. :slight_smile:

Try this:

value_template: ‘{{ is_state_attr(“alarm_control_panel.alarm_1”, “changed_by”, “Nnnnn Nnnn”) }}’