Skip to content

oRAHOME/home-assistant

Repository files navigation

Home Assistant

Setup Instructions

  1. Install Node.js
  2. Clone this repository and navigate to the project directory:
    cd ./home-assistant
  3. Install the dependencies:
    npm install
  4. Start the server in development mode:
    npm run dev
  5. Or start the server in production mode:
    npm start
  6. The server will run on: http://localhost:8080

Environment Variables

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

API Routes

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.


Testing

The project uses Jest for testing.

Run all tests:

npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •