[Sloved] - Can't seem to figure out why my RF switch is firing

Hi, my end goal is to have rf switches working in Home assistant.
I’ve flash a Sonoff rf bridge with Tasmota and configured it
Home assistant has the MQTT broker working and is running out MQTT devices fine.
In the MQTT broker it can see the RF Bridge

In the console of the RF Bridge if I press the button I get this returned
RF_Bridge/tele/RESULT = {“Time”:“2019-12-31T19:25:54”,“RfReceived”:{“Sync”:10700,“Low”:370,“High”:1070,“Data”:“203BA2”,“RfKey”:“None”}}

In the configuration.yaml I’ve entered just the basics at the moment to try to get a response

binary_sensor:
  - platform: mqtt
    state_topic: "tele/RF_Bridge/RESULT"
    name: 'Test button1'
    payload_on: '203BA2'
    value_template: '{{value_json.RfReceived.Data}}'

From what I can tell it isn’t triggering as in Developer Tools ==> states, the state of the binary sensor stays off.

Any idea what I have missed as it seemed a simple setup but something is a miss.
ta

So took a break for a day and came back to this and found the solution and thought I would share.

I was following https://www.youtube.com/watch?v=OfSbIFIJPuc and my code in Home assistant was taken from his video and I didn’t check it hard enough, in short I was listening for state_topic of “tele/RF_Bridge/RESULT” when in fact it was firing off “RF_Bridge/tele/RESULT”

this is how I found this out.

Under the MQTT tab in the developers tools section of Home Assistant in the listen to a topic I entered in tele/RF_Bridge/RESULT and start listening, I noticed that when I pressed the button I wasn’t getting a result returning, this meant either HA wasn’t receiving them or I had the event incorrect. I logged back into the webpage of the Sonoff bridge and started the console and pressed the button again, the event fired as expected, I then copied the topic from the console and pasted into HA and noticed “tele/RF_Bridge” was transposed. Sure enough when I press the RF button it worked as expected.

Useful reading

Also if you are unsure of the topic you can enter # in the topic line to listen to all MQTT events coming into Home assisitant

simple config for a push button rf switch

binary_sensor:
  - platform: mqtt
    state_topic: "RF_Bridge/tele/RESULT"
    name: 'Test button1'
    payload_on: '203BA2'
    off_delay: 1
    value_template: '{{value_json.RfReceived.Data}}'

If you have more then 1 switch, you might check out this topic :

1 Like

thanks Francisp, I saw this in the morning and tried this as well, needless to say it didn’t work because of the topic, I suspect this is a change Tasmota as the configuration webpage makes sure it pushes out topic then prefix, tried changing this order but it keeps reverting back.

Good to have that link in this post as well as I did use it as a reference.

What I really got hung up on was trying to find and setting log levels for MQTT in addons instead of just using the Developers tool tab.

If you use setoption19 1 in the tasmota console, the topic will be switched.

1 Like

which is what I did :slight_smile: , that answers that question