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 def work():
    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)

loop = asyncio.new_event_loop()
loop.run_until_complete(work())

Read data using callback

import asyncio
import aiohttp

from pysaleryd.client import Client

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

async def work():
    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

loop = asyncio.new_event_loop()
loop.run_until_complete(work())

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 def work():
    async with aiohttp.ClientSession() as session:
        async with Client(WEBSOCKET_URL, WEBSOCKET_PORT, session) as hrv_client:
            await hrv_client.send_command("MF", 1)

loop = asyncio.new_event_loop()
loop.run_until_complete(work())

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-6.1.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

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

pysaleryd-6.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pysaleryd-6.1.0.tar.gz.

File metadata

  • Download URL: pysaleryd-6.1.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysaleryd-6.1.0.tar.gz
Algorithm Hash digest
SHA256 c99703bd9ad25718e1aed0f87bdb50b042e077f7602379b01d44b39d20d9ee57
MD5 8d640a9c7c4e5cf6d477bab559981324
BLAKE2b-256 f64bced172b2131575e9696883cfd04575f65a13ec6b26c39fab53db121f7c84

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on bj00rn/pysaleryd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysaleryd-6.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysaleryd-6.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysaleryd-6.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16100da7e1039f2a02dbc6d104a59c66ac3a46f3d4b2c1927f2cad76bc625656
MD5 b346e9b889c69cd994b6140974ca83ad
BLAKE2b-256 8af4a35e7afcbe7c51e0f5cd8f08f1ac8b2cf58745aa3d815b3c7fedb3344c04

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on bj00rn/pysaleryd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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