Socket
Socket
Sign inDemoInstall

@digital-alchemy/hass

Package Overview
Dependencies
29
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @digital-alchemy/hass

This repository contains generic extensions for interacting with Home Assistant, including websocket & REST API adapters, entity & event management, backup workflows, and more.


Version published
Weekly downloads
356
decreased by-10.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

🏠 Welcome to @digital-alchemy/hass!

This repository contains generic extensions for interacting with Home Assistant, including websocket & REST API adapters, entity & event management, backup workflows, and more.

  • Extended docs: https://docs.digital-alchemy.app/Hass
  • Discord

⭐ Features

📝 First-class Editor Experiences

  • Did you just typo that entity name?
  • Just what services are actually available?

Create references to entities that will always reflect their current state. Get details about all the services your setup supports and how to use them, directly in your editor.

editor

🌐 Managed Websocket

Don't worry about all the complexities of dealing with Home Assistant. Let the library help by handling all the connection logic, keeping track of events for you, formatting requests, and more.

Install

Add as a dependency, and add to your imports. Nice and easy

npm i @digital-alchemy/hass

Add to code

import { LIB_HASS } from "@digital-alchemy/hass";

// application
const MY_APP = CreateApplication({
  libraries: [LIB_HASS],
  name: "home_automation",
})

// library
export const MY_LIBRARY = CreateLibrary({
  depends: [LIB_HASS],
  name: "special_logic",
})

⚙️ Configuration

🛠 Custom Types

This library has support for customizing type definitions to match a particular Home Assistant install. This functionality requires the type-writer command to be installed as well.

Add to devDependencies!

npm i --save-dev @digital-alchemy/type-writer
npx type-writer

Custom types only affect the development experience and have no impact on the way the application runs.

📦 Supervised Support

If your code is running within a Home Assistant addon environment, it will automatically connect with no additional configuration needed.

🖥 Manual

For code running elsewhere, manual configuration is required. You will need a Long Lived Access Token, which can be generated on your user profile. You can store your config at ./.{app_name} or ~/.config/{app_name} in INI format.

Don't forget to configure "type_writer" also!

[hass]
  BASE_URL=http://localhost:8123
  TOKEN=YOUR LONG LIVED ACCESS TOKEN

For additional projects that build on and consume this library, check out these other projects:

GitHubDescriptionNPM
synapseTools for generating entities within Home Assistant.@digitial-alchemy/synapse
automationAdvanced automation tools for creating dynamic workflows.@digital-alchemy/automation
type-writerGenerate custom type definitions for your setup.@digital-alchemy/type-writer
automation-templateStart your own Home Automation project with the @digital-alchemy quick start template

FAQs

Last updated on 30 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc