Open allenlicn opened 4 years ago
Hey ๐๐ปThis package has a dependency on rpi-433 for sending and receiving data over 433MHz radio frequency.
If you have setup a Raspberry Pi with a rf module, you can follow the example from rpi-433 to listen for commands. Then just press the on/off buttons on your remote to find the values for rf_on
/rf_off
respectively.
For example:
var rpi433 = require('rpi-433');
var rfSniffer = rpi433.sniffer({
pin: 2, // Sniff on GPIO 2 (or Physical PIN 13), change to match your hardware
debounceDelay: 500 // Wait 500ms before reading another code
}),
// Provide a callback, invoked when sniffer sees a RF transmission
rfSniffer.on('data', function (data) {
console.log(`Code received: ${data.code}`);
});
Note that rpi-433
has an initial setup process that must be complete before the provided example will work: https://www.npmjs.com/package/rpi-433#usage
thanks for the explanation! will research the hardware requirements
Here's a more complete tutorial if you're wanting to make this: https://github.com/trentrand/homekit-outlets
how to get rf_on/rf_off values in the config? assuming those values are what distinguish one rf outlet from another.