how to use (many more of) your 433MHz devices using RFlink and integrate them with Home Assistant

We use inexpensive, ‘old’ technology, 433MHz devices as well as modern smart devices

see also: 433MHz smarter letterbox

how to set up RFlink so that it will read your RF sensors

The easiest ready-to-roll device for integrating 433MHz RF devices with your smart home kit is the Sonoff RF Bridge. In an earlier project I use it to sense when a door contact sensor reacts. I also have 433MHz RF door bell buttons which I use to switch the room lights. In both cases the sensor transmits a wireless RF pulse which is picked up by a Sonoff RF Bridge. The bridge relays an MQTT message to Home Assistant. And then you can do anything.

But these are lucky examples of compatibility. The Sonoff RF Bridge doesn’t respond to a lot of RF devices nor can it control them. You’d need to modify it (really hard) and install OpenMQTTGateway on it (really hard – I couldn’t find instructions) to give it that capability. And you’d still find devices that the modified bridge didn’t respond to. I stumbled upon RFlink and it’s proving to be very capable at recognising HomeEasy and Friedland RF devices – and switching them too. Setting up this Rflink project took ages because the instructions are all over the place. The page seeks to put them on one place.

what you need

  • A Raspberry Pi with a working Home Assistant
  • An Arduino Mega R3 or clone to plug into the Raspberry Pi with a USB cable (under £10). The clone I bought from China cost the same as a basic Mega R3. You really just need an Arduino Mega R3 – anything else requires effort to save a £
  • An RF transmitter and RF receiver and some wires (under £5).
  • A tiny bit of soldering skill to attach the aerials
  • Some 433MHz devices eg doorbell, alarm, PIR sensors that you want to make use of
  • The RFlink firmware / software for the Arduino on a Windows PC.
You can buy a kit with all this from Nodo webshop

install RFlink on the Arduino (in Windows)

Plug the Arduino Mega R3 into a Windows PC with a USB cable. Windows should install the necessary drivers for the CH340 and assign a COM port so that we can upload the software.

You only need the RFlinkloader program and the C++ hex file highlighted. Read what’s readable if you want to know more.

Download the RFlink firmware/software for the Arduino. Open the zip and launch the RFlinkloader application. When the software launches it should find the COM port.

Notice that the software has a button to scan the available ports, a drop-down to select a COM port and a button to select the firmware file (rflinkloader.cpp.hex). You might need to press one of the physical buttons on the Arduino to wake it up. The firmware file uploads and your Arduino should be ready to go. When you click Serial port Logging you’ll see some signs that the software is working. Disconnect the Arduino to add the RF receiver kit next.

add the receiver and transmitter to the Arduino

You need six male-to-female Dupont wires, three for the RF transmitter and three for the RF receiver. Solder the correct aerial to the Antenna hole in each board. Connect them to the Arduino Mega as follows because the firmware is expecting to see things on the pins used here.

reconnect the Arduino to the Windows PC running RFlinkloader

I wondered forever how to upload the firmware. I suggest doing the upload first but that’s up to you.

With the Arduino and the RF kit connected to the PC click Serial port logging. Now send a signal from one of your RF devices and you ought see some output on the screen. Make a note of the device and what it’s recognised as. I’d recommend that you now steadily identify the name and code of as much kit as you have. You can copy and paste the log text or write this on paper but I wish I’d done this thoroughly.

If you find some devices aren’t recognised, click Debug in the Rflinkloader window. You’ll at least find that they are working. You might contact the software maker as directed but first read how the protocol works here.

connect the Arduino to the Raspberry Pi running Home Assistant to get the USB port name

Click Supervisor > System > Hardware. If needed reboot the RPi to get the USB serial port. See the official docs

add this to your configuration.yaml

The following code adds the RFlink integration and sets it to auto remember any RF signals it receives. Devices that are sensors (eg Oregon Scientific weather station) will be set as sensor entities. All other devices are understood as lights. Later on we’ll fix this and more. Right now, check your configuration and then reboot the Raspberry Pi.

  port: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0

  default: error
# add the following to the existing logger section
    rflink: debug
    homeassistant.components.rflink: debug

# add the following to the existing light section
  - platform: rflink
    automatic_add: true

# add the following to the existing sensor section
  - platform: rflink
    automatic_add: true

add the entities to your Home Assistant overview and automations

From now on Rflink will store the devices it discovers to Home Assistant. Home Assistant will create an entity for anything new. Of course you can display the state of the entities in the Overview / front page. However you must now do the work of identifying what sensor is what.

check the logs for probs

When the discovery above takes place Home Assistant keeps a log in the background. You can access this in the config folder – it might help you identify which device is which.

write automations and scripts

You can place the entities you found on the Overview of Home Assistant. You can also incorporate the entities into an automation that turns on a light when a button is pressed.

Leave a Reply

Your email address will not be published. Required fields are marked *