This project was created in node.js using modules like johnny-five and cron. The aim was to switch on/off lights at a certain time.
- If not already installed, install node.
- Clone this repo and change directory to it in the terminal:
~ $ cd nodejs-home-automation
. - Now do
npm install
. This will install all modules used.
- Run
nodemon app.js
ornode app.js
.
- In the
app.js
file insert the time you would like for your lights and the days you want to toggle it.
cronTime: '0 45 17 * * 1-5'
________
- Check if you are using 12 hour or 24 hour time format.
- The Raspberry Pi acts as an automatic switch so if you plan to use big lights instead of small led's, you need to use a relay to use mains power.