Alexa ceiling fan remote allows you to control an SM5021 (emitter) / SM5032 (receiver) based infrared remote.
I named it "ceiling fan remote" because I made it to replace the IR remote of my ceiling fan.
You will need :
- A Particle device (tested with Core, should work with others) : https://www.particle.io/
- An IR LED
- A NPN transistor (BC547 here)
- A 100 ohms resistor
- A 220 ohms resistor
The code is made for french version of Alexa. You may have to change some files to adapt to your langage.
This is the application code to use on your own server with alexa-js-app-server (https://github.com/alexa-js/alexa-app-server).
Copy the files into “/path/to/alexa-js-app-server/apps/the-name-you-want”.
Then install particle-js node module from the above path :
npm install particle-api-js
You may want to modify these files :
- index.js :
- DEVICE_ID : the device id of your particle device. You may get it at https://console.particle.io/
- TOKEN_ID : your access token to Particle API. See https://docs.particle.io/reference/api/#generate-an-access-token
- All MSG_xxx constants to adapt to your language.
- applicationId : the applicationId for your Alexa skill. Get if from https://developer.amazon.com/alexa/console/ask
The json code to use when creating your alexa skill. You may to change “invocationName” and “samples” keys to adapt to your language.
The endpoint is the URL where your alexa-app-code is hosted.
The code to flash to your Particle device. Tested with Particle Core, should work with others (Photon, Electron, etc.)
The IR code comes from https://github.com/qwertzguy/Spark-Core-IRremote
- schematics.jpg : how to connect nuts and bolts