From an user request I took a look into the SONOFF RF Bridge, a quite interesting device from SONOFF. It is able to send and receive 433mhz signal with a very competitive price of less than 10€.
I already own several SONOFF Smart switches on which I loaded custom firmwares with success. One is working since months perfectly!
Here is how the RF bridge looks inside:
First thing I used to do when I launch some new development is to check the state of the art, as we often say google is your friend. And by searching the compatibility between the bridge and RCSwitch library (the main RF library of OpenMQTTGateway) I fall into the very good work of Xose Pérez (Tinkerman)
http://tinkerman.cat/hacking-sonoff-rf-bridge-433/
He ported successfully its ESPURNA code to the Sonoff RF Bridge.
After following its instructions and some mistakes from me (be careful about choosing the good line of pins on the bridge for your FTDI connectors :-( and choose the following parameters except the port) I successfully uploaded some code into the bridge
I already own several SONOFF Smart switches on which I loaded custom firmwares with success. One is working since months perfectly!
Here is how the RF bridge looks inside:
First thing I used to do when I launch some new development is to check the state of the art, as we often say google is your friend. And by searching the compatibility between the bridge and RCSwitch library (the main RF library of OpenMQTTGateway) I fall into the very good work of Xose Pérez (Tinkerman)
http://tinkerman.cat/hacking-sonoff-rf-bridge-433/
He ported successfully its ESPURNA code to the Sonoff RF Bridge.
After following its instructions and some mistakes from me (be careful about choosing the good line of pins on the bridge for your FTDI connectors :-( and choose the following parameters except the port) I successfully uploaded some code into the bridge
Please note that the bridge use an ESP8285 and not an ESP8266.
After some modifications I integrated it into OpenMQTTGateway.
I tested it with my switch plugs and also with cheap door sensors with success.
The received 433mhz code is published to MQTT well:
home/SRFBtoMQTT 267A013603B6140554
My only concern is that the data received by MQTT sometimes vary from the same device or button. For a wall plug you need to try the different values received before getting into the one that will work on your device.
For a door sensor or a PIR it is more complicated because if you use a code to trigger your home automation and this code is not always the one that you receive from the same device.
Here is two examples of received raw values from the same device:
home/SRFBtoMQTT 267A013603B6140554
home/SRFBtoMQTT 268E014A03AC14155F
in the mean time OpenMQTTGateway receive with ZgatewayRF:
home/433toMQTT 1312084
If we dig into the infos given by Tinkerman:
https://www.itead.cc/wiki/images/5/5e/RF_Universal_Transeceive_Module_Serial_Protocol_v1.0.pdf
We can see that the raw values correspond to Tsyn, Tlow, Thigh and 24bit Data below:
24 bit data is also the size of rcswitch data !
If we convert 140554 to decimal we get 1312084, coherent!
Nevertheless to trigger the home automation we need to extract these datas and send them to MQTT.
By extracting the data from the buffer it is quite easy to get the decimal value with some code modifications:
home/433toMQTT 34009
home/SRFBtoMQTT/Raw 2A80015E042E0084D9
home/SRFBtoMQTT 34009
home/SRFBtoMQTT/Tsyn 10880
home/SRFBtoMQTT/Thigh 350
home/SRFBtoMQTT/Tlow 1070
Like that the behaviour for receiving is homogenous with ZgatewayRF and the bridge can be used to trigger home automation controller from 433mhz sensors (of course you can send also). The tutorial is here
Thanks Xose Pérez for its code.
Seems Sonoff are onto us. I just bought one with the hopes of hacking it, they've removed all the pin header on the PCB so now you'd need to be ready to solder pins onto the PCB.
RépondreSupprimer