MQTT & RFBridge setup

Hi can someone tell me how I can see if HA is recognosing an MQTT client? Im trying to get an RF Bridge and simple door sensor to work. It is flashed to Tasmota and the RFBridge succesfully recognises the sensor in the Tasmota console. Any help appreciated. I get an error of “No matching payload for entity found” in log so assume its doing something. My config looks like this:

    binary_sensor:
  - platform: mqtt
    state_topic: "tele/RF_Bridge/RESULT"
    name: 'Postbox'
    value_template: '{{ value_json.RfReceived.RfKey }}'
    payload_on: 'AEBB89'
    payload_off: 'AEBB89OFF'
    device_class: opening
    qos: 1

And automation like this:

    - alias: Reset RF Motion State
  hide_entity: false
  initial_state: 'off'
  trigger:
  - platform: state
    entity_id: binary_sensor.postbox
    to: 'on'
    for:
      seconds: 100
  action:
  - service: mqtt.publish
    data:
      topic: tele/RF_Bridge/RESULT
      payload: AEBB89OFF

But my binary_sensor.postbox doesnt change.
Any help appreciated.

You can add

expire_after: "1"

also you state_topic look in the wrong place try

value_template: '{{value_json.RfReceived.Data}}'
binary_sensor:
  • platform: mqtt
    state_topic: “tele/RF_Bridge/RESULT”
    name: ‘Postbox’
    value_template: ‘{{value_json.RfReceived.Data}}’
    payload_on: ‘AEBB89’
    expire_after: “1”
    device_class: opening
    qos: 1

you shouldnt need the Automation to set it off

The automation enables me to see what its doing - if there’s any change. Is there another way to see if its working in HA?
I tried your suggestion but it seems to make no difference.
Also the DRZZs video I followed showed the formatting as this ‘{{ value_json.RfReceived.RfKey }}’ with leading and trailing spaces where your formatting doesn’t use the spaces. Which is correct?
Thanks for help.

This is whatMy Tasmota log show this


and it the Data Changing not the RfKey

So my help Is base on What I have Done which Works with no ERRORS

I appreciate your help. I’m a total newbie so followed the video. Where would I find that log - is it in console on Tasmota?

Yes sorry Wrong WordingShould of said Console

load that screen then Press the Button and see what you get

Yes that seems to work ok:

I suspect my problem is in HA though.
The Automation should show when the sensor is off as its an open only sensor.

    - alias: Reset RF Motion State
  hide_entity: false
  initial_state: 'off'
  trigger:
  - platform: state
    entity_id: binary_sensor.postbox
    to: 'on'
    for:
      seconds: 100
  action:
  - service: mqtt.publish
    data:
      topic: tele/RF_Bridge/RESULT
      payload: AEBB89OFF

try putting single quote around the the payload

payload: 'AEBB89OFF'

I see you have the initial_state: ‘off’ which means its not going to go when the postbox state is on

I always make automation

initial_state: true

So they always get turn on when HA starts

Thanks for your help. But nothing seems to be working. Is there a way to see the data in HA? As it may be its not getting through.

does the binary sensor turn on when the Postbox does it thing

No it doesnt.

Im looking at the entity - binary_sensor.postbox - I assume thats what you are referring to?

Another thing. It does’nt accept the line entry
expire_after: “1”
Ive had to comment that out.

Yup, that’s because it’s not a valid option for MQTT Binary Sensor (it’s valid for MQTT Sensor).

If you are seeing warning messages in Home Assistant’s log reporting “no matching payload” then this is confirmation that Home Assistant is connected to the MQTT Broker, subscribed to topics, and receiving payloads (MQTT messages). The complaint is that the format of the payload doesn’t match what Home Assistant needs.

For example, I created a simple MQTT Binary Sensor, called “My Test”, subscribed it to the topic “test/state” and then published an invalid message to the topic. Here’s the resulting warning message:

2019-02-16 11:04:59 WARNING (MainThread) [homeassistant.components.binary_sensor.mqtt] No matching payload found for entity: My Test with state_topic: test/state

When I published a valid message to “test/state” (either ON or OFF for a binary_sensor), the “My Test” sensor reflected the published state and the log contained no warning message about the “My Test” sensor.

Many thanks for your help. I’m not quite certain what you mean or where I can find whats required. I can confirm that “tele/RF_Bridge/RESULT” is a valid topic. What am I missing? Thanks

In your first post you stated:

Your assumption is correct.

Later you stated:

I simply wanted to inform you that the presence of the warning messages is, as per your original assumption, confirmation that something is attempting to ‘get through’. In other words, Home Assistant is subscribed to the topic (tele/RF_Bridge/RESULT) and receiving messages … except the messages (payloads) aren’t matching what you’ve asked it to find (hence the warning ‘no matching payload’).

Are you using any kind of MQTT client to help debug this problem? If not, you can use Home Assistant’s MQTT page to publish a message to a topic. It allows you to easily experiment with the message (as opposed to having to manually activate, in your case, the physical door sensor).

Just paste this topic

tele/RF_Bridge/RESULT

and this payload

{"RfReceived":{"Sync":1,"Low":2,"High":3,"Data":"AEBB89","RfKey":"None"}}

into the MQTT page and click ‘PUBLISH’.

This ought to activate your binary_sensor because it is configured to match a payload of AEBB89 in value_json.RfReceived.Data.


When debugging MQTT problems, I use an MQTT client to observe all topics and their messages. The MQTT client lets me confirm the message contains precisely what I think it should (or not).

I’ve used several MQTT clients but I’m now partial to MQTT Explorer because it presents all topics in a tree-view and displays JSON payloads in great detail.

Here’s how your topic, and the payload I suggested, appear in MQTT Explorer:

Thanks for your help. I published the MQTT as you suggested and that seems to have resolved the error ocurring. Strange it was’nt part of Dr.ZZs video? Things seem to change rapidly on HA though. I suspect my problem therefore must be in the YAML.
Thanks

1 Like

My suggestion isn’t needed to make anything work. It is simply to confirm the message is being received and interpreted correctly. Publishing the message this way is often more convenient than manually activating the physical device that normally publishes the message (i.e. your postbox sensor). Had the test failed, then we would know something is still amiss in the configuration.

hi there. can someone please help setting up the binnary ?

20:46:54 MQT: tele/sonoff/RESULT = {"RfReceived":{"Sync":12230,"Low":410,"High":1230,"Data":"E8AC99","RfKey":"None"}}
20:46:56 MQT: tele/sonoff/RESULT = {"RfReceived":{"Sync":12270,"Low":410,"High":1230,"Data":"E8AC99","RfKey":"None"}}
20:47:00 MQT: tele/sonoff/RESULT = {"RfReceived":{"Sync":12360,"Low":420,"High":1220,"Data":"E8AC99","RfKey":"None"}}