Rest Switch is_on_template

I have a rest switch, but the state reports always false. Here is the config:

switch:
  - platform: rest
    name: wallboard_display
    resource: http://192.168.1.44:2971/api/command
    state_resource: http://192.168.1.44:2971/api/state
    body_on: '{"brightness": 50}'
    body_off: '{"brightness": 0}'
    is_on_template: ‘{{ value_json.brightness > 0 }}’

And this is the actual state response from the device:

{
   "currentUrl":"http:\/\/homeassistant:8123\/lovelace\/wallboard?kiosk",
   "brightness":50
}

However, the switch entity always reports “off” and I am a bit lost how to further debug this.So any hints welcome…

1 Like