Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@digital-alchemy/hass
Advanced tools
Readme
@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.
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.
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.
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",
})
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.
If your code is running within a Home Assistant addon environment, it will automatically connect with no additional configuration needed.
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:
GitHub | Description | NPM |
---|---|---|
synapse | Tools for generating entities within Home Assistant. | @digitial-alchemy/synapse |
automation | Advanced automation tools for creating dynamic workflows. | @digital-alchemy/automation |
type-writer | Generate custom type definitions for your setup. | @digital-alchemy/type-writer |
automation-template | Start your own Home Automation project with the @digital-alchemy quick start template |
FAQs
This repository contains generic extensions for interacting with Home Assistant, including websocket & REST API adapters, entity & event management, backup workflows, and more.
The npm package @digital-alchemy/hass receives a total of 345 weekly downloads. As such, @digital-alchemy/hass popularity was classified as not popular.
We found that @digital-alchemy/hass demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.