433toMQTTto433 Bidirectional Arduino Gateway

If you want to use 433Mhz you won’t find a good solution. The OOK https://en.wikipedia.org/wiki/On-off_keying protocol is very basic and there’s no error correction, missed packet re-sending etc like there is in WiFi. Was never designed for 2 way communication although I have seen it used that way. Even then it’s not very good and messages can be missed very easily because of the way the data is sent.

You’re are going to have to wait a long time if you want a good tiny module that’s either Zigbee, or Z-Wave or whatever protocol that’s also cheap. That’s why Sonoff’s are such good value.

Good luck

And for the record, I have 433Mhz switches here that I use. My gateway fools HA and delivers an ON and OFF state but switches can miss their transmission and won’t turn ON or OFF so can get out of sync. I have a hanfull of RF switches still working mainly for lamps and devices where it doesn’t matter. For anything else I use all Sonoff’s on MQTT.

@KmanOz OK. I was enlightened and I will even forget it. I’ll try to follow your advice and install the sonoff so I’d like you to tell me how to hook up a physical button on it. Is there any solution to this? Or replace my common switch. Do you have your sonoff inside the wall? Can you get a photo of your installation?

I have sonoffs “in the roof”

I have left my light switches alone and added the sonoff close to the light fitting in line with the cable to the light.

This means that you can always override the sonoff and turn off the light (and the sonoff). This means you cannot turn it back on with HASS.

I also have the sonoffs set to turn on as soon as they are powered up (ie the switch is turned on).

This all makes for a good WAF! No fiddling with web pages etc, just turn it on or off if that is requrired. This is also good as a safety override. 2 of my sonoffs are currently not talking to my network (due to wireless router issues, not the sonoffs). I can still operate them like a normal light until I get it working.

Anyway - this is getting off topic, but check out the other threads

Dude read the contents of the thread. All your answers are in there. I think we’ve diverted this one too far off topic.

1 Like

@Rodolfo_Vieira This might have been answered (I’m catching up on my reading). The 433 Mhz technology that we are using is not “smart” which means that it can’t be “asked” for what state it is in. All it has is an on and off command. The 433toMQTTto433 gateway will also listen to the 433 Mhz for physical remotes that send the codes and this tells Home Assistant to change the state. For me, this keeps pretty accurate - I’d say 95% of the time. What helped tremendously was adding an antenna to the receiver. Usually, I’m changing my config so often it’s my fault when it is out of synch. Hope this helps.

I created another forum topic for us all to post the many devices this gateway can control. Please add the devices you use with this gateway there. Thanks!


1 Like

@masterkenobi news about that?
Station weather rf?

Not yet receive

@Partybug can you tell me if you use a expensive emitter/receive 433 module?
I have readed that heretodyne modules is a good choice.
Whats do you use? Cheaper? Other question…whats the maxium distance you can control it?

@Rodolfo_Vieira I use the cheaper emitter/receive modules. I do have to place a 17.2cm bread tie (I had to look them up - official name is “twist tie” according to wikipedia) on them for an antenna. I still haven’t soldered them in place yet but I twisted them on tight and they don’t move. I also used a bread board wire for an antenna.

I have a driveway alert motion detector… guessing it’s over 100 feet to my front door. Another 100 feet from my front door to the receiver (if straight through doors/walls etc). About 200 feet is pretty far. Without the antenna they don’t work well at all.


I have a similar set up to yours and thanks to you for sorting the MQTT part. I was wondering if I can add a brightness_scale to my MQTT and if it can be configured using IR codes?

I am controlling a dimmer light switch which is controlled by an IR LED with codes for the levels of brightness.

I have the IR codes for various brightness levels and was wondering if I could use the brightness_scale to turn on and off the lights and adjust their brightness all in one?

Hi @bachoo786,

I haven’t made my IR sensor gateway yet. (I’m slightly confused on which IR part to order) It was created and mentioned earlier by the talented 1technophile later in the thread.

As for making this an all in one dial for the multiple IR codes… Sounds like what your asking is for a light switch component to be made. I know we can send the individual codes as individual switches (for example: an on/off switch, a “25% switch” a 50% and 75% switch etc, but to make it a sliding scale on the webpage would require this. Have you looked at the components that dim yet to see if they are similar enough to use?

Could you send me the model or more info on your ir controlled light?

1 Like

I just received this and I can confirm it is NOT SUPPORTED by this gateway :disappointed:

@masterkenobi now, whats your solution? you will make a project with a dht22? its cheap and 1technopile has one project on your site.

it seems that library are available on the net to support weather stations with arduino, never tested them.
If you want to do some test the library name is remotesensor and available below

If tests are satisfying (the library is able to read data coming from your station) I could try to add the library to the gateway.

The temperature sensors like @masterkenobi,has in the picture typically use manchester encoding - a more complicated method which allows error checking of the received signal.

Hopefully the additional library mentioned would work for you, if not I would suggest building an RFLink. However you will need an arduino mega to use that software as provided by the RFLink people.

To link it to HASS via MQTT, you could add an ESP8266 like mentioned in this project

There is also work on a RFLink specific component for HASS which uses the RFLink arduino plugged directly in to your HASS server via USB

Inserted in this forum for cross reference of other threads in the forums!


Thanks. I have downloaded the stable code and put the RemoteSensor folder in C:\Users\abc\Documents\Arduino\libraries. Then I added these 2 lines into the sketch…

#include <SensorReceiver.h>
#include <SensorTransmitter.h>

Then I upload it to the NodeMCU.

Is there anything else I am missing because it doesn’t seem to work.

I think you need to take some of their examples from the remotesensors examples folder and load them to the esp8266,open the serial monitor and see if it receive something.

OK. I used this example; ThermoHygroReceiver.ino

Before I upload it to my NodeMCU, I changed the Serial.begin from 115200 to 9600 and the SensorReceiver pin from 0 to 5…

void setup() {

  // Init the receiver on interrupt pin 0 (digital pin 2).
  // Set the callback to function "showTempHumi", which is called
  // whenever valid sensor data has been received.
  SensorReceiver::init(5, showTempHumi);

Once it is done uploading, I opened up the serial monitor and all I can see is weird characters…

Does that mean my sensor is not supported?


Weird characters on the serial monitor often means you have the serial monitor at the wrong baud rate.

What rate is in the Serial.begin statement in the sketch - set your monitor to that if it is different to what you have now & you should start to see normal characters.