Need help: MQTT Binary Sensor and ebusd

I am currently fiddling with ebusd. Not the native integration but ebusd via MQTT. I am facing the following situation:

ebusd send the state of the heaters flame with the topic ebusd/bai/Flame. The result is JSON encoded and looks like this in MQTTExplorer:

{
     "0": {"name": "", "value": "off"}
}

I now want to create a binary sensor to read the state of the flame but I cannot get it to work. I have tried the following:

- platform: mqtt
  name: "Gastherme Flamme"
  state_topic: "ebusd/bai/Flame"
  value_template: "{{ value_json['0'].value == 'ok' }}"

and

- platform: mqtt
  name: "Gastherme Flamme"
  state_topic: "ebusd/bai/Flame"
  value_template: "{{ value_json['0']['value'] == 'ok' }}"

But both solutions do not deliver the correct state. Can anyone help me out with the binary sensor?

Hi there, Please try this

- platform: mqtt
  name: "Gastherme Flamme"
  state_topic: "ebusd/bai/Flame"
  payload_on: "on"
  payload_on: "off"
  value_template: "{{ value_json.0.value}}"

Make sure the payload for on and off are correct

Thank you for your reply. I managed to get this to work with:

- platform: mqtt
  name: "Gastherme Flamme"
  state_topic: "ebusd/bai/Flame"
  payload_on: "on"
  payload_off: "off"
  value_template: "{{ value_json['0'].value}}"