Mqtt value_template matching device_class

I’ve been running PIR sensors from the previous “platform MQTT” section for a long time.
This is successfully migrated to the new MQTT config section, adding a “sensor”
Next step: I’d like the sensor to match a correct device_class.

The MQTT value is:

{
  "status": "No Motion",
  "battery": "9",
  "rssi": "5"
}

For example.
In the MQTT config section I have a working RSSI value returned:

sensor:
  - name: "RSSI_PIR_Bijkeuken"
    state_topic: "homeassistant/visonic/E3ACAB"
    value_template: '{{ value_json.rssi }}'

Now I’ve also added a “binary_sensor” in the mqtt config, which doesn’t work:

binary_sensor:
  - name: "PIR_Living"
    state_topic: "homeassistant/visonic/E3ARE2"
    device_class: Motion
    value_template: "{% if value_json.status == 'No Motion' %} false {% elif value_json.status == 'Motion' %} true {% endif %}"

The binary sensor does show up as entity, with the status ‘unknown’.

I’ve been going around in circles and grew a few gray in the process.
What am I missing?

When this step works, I want to add multiple json attributes to 1 device.
Not sure yet how to proceed, but I found a direction with: json_attributes_topic
If you have any direction on this path, I’m all ears.

Have you tried changing the template to use ‘on’ & ‘off’ instead of ‘true’ & ‘false’ ?

Yes, I’ve tried these all. thx.

I have a alternative working situation, although that still leaves the question open how it works straight from the value_template.

 value_template: '{{ value_json.status }}'
    payload_on: "Motion"
    payload_off: "No Motion"