MQTT binary sensor value

Hi all,
Please, can somebody explain to me what I am doing wrong.
I have device which publish MQTT topic hometab1/dnd with raw values “all” or “none”.
This sensor works:

mqtt:
  binary_sensor:
    - name: "Hometab1 DND state"
      unique_id: "hometab1_dnd_state"
      state_topic: "hometab1/dnd"
      payload_on: "none"
      payload_off: "all"

but this one not:

mqtt:
  binary_sensor:
    - name: "Hometab1 DND state"
      unique_id: "hometab1_dnd_state"
      state_topic: "hometab1/dnd"
      value_template: "{{ value  == 'none' }}"

Based on everything I found, it should work, but… it doesn’t.
Why?
Thanks in advance.

Found solution:

    - name: "Hometab1 DND state"
      unique_id: "hometab1_dnd_state"
      state_topic: "hometab1/dnd"
      value_template: "{% if value  == 'none' %}ON{% else %}OFF{% endif %}"

It looks, for some reason, value_template must be “OFF” or “ON”, not boolean value.

ON and OFF are the default payload values (probably a hangover from the early days when Tasmota ruled).

https://www.home-assistant.io/integrations/binary_sensor.mqtt/

Which is why it worked when you changed them

Your template however resolved to true/false.