Blink alarm template not working since moving to Hass.io

Hi All

I’ve been using HomeAssistant on a Pi since the early days but am finally migrating across to Hass.io in Docker on a VM. Everything else is working apart from using my Xiaomi buttons to enable/disable my Blink cameras which has worked perfectly previously:

sensor:
- platform: template
  switches:
    alarm:
      friendly_name: 'Blink Alarm Toggle'
      value_template: "{{ is_state('binary_sensor.blink_armed_status', 'on') }}"
      turn_on:
        service: script.turn_on
        entity_id: script.alarm_on_script
      turn_off:
        service: script.turn_on
        entity_id: script.alarm_off_script

The config was taken from this thread Template to toggle Blink alarm and has worked perfectly for two years.

The problem now appears to be that switches: does not appear to be supported by template.

Any suggestions greatly received.

That needs to be under switch: instead of sensor: