- Install Node.js
- Clone this repository and navigate to the project directory:
cd ./home-assistant - Install the dependencies:
npm install
- Start the server in development mode:
npm run dev
- Or start the server in production mode:
npm start
- The server will run on:
http://localhost:8080
Ensure you set up the following environment variables in a .env file:
DEV_FRONTEND_SERVER=http://localhost:3000
PROD_FRONTEND_SERVER=
PORT=8080
HA_API_URL=http://YOUR_HOME_ASSISTANT_IP:8123/api/
HA_ACCESS_TOKEN=YOUR_LONG_LIVED_ACCESS_TOKEN
Base route prefix: /api
- POST /api/lights/control – Control light devices
- POST /api/switches/control – Control switches
- POST /api/tv/control – Control TV (basic route in place)
Routes for presence and temperature are scaffolded but currently disabled.
The project uses Jest for testing.
Run all tests:
npm test