https://github.com/uxnomaan/home-automation
https://github.com/uxnomaan/home-automation
aliexpress home-automation raspberry-pi relay
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/uxnomaan/home-automation
- Owner: UXnomaan
- Created: 2017-06-29T03:50:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-28T02:18:29.000Z (about 8 years ago)
- Last Synced: 2025-02-23T09:15:35.916Z (8 months ago)
- Topics: aliexpress, home-automation, raspberry-pi, relay
- Language: JavaScript
- Size: 1.02 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Home Automation
I started this project because I was lazy and wanted a way to keep it that way and have an excuse to shop on AliExpress and get my hands dirty with some hardware.
## Components
### Pi zero
You can go with Pi Zero W which has a wifi module built in.
[MicroCenter - $5.00](http://www.microcenter.com/search/search_results.aspx?Ntt=pi+zero+board)
### 8 Channels Relay
Depending how many device you want to control, you can substitute this for 2, 4, 16 or 32 channels.
[AliExpress - $3.88](https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20170912200904&SearchText=8+relay+channel)
### Jumper wires
Need those for connecting things together.
[AliExpress - $2.50](https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20170912200700&SearchText=jumper+wire+female+to+female)### Electrical outlets
You need one for each 2 channels on your relay.
[HomeDepot - $2.49/each](http://www.homedepot.com/p/Leviton-Decora-15-Amp-Tamper-Resistant-Duplex-Outlet-Black-R55-T5325-0DE/202066690)
## Pi Setup
### Static ip
```javascript
route -ne
```This should give you your gateway information. Write it down.
Edit the following file:
```javascript
sudo nano /etc/dhcpcd.conf
```Add this at the end:
```javascript
interface wlan0
static ip_address=
static routers=
static domain_name_servers=
```### Run at boot
You can use `forever` npm module to do so.
```bash
sudo -i npm install forever -g
```Add the user you want this to be run under:
```bash
crontab -u pi -e
```select nano editor and add this to the last line:
```bash
@reboot /usr/bin/sudo -u pi -H /usr/local/bin/forever start /var/www/your-server.js
```----
TODO:- [X] ~~Webpack + express~~
- [ ] Add a cron job to check for internet connection
- Through out the day there needs to be a check for internet connection and blink the led if the pi is disconnected
- MQTT: Introduce MQTT broker and pub/sub system
- This should help with different relays that are not on the main Pi.
- This should help with instant update on clients without long-pull requests
- [ ] Create 2 different environments
- [ ] Serve front end on port 80 and the api on some other ports