All Projects → mawalu → node-homeassistant

mawalu / node-homeassistant

Licence: MIT license
Node.js wrapper for the home-assistant websocket api

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-homeassistant

Home Assistant
Home-Assistant-Config
Stars: ✭ 182 (+574.07%)
Mutual labels:  home-automation, home-assistant
Homeassistant Config
Stars: ✭ 211 (+681.48%)
Mutual labels:  home-automation, home-assistant
Ha Wyzeapi
Home Assistant Integration for Wyze Bulbs, Switches, Sensors and Lock
Stars: ✭ 187 (+592.59%)
Mutual labels:  home-automation, home-assistant
Ha Dockermon
A NodeJS RESTful API which can be used with Home Assistant to report the state of Docker Containers
Stars: ✭ 171 (+533.33%)
Mutual labels:  home-automation, home-assistant
Node Red Contrib Home Assistant Websocket
Node-RED integration with Home Assistant Core
Stars: ✭ 222 (+722.22%)
Mutual labels:  home-automation, home-assistant
Home Assistant Config Fr
🏠Configuration de Home Assistant en français. 👨🏻‍💻 N'hésitez pas à ⭐ mon repo et à copier les bonnes idées ! 🇨🇵
Stars: ✭ 175 (+548.15%)
Mutual labels:  home-automation, home-assistant
Bruh2 Home Assistant Configuration
(OBSOLETE) BRUH2 Home Assistant Configuration
Stars: ✭ 205 (+659.26%)
Mutual labels:  home-automation, home-assistant
Feature Requests
ESPHome Feature Request Tracker
Stars: ✭ 160 (+492.59%)
Mutual labels:  home-automation, home-assistant
Smart Home
⭐ (Almost) everything needed to run my smart home with Home Assistant and more!
Stars: ✭ 221 (+718.52%)
Mutual labels:  home-automation, home-assistant
Locative Ios
[NOT MAINTAINED] The Locative iOS app. Helping you to get the best out of your automated home, geofencing, iBeacons at your hand.
Stars: ✭ 213 (+688.89%)
Mutual labels:  home-automation, home-assistant
Homeassistant
Example Home Assistant Configs
Stars: ✭ 168 (+522.22%)
Mutual labels:  home-automation, home-assistant
Home Assistant Cli
💻 Command-line tool for Home Assistant
Stars: ✭ 243 (+800%)
Mutual labels:  home-automation, home-assistant
Itunes Api
🎵 A simple server providing a RESTful service for controlling iTunes
Stars: ✭ 166 (+514.81%)
Mutual labels:  home-automation, home-assistant
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+8837.04%)
Mutual labels:  home-automation, home-assistant
Garhage
a Home-Automation-friendly ESP8266-based MQTT Garage Door Controller
Stars: ✭ 163 (+503.7%)
Mutual labels:  home-automation, home-assistant
Dsckeybusinterface
An Arduino/esp8266/esp32 library to directly interface with DSC security systems.
Stars: ✭ 202 (+648.15%)
Mutual labels:  home-automation, home-assistant
Entity Controller
Entity and lighting controller for managing devices via timers, scripts, and sun-based time restrictions.
Stars: ✭ 156 (+477.78%)
Mutual labels:  home-automation, home-assistant
Home assistant files
Here are my Home Assistant configuration files
Stars: ✭ 159 (+488.89%)
Mutual labels:  home-automation, home-assistant
Brad Homeassistant Config
Home Assistant configuration
Stars: ✭ 212 (+685.19%)
Mutual labels:  home-automation, home-assistant
Netdisco
🔎 Python library to scan local network for services and devices.
Stars: ✭ 240 (+788.89%)
Mutual labels:  home-automation, home-assistant

Node.js api for home-assistant

A simple package to access & controll home-assistant from node.js using the websocket api.

Installation

$ npm install node-homeassistant

Usage

Create a new Homeassistant object:

const Homeassistant = require('node-homeassistant')

let ha = new Homeassistant({
  host: '192.168.1.166',
  protocol: 'ws', // "ws" (default) or "wss" for SSL
  retryTimeout: 1000, // in ms, default is 5000
  retryCount: 3, // default is 10, values < 0 mean unlimited
  password: 'http_api_password', // api_password is getting depricated by home assistant
  token: 'access_token' // for now both tokens and api_passwords are suported
  port: 8123
})

ha.connect().then(() => {
  // do stuff
})

Access & subscribe to states:

console.log(ha.state('sun.sun'))


ha.on('state:media_player.spotify', data => console.log)

Call services:

ha.call({
     domain: 'light',
     service: 'turn_on'
   })

You can subscribe to the 'connection' event to get information about the websocket connection.

ha.on('connection', info => {
  console.log('connection state is', info)
})

See the example folders for a working demo.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].