Skip to main content

Python library for controlling Saleryd HRV system

Project description

PyPI-Server Monthly Downloads Project generated with PyScaffold

pysaleryd

Python library for controlling Saleryd HRV system

Python library for controlling Saleryd HRV system using the built in websocket server used by Saleryd HRV Homeassistant integration https://github.com/bj00rn/ha-saleryd-ftx

Maintains a reconnecting websocket to the system.

Supported devices

LOKE1/Loke Basic/LS-01 using control system 4.1.5

Usage with asyncio as library

Read data

import asyncio
import aiohttp

from pysaleryd.client import Client

async with aiohttp.ClientSession() as session:
    async with Client(WEBSOCKET_URL, WEBSOCKET_PORT, session) as hrv_client:
        await asyncio.sleep(2) # wait a bit for some data
        print(client.data)

Read data using callback

import asyncio
import aiohttp

from pysaleryd.client import Client

def handle_message(data: dict):
    print(data)

update_interval = 10 # call handle_message every 30 seconds

async with aiohttp.ClientSession() as session:
    async with Client(WEBSOCKET_URL, WEBSOCKET_PORT, session, update_interval) as hrv_client:
        hrv_client.add_handler(handle_message)
        await asyncio.sleep(update_interval +1 ) # wait around a bit for data

Send control command

Command syntax can be found by dissecting websocket messages in the built in web ui

import asyncio
import aiohttp

from pysaleryd.client import Client

async with aiohttp.ClientSession() as session:
    async with Client(WEBSOCKET_URL, WEBSOCKET_PORT, session) as hrv_client:
        await hrv_client.send_command("XX", 1)

Troubleshooting

  • Confirm system is connected and UI is reachable on the local network. Follow steps in the manual.

  • Confirm websocket port by connecting to the UI using a browser and take note of websocket port using debug console in browser. 3001 is probably default

  • The system HRV system can only handle a few connected clients. Shut down any additional clients/browsers sessions and try again.

Disclaimer

Use at own risk.

This project is in no way affiliated with the manufacturer.

All product names, logos, and brands are property of their respective owners. All company, product and service names used are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.

Note

This project has been set up using PyScaffold 4.4. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

pysaleryd-5.0.1rc4.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

pysaleryd-5.0.1rc4-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pysaleryd-5.0.1rc4.tar.gz.

File metadata

  • Download URL: pysaleryd-5.0.1rc4.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pysaleryd-5.0.1rc4.tar.gz
Algorithm Hash digest
SHA256 b6779bc10c9160015030c6ec3fc1d96afd225518bcf8b9936b63c063f6b4e80d
MD5 2c607523ef7fe661d3377cdbba6bd584
BLAKE2b-256 ffa377696f33df5786a002cc537b8e5acc1363637947ebcd80ab5a33c7d0798a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysaleryd-5.0.1rc4.tar.gz:

Publisher: ci.yml on bj00rn/pysaleryd

Attestations:

File details

Details for the file pysaleryd-5.0.1rc4-py3-none-any.whl.

File metadata

  • Download URL: pysaleryd-5.0.1rc4-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pysaleryd-5.0.1rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 246b8db684abcb52dde755182fa682e1c65c0b887abca5a0424ad28b18444cd7
MD5 b635929c71a3665ff761ed813e529bb1
BLAKE2b-256 0bbdcbc17ab31604b8eee9dbe5bc521f4b2e25bde69fcaaf7a42bf8b5c346ae1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysaleryd-5.0.1rc4-py3-none-any.whl:

Publisher: ci.yml on bj00rn/pysaleryd

Attestations:

Supported by

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