Sensors mqtt “Unknown”

hello, I have configured 4 sensors 2 sonoff magnetic door sensors and 2 pir also from sonoff
the first problem is that when i start hassio they are all activated, although their status is unknown " unknown ",
The only solution with “door” type sensors is: using payload_off: “16E132” with a code from an rf command you can activate off_delay: 5, in this way “door” type sensors work well.
The second problem is with the “motion” type sensors, they do not update the state to on, they remain in “unknown”, I think this is not a code issue, it is a hassio problem.
Can you help me?

binary_sensor:
  - name: "puerta de entrada"
    state_topic: "tele/brigde/RESULT"
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: "6AF999"
    payload_off: "16E132"
    device_class: door
    off_delay: 20
    qos: 1
  - name: "puerta de habitación"
    state_topic: "tele/brigde/RESULT"
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: "CAFA99"
    payload_off: "16E132"
    device_class: door
    off_delay: 5
    qos: 1  
  - name: "PIR entrada"
    state_topic: "tele/bridge/RESULT"
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: "EF6ABE"
    payload_off: "16E132"
    device_class: motion
    off_delay: 5
    qos: 1
  - name: "PIR pasillo"
    state_topic: "tele/bridge/RESULT"
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: "EFAD0E"
    payload_off: "16E132"
    device_class: motion
    off_delay: 5
    qos: 1
 - name: "PIR Pruebas"
   payload_on: "EFAD0E"
   state_topic: "tele/bridge/RESULT"
   value_template: '{{ trigger.payload_json.RfReceived.Data == "16E131" }}'
   device_class: motion
   off_delay: 2 
   qos: 1