Page 1 of 1

Control remote controlled wall sockets from code

Posted: Fri Apr 03, 2020 8:05 am
by pythoncoder
Radio controlled wall sockets like these


are handy but you can't do a lot with them. You can get very cheap radios like these:


The receivers can sniff the signal from the remote enabling the transmitter to send those codes and control the socket.

The repo is here. Support is for Pyboards and ESP32.

This is less "plug and play" than most of my efforts: there is a wide range of wall sockets out there with different protocols. There is also quite a range of receiver and transmitter modules. If receiver A won't sniff remote B I probably won't be able to fix it: it's one for experimenters.

Re: Control remote controlled wall sockets from code

Posted: Fri Apr 03, 2020 3:46 pm
by kevinkk525
I'm using this library and it works great with my power sockets!

Re: Control remote controlled wall sockets from code

Posted: Mon Apr 13, 2020 2:03 am
by GryKyo
I have started to use some wireless switches (magnetic reeds) on outside doors, sheds, access to my back garden etc which are 433Mhz. I use a Sonoff 433Mhz-RF bridge flashed with the popular "Tasmota" firmware to listen for anything on this frequency which it then relays via MQTT where/when I can easily deal with it. This is straight forward, one parses the "signature" of the sensor from a json string which allows your code to identify the switch and it's condition; open/closed etc
By default this device running Tasmota has 16 unique "codes" that it can transmit, each can be called with a MQTT topic/message. If you already use MQTT then this has the advantage of being able to control "most" devices on 433Mhz and listen for cheap and available wireless sensors also.

There is a web UI served by the device, this is pasted from the console when I press some of the buttons:

Code: Select all

03:01:29 MQT: stat/rfSensors/RESULT = {"RfKey1":"Default sent"}
03:01:31 MQT: stat/rfSensors/RESULT = {"RfKey2":"Default sent"}
03:01:33 MQT: stat/rfSensors/RESULT = {"RfKey3":"Default sent"}
03:01:36 MQT: stat/rfSensors/RESULT = {"RfKey4":"Default sent"}
03:01:39 MQT: stat/rfSensors/RESULT = {"RfKey16":"Default sent"}


Sniffing sensor data

Posted: Mon Apr 13, 2020 9:06 am
by pythoncoder
I did wonder whether it might be possible to capture 433MHz signals from sensors rather than from remote controls. RC's are easy because, if you hold the button down, they transmit continuously (well, with short repeatable gaps). I could therefore capture multiple transmissions and do averaging to reduce timing uncertainties. These uncertainties arise in the radio receiver.

Sensors aren't so obliging: they transmit short bursts. Further, one type of radio receiver I tested emits a continuous stream of digital noise in the absence of a signal. This makes detecting an unknown signal rather difficult.

I therefore concluded that capturing sensor data was outside of the scope of this project. If the Tasmota guys have found a way to do this, all power to them. Unless I have a brainwave, or someone tells me how you fix this problem, I have no plans to sniff sensor data.