Tasmota RF-Bridge with 2 extern switches problem with binary sensor

I have a RF-Bridge flashed with tasmota and connected 2 switchs connected to gpio4 and gpio5

I have problem with a binary sensor in HA

I have make this 2 rules i tasmota

Rule1 on switch1#state do publish stat/sonoff_rf/RESULT {"POWER1":"%value%"} endon
Rule2 on switch2#state do publish stat/sonoff_rf/RESULT {"POWER2":"%value%"} endon

It works fine, I get this topic

13:28:01 MQT: stat/sonoff_rf/RESULT = {"POWER1":"1"}
13:28:04 RUL: SWITCH1#STATE performs "publish stat/sonoff_rf/RESULT {"POWER1":"0"}"
13:28:04 MQT: stat/sonoff_rf/RESULT = {"POWER1":"0"}
13:28:05 RUL: SWITCH1#STATE performs "publish stat/sonoff_rf/RESULT {"POWER1":"1"}"
13:28:05 MQT: stat/sonoff_rf/RESULT = {"POWER1":"1"}

13:28:12 RUL: SWITCH2#STATE performs "publish stat/sonoff_rf/RESULT {"POWER2":"0"}"
13:28:12 MQT: stat/sonoff_rf/RESULT = {"POWER2":"0"}
13:28:13 RUL: SWITCH2#STATE performs "publish stat/sonoff_rf/RESULT {"POWER2":"1"}"
13:28:13 MQT: stat/sonoff_rf/RESULT = {"POWER2":"1"}

But how do I make a binary sensor ?
This does not work

  - platform: mqtt
    state_topic: "stat/sonoff_rf/RESULT" 
    name: 'Dor'
    value_template: '{{value_json.POWER1.Data}}'
    payload_on: '1'
    payload_off: "0" 
    device_class: door
    qos: 1


value_template: '{{value_json.POWER1}}'

Thank you for saving my day

Why does HA not update after reboot, you can’t use retain in binary sensor
Here is the output from tasmota
20:59:58 MQT: tele/sonoff_rf/SENSOR = {"Time":"2020-03-23T20:59:58","Switch1":"ON","Switch2":"OFF"}

And state from HA

Your rules are wrong, you need publish2 to retain the message. See :

Do you mean that I have to fix sonoff / xdrv_01_mqtt.ino myself ?

I am using version Tasmota v8.2.0 Elliot and it is not incorporated?

Thé linked thread says it is incorporated.

Thanks again for you help, now it works

Rule1 on switch1#state do publish2 stat/sonoff_rf/RESULT {"POWER1":"%value%"} endon
Rule2 on switch2#state do publish2 stat/sonoff_rf/RESULT {"POWER2":"%value%"} endon
Rule1 1
Rule2 1