RESTful Binary Sensor not working after migrating from Hassbian to HassIO

After end of support for Hassbian was announced, I started the process of migrating to HassIO.
So far, after lots of tweaks, almost everything is working fine.

This rest binary sensor to check for movement at camera will not work anymore.
Works fine if I execute from SSH command line. ANY HELP IS APPRECIATED!!

#------------------------------------------------------------------------------------------------------------------------------------
# Sensor to determine if there is motion at the FOSCAM Cameras
#------------------------------------------------------------------------------------------------------------------------------------
  - platform: rest
    name: "Gate Motion"
    resource: !secrets gate_motion_resource
    device_class: motion
    scan_interval: 5
    value_template: >-
      {%- if "<motionDetectAlarm>2</motionDetectAlarm>" in value -%}
        {{ true }}
      {%- else -%}
        {{ false }}
      {%- endif -%}