All Projects → goyney → homeassistant_node

goyney / homeassistant_node

Licence: MIT license
Home Assistant Node.js library

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to homeassistant node

addon-shinobi
Shinobi Pro - Community Hass.io Add-on for Home Assistant
Stars: ✭ 22 (-45%)
Mutual labels:  home-assistant, homeassistant
hass-hue-icons
Additional vector icons for home assistant to model Philips Hue bulbs and fixtures.
Stars: ✭ 161 (+302.5%)
Mutual labels:  home-assistant, homeassistant
visonic
Visonic Custom Component for integration with Home Assistant
Stars: ✭ 57 (+42.5%)
Mutual labels:  home-assistant, homeassistant
zigbee
Database of Zigbee devices compatible with third party gateways: ZHA, deCONZ, Zigbee2MQTT, Tasmota, ZiGate, ioBroker,
Stars: ✭ 117 (+192.5%)
Mutual labels:  home-assistant, homeassistant
smart-home
🏡 My smart home setup built on top of Home Assistant
Stars: ✭ 140 (+250%)
Mutual labels:  home-assistant, homeassistant
sensor.avanza stock
Custom component to get stock data from Avanza for Home Assistant
Stars: ✭ 30 (-25%)
Mutual labels:  home-assistant, homeassistant
ha-config-ataraxis
My Home Assistant Configs. If you like what you see, please ⭐️my repo. It would encourage me a lot 🤘
Stars: ✭ 146 (+265%)
Mutual labels:  home-assistant, homeassistant
addon-tor
Tor - Home Assistant Community Add-ons
Stars: ✭ 37 (-7.5%)
Mutual labels:  home-assistant, homeassistant
repository-beta
BETA - Home Assistant Community Add-ons
Stars: ✭ 25 (-37.5%)
Mutual labels:  home-assistant, homeassistant
OTGW-firmware
A ESP8266 devkit firmware for the Nodoshop version of the Opentherm Gateway (OTGW)
Stars: ✭ 88 (+120%)
Mutual labels:  home-assistant, homeassistant
wienerlinien
A sensor that give you information about next departure from spesified stop.
Stars: ✭ 20 (-50%)
Mutual labels:  home-assistant, homeassistant
Home-Assistant-custom-components-DPC-Alert
Italy Meteo-hydro alert and hydrogeological phenomena Civil Protection (Protezione Civile). In this custom component you can find the vigilance Bulletin and the Bulletin of national hydrogeological and hydraulic criticalities. They allow to check whether in your current location there will be criticalities/warnings related to weather-hydrogeolog…
Stars: ✭ 31 (-22.5%)
Mutual labels:  home-assistant, homeassistant
HomeAssistant-Tapo-Control
Control for Tapo cameras as a Home Assistant component
Stars: ✭ 327 (+717.5%)
Mutual labels:  home-assistant, homeassistant
ad-alexatalkingclock
Alexa (or other Smart Speakers) tell you the time without asking every hour. Please ⭐️if you like my app :)
Stars: ✭ 30 (-25%)
Mutual labels:  home-assistant, homeassistant
lennoxs30
Home Assistant Lennox S30 / E30 / M30 integration
Stars: ✭ 31 (-22.5%)
Mutual labels:  home-assistant, homeassistant
eufy security
Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.
Stars: ✭ 242 (+505%)
Mutual labels:  home-assistant, homeassistant
hass-pandora-cas
Home Assistant custom component for Pandora Car Alarm System
Stars: ✭ 15 (-62.5%)
Mutual labels:  home-assistant, homeassistant
integration blueprint
Blueprint for custom_component developers.
Stars: ✭ 151 (+277.5%)
Mutual labels:  home-assistant, homeassistant
pymusiccast
Group MusicCast Speakers with Home Assistant
Stars: ✭ 34 (-15%)
Mutual labels:  home-assistant, homeassistant
bom-weather-card
Custom Animated Weather Card for any weather provider
Stars: ✭ 111 (+177.5%)
Mutual labels:  home-assistant, homeassistant

node-homeassistant

Home Assistant API Node.js library. It wraps the Home Assistant RESTful API in easy-to-use, Promise-based functions.

NPM Badge

Install

npm install homeassistant

Usage

const HomeAssistant = require('homeassistant');
const hass = new HomeAssistant({
  // Your Home Assistant host
  // Optional, defaults to http://locahost
  host: 'http://example.com',

  // Your Home Assistant port number
  // Optional, defaults to 8123
  port: 8123,

  // Your long lived access token generated on your profile page.
  // Optional
  token: '810a8c43-f22e-4ec4-b34e-c1e4741d4802',

  // Your Home Assistant Legacy API password
  // Optional
  // password: 'api_password',

  // Ignores SSL certificate errors, use with caution
  // Optional, defaults to false
  ignoreCert: false
});

hass.services.call('toggle', 'switch', 'lights_3_0')
  .then(res => console.log('Toggled lights', res))
  .catch(err => console.error(err));

Interface

All functions return Promises.

Configuration

// Returns if the API is up and running
hass.status();

// Returns the current configuration
hass.config();

// Returns basic information about the Home Assistant instance
hass.discoveryInfo();

// Returns all data needed to bootstrap Home Assistant
hass.bootstrap();

Camera

// Returns the image from the specified camera entity
hass.camera.image('entityId');

Events

// Returns an array of event objects
hass.events.list();

// Fires an event
// Requires the event name and an event data JSON object
hass.events.fire('call_service', {
  domain: 'switch',
  service: 'toggle',
  service_data: {
    entity_id: 'switch.lights_3_0'
  }
});

History

// Returns an array of state changes in the past
// Requires a datetime in YYYY-MM-DDTHH:MM:SSZ format
// An optional entityId can be provided to filter the results
hass.history.state('2017-05-01T12:00:00-04:00', 'sensor.temperature');

Logs

// Returns all errors logged during the current session of Home Assistant
hass.logs.errors();

Services

// Returns an array of all service objects
hass.services.list();

// Calls a service
// Requires the service, the domain, and the entity
// Alternatively, you can provide a service data JSON object as the third parameter
hass.services.call('toggle', 'switch', 'lights_3_0');
hass.services.call('toggle', 'switch', {
  entity_id: 'switch.lights_3_0'
});

States

// Returns an array of all state objects
hass.states.list();

// Returns a state object for a specified entity
// Requires the domain and entity
hass.states.get('sensor', 'temperature');

// Updates or creates the current state of an entity
// Requires the domain, entity, and a JSON object with a `state` attribute
hass.states.update('sensor', 'temperature', {
  state: 80,
  attributes: {
    unit_of_measurement: '°F'
  }
});

Templates

// Renders a Home Assistant template: https://home-assistant.io/topics/templating/
hass.templates.render('Mike is at {{ states("device_tracker.mike") }}.');

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].