Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bertrandom/zerokey
https://github.com/bertrandom/zerokey
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/bertrandom/zerokey
- Owner: bertrandom
- Created: 2022-06-29T08:57:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T16:33:59.000Z (4 months ago)
- Last Synced: 2024-09-17T20:47:58.411Z (4 months ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zerokey
I have a [Raspberry Pi Zero WH](https://www.raspberrypi.com/products/raspberry-pi-zero-w/) with a [Rama M10-A macropad](https://rama.works/m10-a/) connected to it via USB. When the keys are pressed, it sends a command to my [Hubitat Hub](https://hubitat.com/) which telnets to my Lutron Smart Bridge to turn on and off various devices in my house.
This listens for keypresses on the macropad and sends HTTP calls to the Hubitat Hub.
## installation
Start with a fresh Raspbian image, enable SSH, add your SSH keys to the `pi` account.
Install [node-pi-zero](https://github.com/sdesalas/node-pi-zero)
Install PM2
```
npm install -g pm2
```Add the following to the end of your ~/.profile file:
```
# Add support for node CLI tools
export PATH=$PATH:/opt/nodejs/bin
```Start PM2 on reboot:
```
sudo env PATH=$PATH:/opt/nodejs/bin /opt/nodejs/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
```Install dependencies:
```
npm install
```Enable the Maker API on the Hubitat.
Copy `config/default.json5` to `config/local.json5` and set the host and access token for the Hubitat.
## running
Start the server
```
pm2 start
```Tail logs
```
pm2 logs 0
```Survive reboot
```
pm2 save
```