Skip to content

bigandy/house-control

Repository files navigation

House Control via Next and API routes with Sonos and Hue

TODO

  • Graph of Temperature and Humidity over time
  • Better track of spotify accessToken
  • Better design of music/room page

DONE

  • Dashboard that shows the time/date/weather
  • Sonos / Spotify so can search on a page (/music/room) and play that in the room selected.
  • Track data with SQLite and Prisma
  • node-cron to get measurement every 1 minute. in external folder.
  • Track data in DB (e.g. Hasura) and access via GraphQL endpoint
  • Temperature and Weather tracking using Raspberry Pi + sensor
  • Dashboard with Time / Date
  • Dashboard which allows user interaction i.e. if it is a touch screen allow all lights off or everything off
  • Dashboard shows current temperature outside / inside
  • Discovery of all lights
  • Status of all lights
  • Turn all lights off/on

Future Ideas

  • Radio Search / Favorite on Sonos with TuneIn / BBC
  • Download each new Gilles Peterson show on a Sunday morning and save to Dropbox or SD card or SSD
  • Google Home API to connect to anything in the Home i.e. my Tapo P100 plugs (no current JS API available)

This is a Next.js project bootstrapped with create-next-app.

Getting Started

make an .env file with the following

HUE_BRIDGE_USER=""
HUE_BRIDGE_USER_CLIENT_KEY=""
HUE_BRIDGE_USER_IP=""

SONOS_KITCHEN_IP=""
SONOS_KITCHEN_EATING_IP=""
SONOS_BEDROOM_IP=""
SONOS_LOUNGE_IP=""

CLIMACELL_API_KEY=""

How to run on Raspberry Pi

  • run npm run build
  • run npm run start to run the server

PM2

If you want to run this continually you'll need pm2.

  • pm2 start npm --name "Next App" -- start
  • if you want to set pm2 to start when the pi boots follow this tutorial
  • Restart pm2 with `pm2 restart "Next App"

Weather API

I am going to try out ClimaCell.

About

Next js home control

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published