Skip to main content

Home Assistant Simple Websocket client

Project description

Home Assistant WebSocket wrapper

The purpose of this module is to allow to execute synchronous calls to Home Assistant WebSocket API.

It is based on Home Assistant WebSocket API.

It uses synchronouse calls and short-lived connections. Which means each call will open a new connection, execute the call and close the connection. this is way simple and fast in development, but not very efficient in terms of performance. However, it is good enough for most of the cases especially scripting the HomeAssistant.

Usage

You can either use it with AppDaemon or without.

With AppDaemon the token and server information will be configured automatically:

from HassWS import HassWS


class appdaemon_app(hass.Hass):
    hws: HassWS

    def initialize(self):
        self.hws = HassWS(hass_instance=self)
        self.log(self.hws.send('config/entity_registry/list'))

Or without AppDaemon:

from HassWS import HassWS

hws = HassWS(server_url='wss://my.hass.url:8123',token='token goes here')
print(hws.send('config/entity_registry/list'))

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

HassWS-0.0.3.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

HassWS-0.0.3-py3-none-any.whl (1.8 kB view details)

Uploaded Python 3

File details

Details for the file HassWS-0.0.3.tar.gz.

File metadata

  • Download URL: HassWS-0.0.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for HassWS-0.0.3.tar.gz
Algorithm Hash digest
SHA256 08094221abb9ee6994247eee42d9c9c03df114b888662c8968c8fd20beec6d6b
MD5 04117d457757fff75c27fd1ba7c12081
BLAKE2b-256 8c437fbccd7c7395e6ffdcbead244b56cf06df8987d2c4b8fbce5aba391c7dd9

See more details on using hashes here.

File details

Details for the file HassWS-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: HassWS-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 1.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for HassWS-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 069b645f91b133b8b2c62bbbac4a77c9919423ff45d1e8ba5111547681681103
MD5 cc9e52dde1c36d7bfd2754272587845a
BLAKE2b-256 3f890a1accf1010b2e348f66e35cb9639c33ef180a5513af4c91f1c0632a00a6

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