Home Assistant and Sonoff RF

400 views
Skip to first unread message

Jonathan in London

unread,
Jul 18, 2023, 2:06:26 PM7/18/23
to rtl_433
Hi

Please forgive the newbie question.

Reading around the github pages I see lots of discussion about using rtl_433 to map Sonoff RF MQTT events from rfraw format to actual devices in MQTT, and even an updated version of the Portisch firmware which is less buggy and more capable.

I have just started with Home Assistant OS running on a Raspberry Pi.  Is there a repo I can use to add rtl_433 in this "mapping" mode to interpret data from the Sonoff RF.  I have a mix of blinds, thermometers, RF remotes and Lightwave RF devices, and rtl_433 is a dream solution.

All pointers gratefully received.  I'm not clued up enough to feed anything back to the project at this point :(

Thank you!

David Powell

unread,
Jul 18, 2023, 3:43:18 PM7/18/23
to Jonathan in London, rtl_433

You need to create an MQTT broker, which handles routing of the MQTT messages. Home Assistant has a plug-in (or integration, I get those terms mixed up) for that in the HA OS ("supervised" mode), or you can easily make a Mosquitto broker in the Linux OS if you're running HA Core.  The broker doesn't have to run on the same machine as HA, but it makes things a little simpler if it does.

You run rtl_433 on the machine with the radio dongle, which can be the same machine that HA runs on if you're using the Core version (This is why I don't use the supervised version). There is a command line switch in rtl_433 to have the output sent as MQTT messages (I think it's something like -F mqtt:<addr> <port> user <user> pass <password>).

At that point, anything that rtl_433 sees will be sent to the broker, and Home Assistant can subscribe and receive the messages.  You can use Mosquitto to subscribe as well to see what's being sent.

HTH.

--
You received this message because you are subscribed to the Google Groups "rtl_433" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtl_433+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rtl_433/6f58f4c9-ad9c-4d7d-a343-06fba0c1ad24n%40googlegroups.com.

Jonathan in London

unread,
Jul 18, 2023, 5:26:04 PM7/18/23
to rtl_433
Thank you David for your reply.  To be more specific, can I use the Sonoff RF in rfraw mode as the source, instead of a radio dongle, when using the rtl_433 add-on for HA?

Thanks.

Christian Z.

unread,
Jul 18, 2023, 7:01:37 PM7/18/23
to rtl_433
You need the branch from PR "Tasmotized Sonoff RF-Bridge decoding support" #1491
https://github.com/merbanan/rtl_433/pull/1491

Will include something like this at some point. Most of the refactoring is already done.

Jonathan in London

unread,
Jul 23, 2023, 1:15:49 PM7/23/23
to rtl_433
Thank you for the pointer to the PR.  Actually, that is what brought me here to this group.  The date on the PR is nearly three years ago, so I assume it's not likely to appear in a production system.

My aim with Home Assistant, is to run it as self-contained and out-of-the-box. Working full time in IT, and with plenty of other side projects, I'd like to run home automation as an appliance if you will.  I presume there's no likelihood of the Sonoff changes making it in to the HACS rtl_433 add-on.

Thanks
Jonathan.

steven...@gmail.com

unread,
Jul 30, 2023, 6:53:46 PM7/30/23
to rtl_433
Hi, I use home assistant and MQTT for most of my devices.  I use tasmota for anything I can as it is quick and easy.  If I have to, I program ESP8266 and ESP32 with arduino compiler using WiFi/MQTT messaging.

I love the 433 MHz motion sensors.  They are cheap on aliexpress and work great.   

I use the sonoff 433 bridge that I flashed with tasmota.  If you go into the console, you will see the 433 MHz msgs come from the new device which you can use to add to your configuration.


Hope this helps.

Steven

Jonathan in London

unread,
Jul 30, 2023, 9:09:04 PM7/30/23
to rtl_433
Thanks for your detailed reply, Steven!  The problem I have is a selection of devices which the Sonoff RF cannot natively understand.  That includes 7 roller blind motors (which an RFXcom can read), a Lightwave RF device (RFXcom can) and an outdoor thermometer (RFXcom cannot).

There's replacement firmware available for the RF chip (not the ESP chip) in the Sonoff RF (called Portisch) which can deliver uninterpreted RF data sequences to the Sonoff, which in raw mode tasmota can pass to MQTT.  And I can use that to send commands to the blinds.

Someone else, mentioned in the Github PR above, has extended and bug-fixed the Portisch firmware.

This is all great and with Portisch/Sonoff RF/Tasmota I can capture incoming data from all devices, including the outdoor thermometer.  But this is all uninterpreted, and I need rtl_433 to decode the thermometer RF data in to device+temp+humidity.

The PR above includes extensions to rtl_433 to allow it to read data from MQTT rather than a radio, interpret it, and post it back to MQTT which would be fantastic.  However, the PR has not been merged in to mainstream.  And in addition, it would then need the updated rtl_433 packaging in to the Home Assistant add-on.

Sadly it's early days for me with Home Assistant, so I wouldn't know where to start to enable all of this.  And I don't think it's helpful to fork the rtl_433 code.

In the meantime, I can use an RFXcom and forget about the thermometer.  It just seems a better solution is tantalisingly close, but oh so far away.

All of this is to the best of my newbie understanding.
Reply all
Reply to author
Forward
0 new messages