DW1 Magnetic Sensor via Sonoff Bridge - Basic help

I am only 2 days into Home Assistant - totally love this. Managed to add some initial switches (Sonoff Mini and Sonoff Basic) and Sonos

I am using Tasmota and have also flashed Tasmota onto the Sonoff Bridge. Listening to the mqtt, I get this when the DW1 is triggered:

Topic: tele/Sonoff_Bridge/RESULT, Message: {"Time":"2019-12-26T09:27:48","RfReceived":{"Sync":12730,"Low":430,"High":1250,"Data":"B71369","RfKey":"None"}}

In configuration.yaml I have the following code

binary_sensor:
    platform: mqtt
    name: "DW1 Triggered"
    state_topic: "tele/Sonoff_Bridge/RESULT"
    value_template: '{{value__json.RfReceived.Data}}'
    payload_on: 'B71369'
    payload_off: 'B71369off'
    device_class: Door
    qos: 1

I now have a sensor icon displayed on my frontpage called “DW1 Triggered”. But I am not sure it is working. So I have created an automation.

- id: '1577350645681'
  alias: DW1 trigger automation
  description: ''
  trigger:
  - entity_id: binary_sensor.dw1_triggered
    from: 'OFF'
    platform: state
    to: 'ON'
  condition: []
  action:
  - data:
      message: DW1 is now triggered
    service: notify.notify

Nothing is triggered and I do not get a notification. How should I approach the error finding? Can you spot where I go wrong?

 value_template: '{{value_json.RfReceived.Data}}'

But you should really read this :

Thank you @francisp ! The double “_” would have taken me long time to spot. I typed it from a YouTube video - I am pretty sure that guy had two of them in it.

Anyway - the link you provide is very interesting. Good read. The method 2 is very smart - I think I will go with that at some point.

For now this works. Corrected per your suggestion and added an off_delay.

binary_sensor:
    platform: mqtt
    name: "DW1 Triggered"
    state_topic: "tele/Sonoff_Bridge/RESULT"
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: 'B71369'
    payload_off: 'B71369off'
    device_class: motion
    off_delay: 10
    qos: 1
1 Like