MQTT433gateway -- MQTT 433.92 MHz radio-frequency device gateway

Hi,
I have many 433MHz devices like rc-switches and rc-weather stations that I like to integrate in homeassistant.

There are some components like RFXtrx or RFLink to support this devices, but they have to be wired by USB and the firmware seems not to be Open Source.

Since I like to play with the ESP and am a fan of MQTT protocol, I decided to develop a small and mobile Gateway for 433MHz devices from scratch by using open source software. Therefore, I ported the 433 MHz protocols of piligh to the Arduino platform. The result is the ESPiLight library.

Basing on this library I developed MQTT433gateway. It integrates smoothly in homeassistant and thanks to WiFi it can be placed at a central position in a house. Also multiple gateways are supported. Thanks to ESPiLight, it encodes/decodes many 433 MHz protocols. On the MQTT433gateway github site you can find more information, examples, a sample circuit and homeassistant configurations.

If you are interested, please give it a try. Also contributions are welcome.

Puuu

8 Likes

Seems quite interesting, I will definitely give it a try when I find some time. Nice job

I was just thinking yesterday if wouldn’t be possible to make a gateway with a NodeMCU instead of Arduino mega and raspberry pi like the rflink project.

Do you think it is possible to add support for the limitlessled bulbs that work on 2.4ghz?

There is another MQTT 433Mhz gateway that I have used created by another user here 433mhz, infrared IR to and from MQTT on ESP8266
It also does IR and Bluetooth.

How do you think the two compare?

At the moment there is only support for 433 MHz devices and there is no 2.4 GHz receiver/transmitter on hardware side. Since the protocols of pilight/ESPilight focus on 433 MHz devices, 2.4 GHz is out of the focus for this project.

Thank for the link to the OpenMQTTGateway. As far as I see, OpenMQTTGateway utilises the RCSwitch library for 433 MHz communication. This means you have to deal with low level 433 MHz communication and need to send messages like home/commands/MQTTto433 1315156. While MQTT433gateway utilizes ESPilight for encoding/decoding of the signals to a JSON message: rf434/recv/tcm/87 {"id":87,"temperature":18.8,"humidity":68,"battery":1,"button":0}

Thanks for that. I might have a go and see how it copes with my existing 433Mhz infrastructure

Hi puuu

Thanks for the great work! i have one question though, how do i implement authentication for the mqtt broker in the net-passwd.h file ?

Hi again puuu

Maybe you can help me… i tried to use your sketch with an rxb6 ( http://www.ebay.co.uk/itm/162476699452?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT ), but i did not receive anything. Then i tried with a cheaper rx unit ( http://www.ebay.co.uk/itm/433MHz-RF-Transmitter-and-Receiver-Pair-for-Pi-Arduino-ASK-OOK-Remote-Wireless-/181863740559?hash=item2a57ec748f:g:sF0AAOSw9r1V8KXs ) and then i recive the codes.

Hi tbs,

authentication for the mqtt broker is on the way: PR #7

The rxb6 modules work for me. Have you checked the voltage levels? You need to supply 5V. Have you seen the schematic in the hardware folder?

Hi puuu

Thank you for taking the time to write back to me. I have looked at schematics at hardware folder and everything is wired up correctly. I am measuring 5,7 vdc between gnd and vcc. If i use one of the cheap chinese rf rx modules i works, thats really frustrating because i really wanna use your sketch with the support for the weatherstations while using at good rx module. If try with 1technophile’s OpenMQTTGateway sketch the RXB6 also works.

So both works, other module with MQTT433gateway and the RXB6 with the same hardware but another sketch?

This sounds weird. Have you tried to enable Logging mode and RAW mode? What is the output?

Before hijacking this thread, please consider to discuss it in a github issue.

Yes RXB6 works with another sketch.

I will open an issue on github to post the output of RAW and Logging mode

@puuu
Thanks for sharing this. I am already using the OpenMQTTGateway. It works great except it doesn’t support some sensors such as weather stations that sense temperature and humidity. Before I try yours, I have a couple of question.

  1. Can your gateway support the sensors listed in 433toMQTTto433 Gateway Device List ?
  2. Can your gateway support any weather station? If yes, which one?
  3. Since I already have a working OpenMQTTGateway, I can replace it with yours by replace the sketch without any hardware changes?

For decoding/encoding ESPiLight is used, which based on pilight. So all protocols supported by pilight should work with MQTT433gateway. A list of supported protocols can be found [here]
(https://wiki.pilight.org/doku.php/protocols). This list also includes weather station and I have two different weather station are running.

If you change the pin configuration in the sketch, it should work.

Hi
I really like the sound of this but I’m having problems uploading the code, I have downloaded MQTT433gateway and placed it my Arduino folder and then downloaded ESPiLight and placed into my libraries folder, when I tried to upload it to my ESP I get a compile error…
in file included from sketch/src/ESPiLight.cpp:22:0: /Users/xxxxxxxx/Documents/Arduino/libraries/ESPiLight-master/src/pilight/libs/pilight/protocols/protocol.h:26:26: fatal error: ../core/json.h: No such file or directory #include "../core/json.h" ^ compilation terminated.
I am using Arduino IDE 1.8.2… I am not a programmer and I can’t fix this could do with some help so please if you can thank you

You probably have not installed ESPiLight correctly. The easiest way is to use the Arduino Library Manager. If you install from source, you have to run make. Please see the README of ESPiLight.

Hi Puuu, thanks for your response I reinstall the library and everything is working fine, can you tell me is it possible to interact with the gateway using an Arduino and 433tx if so how and do you have an example sketch that I can work from thank you.

Sorry, I don’t get what you want. You can interact with the Gateway via MQTT. Why one want to interact with an Arduino? For sure you can simulate a 433 MHz remote control or weather station with an Arduino and 433-transmitter. For this you have to use a library like rc-switch or ESPiLigh (only ESP8266).

Yes I suppose I want to emulate a remote i.e…“weather station with an Arduino and 433-transmitter. For this you have to use a library like rc-switch” I have the library rc-switch, but don’t seem to be getting anywhere. I need to create some small low powered sensors using Arduino and 433-transmitter, eventually I will swap the Arduino for tiny85.