Send mqtt RFRaw commands from HA? What am I missing?

I’ve just set up my sonoff rf bridge with tasmota and portisch. Captures the codes perfectly.
If I send the RFRaw command through the tasmota command line directly they work perfectly.

If I try to use developer tools on HA nothing happens.
How can I create switches to send these commands? Am I missing the correct set up with mqtt publish addon?

mqtt.publish
topic: 'cmnd/tasmota_C0CDCD/RfRaw'
payload: 'RFRaw AA B0.....'

tasmota config:

MQTT Port	1883
MQTT User	DVES_USER
MQTT Client	DVES_C0CDCD
MQTT Topic	tasmota_%06X
MQTT Group Topic 1	cmnd/tasmotas/
MQTT Full Topic	cmnd/tasmota_C0CDCD/

MQTT addon:

logins: []
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Many thanks

The implication is that Home Assistant may not be connected to the MQTT Broker.

Go to Configuration > Integrations > MQTT > Configure

In ‘Listen to a topic’ enter #

Click ‘Start listening’

Now go to the Tasmota console and publish a payload.

If you see nothing in Home Assistant, it’s not connected to the broker.

Thanks.
ok I typed in ‘#’ in the listen field and clicked start listening.

Then I sent the command from tasmota command line from the browser which turned my switch on.
Sorry what and where was I supposed to see in HA? Did not see any messages.
Total newbie to mqtt at the moment.

command line:

'RFRaw AA B0 6D 04 08 0136 0370 024E 06FE 3808080808080808080808080808080808080808180A0908082908181908181819081818181818190818181909090909081819090908190909090908190819090909090908181908190819090908181819081819081908190819081819090909090808 55'

UPDATE:

Just received this only if I use the mqtt publish but nothing from the command line tasmota:

topic: 'cmnd/tasmota_C0CDCD/Backlog'
payload: RFRaw AA B0 6D 04 08 0136 0370 024E 06FE 3808080808080808080808080808080808080808180A0908082908181908181819081818181818190818181909090909081819090908190909090908190819090909090908181908190819090908181819081819081908190819081819090909090808 55; rfraw 0
Message 0 received on cmnd/tasmota_C0CDCD/Backlog at 11:02:

RFRaw AA B0 6D 04 08 0136 0370 024E 06FE 3808080808080808080808080808080808080808180A0908082908181908181819081818181818190818181909090909081819090908190909090908190819090909090908181908190819090908181819081819081908190819081819090909090808 55; rfraw 0

QoS: 0 - Retain: false 

Looking at the tasmota information there is nothing under MQTT Host:
Is this the issue?

MQTT Host	
MQTT Port	1883
MQTT User	DVES_USER
MQTT Client	DVES_C0CDCD
MQTT Topic	tasmota_%06X
MQTT Group Topic 1	cmnd/tasmotas/
MQTT Full Topic	cmnd/tasmota_C0CDCD/
MQTT Fallback Topic	cmnd/DVES_C0CDCD_fb/

On the same page where you clicked ‘Start Listening’.

If you saw nothing there, after publishing a payload from the Tasmota console, then Home Assistant is not connected to the MQTT Broker.

The # you entered represents a wild-card to subscribe to every topic handled by the MQTT Broker. If Home Assistant is connected to it, it will receive payloads published to every topic.

When it comes to understanding/debugging MQTT communications, I always suggest using an MQTT client like MQTT Explorer. Once connected to the broker, it can be used to publish payloads and subscribe to topics, while displaying all topics in an intuitive tree-view.

1 Like

Should I complete the MQTT Host field with the IP address of the home assistant and restart?
Currently it is empty

Host = your MQTT broker address or IP

Sorry, can’t help you with Tasmota configuration (I don’t use it).

Strongly recommend you use MQTT Explorer to serve as your debugging tool. Unless you have the broker configured to accept anonymous connections, you will need to know the username and password to allow MQTT Explorer to connect to the broker. It can be the same as the one you used to connect the Tasmota-based device to the broker (but, ideally, should be a separate account).

1 Like

Used Tasmoadmin and this picked up the tasmota device and saved it. Could send a command from this addon fine.
Getting somewhere.

But now how to set up switches with mqtt platform is still confusing me somewhat

Thanks

Been tweaking the configs. The tasmota connects but then disconnects due to a socket error.

1599233576: New client connected from 192.168.1.47 as DVES_C0CDCD (p2, c1, k30, u'DVES_USER').
1599233578: Socket error on client DVES_C0CDCD, disconnecting.
1599233584: New connection from 192.168.1.47 on port 1883.
1599233584: New client connected from 192.168.1.47 as DVES_C0CDCD (p2, c1, k30, u'DVES_USER').
1599233652: New connection from 172.30.32.1 on port 1883.
1599233652: Socket error on client <unknown>, disconnecting.

another step. Solved the socket errors. also looks like its listening to tasmota now using the same users.

99235083: New client connected from 192.168.1.43 as Tasmota_mqtt_4bff1c20.91dc34 (p2, c1, k60).
[INFO] found mqttuseron Home Assistant
1599235084: New client connected from 172.30.32.1 as auto-4C3668EE-24D6-70E6-6C9F-DAE6ADB48A2B (p2, c1, k60, u'mqttuser').

BUT using the command lines from tasmota while listening still nothing is coming through to HA which is odd when looking at the logs for mqtt broker

It’s listening now!! yeahh

And sends from the mqtt.publish!!!
I’ll explain later

I’m having issues getting a doorbell to work.
Sniffed this out but publishing it does not work. Tried sniffing many times and trying variations.

Message 9 received on tele/RF_Bridge/RESULT at 15:51:

{
    "Time": "2020-09-04T19:53:19",
    "RfRaw": {
        "Data": "AA B1 03 00C8 02DA 1D2E 28190909090908181909081818181908190909090819081818 55"
    }
}

Reponse on tasmota would be:

{
    "Time": "2020-09-04T19:52:14",
    "RfRaw": {
        "Data": "AAA055"
    }
}

None of these work.

23:31:26 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:26","RfRaw":{"Data":"AA B1 04 0064 00DC 01B8 023A 381A2828 55"}}
23:31:27 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:27","RfRaw":{"Data":"AA B1 04 00D2 01E0 006E 1478 B0909091A0918091809181A1809091A1A290929090918091A0 55"}}
23:31:29 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:29","RfRaw":{"Data":"AA B1 04 00B4 01EA 006E 145A B090909180918091A091818180909181809090909091809182 55"}}
23:31:29 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:29","RfRaw":{"Data":"AA B1 04 00BE 01EA 0078 145A B09090918091A0918091A1A1A0909181809090909091A09180 55"}}
23:31:31 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:31","RfRaw":{"Data":"AA B1 04 00B4 01E0 0082 1478 B090909180918091809181A1A0909181809090909091809180 55"}}
23:31:31 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:31","RfRaw":{"Data":"AA B1 04 00C8 01E0 0082 1482 B0909091A091A091A0918181809091A1809090909091809180 55"}}
23:31:31 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:31","RfRaw":{"Data":"AA B1 04 00C8 01CC 0082 1450 B0909091A091809180918181809091A1809090909091809180 55"}}
23:31:32 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:32","RfRaw":{"Data":"AA B1 05 0104 01CC 00BE 0064 148C C0809291B091A091B291B1B1A29291A1829292929291A291B0 55"}}
23:31:34 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-04T23:31:34","RfRaw":{"Data":"AA B1 04 00AA 01E0 0078 1464 B0909091A09180918291818180909181809090909091809180 55"}}

hmm also tried a simple keyfob for the electric gate. Works from the broadlink rm pro.
But not from the code I captured from the rf bridge.

RFRAW AA B0 25 03 08 0212 035C 292C 2818091818180909090918181809091818091818180909180909180918 55

Does anyone know why the rf bridge captures the code but does not trigger?

01:50:23 CMD: RFRAW AA B0 25 03 08 01F4 037A 2954 2818091818180909090918181809091818091818180909180909180918 55
01:50:23 MQT: stat/RF_Bridge/RESULT = {"RfRaw":"ON"}
01:50:23 MQT: tele/RF_Bridge/RESULT = {"Time":"2020-09-05T01:50:23","RfRaw":{"Data":"AAA055"}}

It would help if I had realised it was a 315mhz transmitter!! :joy:
I’ll buy a new 433 doorbell.

If I sniff a code using RFRAW 166 how do I send this via mqtt? Same method?
e.g.

RFRAW AAA60405B8737255

Hi @yonny24 , I assume you have converted the B1 code to B0 before transmitting.
You are able to Transmit the code from Tasmota console and the receiving device reacts all good right?
Have you done any mods to the RF Bridge, ie have previously set it up to use ESPHome?

I was able to send rfraw command this way:
service: mqtt.publish
data:
topic: cmnd/tasmota_RF_Bridge/rfraw
payload: AA B0 17 04 08 01AZ 012A 02D0 39DA 38081A081A081A1A080A080A08 55;rfraw 0