Skip to main content

Lightweight Home Assistant API automation helper

Project description

ReactHass

ReactHass is a tiny Home Assistant helper around homeassistant_api.

Install

pip install reacthass

Usage

from reacthass import Reactor

hass = Reactor('HOME ASSISTANT URL', 'YOUR TOKEN')

if hass.when_value_reached('sensor.temperature', 30, value_type='number'):
    hass.get_domain('fan').turn_on(entity_id='fan.fan')

Notes

  • Home Assistant states are strings, so numeric checks use value_type='number'.
  • get_entities_name('light') returns full entity IDs like light.kitchen.
  • The async API mirrors the sync API.

Persistence

If you want to keep the sensor record in the database you might add to your configuration.yaml:

recorder:
  include:
    entities:
      - sensor.test

Examples

See the /examples folder.

Credits

This package is built on top of HomeAssistantAPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reacthass-0.1.3.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reacthass-0.1.3-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file reacthass-0.1.3.tar.gz.

File metadata

  • Download URL: reacthass-0.1.3.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for reacthass-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1894c18f1228a8dd212a9b742cdedcd7793e83f4ea67118cb846a09eff2933d9
MD5 517549984d4057cca68a3c36e5cc1dba
BLAKE2b-256 bc0c5e235144c6cc5febf750b426098f9232fe6ad4cbd94eb33702b0c280f13f

See more details on using hashes here.

File details

Details for the file reacthass-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: reacthass-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for reacthass-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 37437b83dd040a73670676cd879f24af9e842094ad230e7c10ae9b48b12e0e8b
MD5 959e880c0e6cf9bddfb416d4a762dfda
BLAKE2b-256 f87b2a9f1ea1fdbb1bae1b642350c0334628f69f3d06adcfed0d6b27eac86d03

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page