Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get rf_on/rf_off values? #2

Open
allenlicn opened this issue Apr 18, 2020 · 3 comments
Open

how to get rf_on/rf_off values? #2

allenlicn opened this issue Apr 18, 2020 · 3 comments

Comments

@allenlicn
Copy link

allenlicn commented Apr 18, 2020

how to get rf_on/rf_off values in the config? assuming those values are what distinguish one rf outlet from another.

@trentrand
Copy link
Owner

trentrand commented Apr 18, 2020

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

@allenlicn
Copy link
Author

thanks for the explanation! will research the hardware requirements

@trentrand
Copy link
Owner

Here's a more complete tutorial if you're wanting to make this: https://github.com/trentrand/homekit-outlets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants