Coding for RF devices 2021 version

Good day.
I need help with coding my RF devices to in configuration. yaml
This is the info I receive on Tasmota console:

14:55:33.044 MQT: tele/RF_Bridge/RESULT = {“Time”:“2021-02-28T14:55:33”,“RfReceived”:{“Sync”:12560,“Low”:440,“High”:1240,“Data”:“D4027E”,“RfKey”:“None”}}

This is a motion sensor.

Maybe

binary_sensor:
  - platform: mqtt
    name: "motion_sensor"
    state_topic: "tele/RF_Bridge/RESULT"
    value_template: >-
     {% if value_json.RfReceived.Data == 'D4027E' %}
      {{'ON'}}
     {% else %}
      {{states('binary_sensor.motion_sensor') | upper}}
     {% endif %}
    device_class: motion
    qos: 1
    off_delay: 10

Thanks allot, I will try this and let you know

Thanks allot, this coding is working 100%

1 Like

Do you perhaps have a coding for a door contact

What’s the Tasmota console message?

This is when I open the door

17:06:30.281 MQT: tele/RF_Bridge/RESULT = {“Time”:“2021-02-28T17:06:30”,“RfReceived”:{“Sync”:7950,“Low”:270,“High”:780,“Data”:“CD94B1”,“RfKey”:“None”}}

This is when the door close

17:06:56.383 MQT: tele/RF_Bridge/STATE = {“Time”:“2021-02-28T17:06:56”,“Uptime”:“0T03:10:09”,“UptimeSec”:11409,“Heap”:27,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“MqttCount”:1,“Wifi”:{“AP”:1,“SSId”:“Meadowbrook-Guest 2G”,“BSSId”:“58:C1:7A:11:66:80”,“Channel”:1,“RSSI”:84,“Signal”:-58,“LinkCount”:1,“Downtime”:“0T00:00:03”}}

binary_sensor:
  - platform: mqtt
    name: "door_sensor"
    state_topic: "tele/RF_Bridge/RESULT"
    value_template: >-
     {% if value_json.RfReceived.Data == 'CD94B1' %}
      {{'ON'}}
     {% else %}
      {{states('binary_sensor.door_sensor') | upper}}
     {% endif %}
    device_class: door
    qos: 1

EDIT: deleted off_delay

Thanks again