Skip to main content

Async client for the Ridder HortOS Automation API (HortiMaX greenhouse controllers)

Project description

aiohortos

Async Python client for the Ridder HortOS Automation API, the cloud API behind HortiMaX greenhouse process controllers.

This is a community-built library. It is not an official Ridder product, it is not certified by Ridder, and Ridder does not support it. Ridder's support covers the HortOS Automation API itself; anything about this library belongs on its issue tracker.

The API is still evolving and Ridder does not guarantee backward compatibility for community integrations, so a future API change can alter or remove what this library returns. Pin a version.

The library is read-only: it authenticates with an API key and reads controllers, their health, and their readouts. It never writes setpoints.

pip install aiohortos

Usage

import asyncio

from aiohortos import HortosClient


async def main() -> None:
    async with HortosClient("your-api-key") as client:
        for device in await client.get_devices():
            print(device.name, device.label)
            for readout in await client.get_latest_readouts(device.name):
                print(
                    f"  {readout.source.display_name}: "
                    f"{readout.identifier} = {readout.value} {readout.unit or ''}"
                )


asyncio.run(main())

Pass an existing session to share a connection pool — which is what you want inside an application that already has one:

async with aiohttp.ClientSession() as session:
    client = HortosClient("your-api-key", session=session)

The client also accepts a base_url, for on-premise HortOS installations that serve the same API from your own network.

API surface

Method Returns
authenticate() TokenPair — normally not needed; every call authenticates on demand
get_device_names() list[str] of controller identifiers
get_devices() list[Device] with the friendly label
get_devices_health() list[DeviceHealth] — online state, sync state
get_readout_definitions(device) list[ReadoutDefinition]
get_latest_readouts(device) list[Readout] with the newest value each
get_readout_history(...) list[ReadoutValue] over a window of ≤ 24 hours

Errors all derive from HortosError:

  • HortosAuthenticationError — the API key or token was rejected (HTTP 401/403)
  • HortosConnectionError — the API could not be reached, or timed out
  • HortosResponseError — an unexpected status or payload, with .status

Notes on the API

  • Tokens live 15 minutes and are renewed with a refresh token valid 7 days. The client handles both, and re-authenticates when a token is rejected.
  • The API allows 100 requests per 15 seconds per key. The library does not throttle; pace your own polling.
  • Unchanged readouts are refreshed at most every 5 minutes, so polling faster than that gains nothing.
  • Readout identifiers follow <CamelCaseSubject>-<Kind>, e.g. VentPositionLeewardSide-Measured. One upstream typo exists in the wild: IrrigationVolume-Measuered.
  • Some readouts have unitIdentifier: "Scalar" and a numeric value that is really an enumeration member id from a table the API does not expose. They are returned as-is; decoding them is the caller's problem.
  • Readout.name embeds the source's user-defined name and is a poor label on its own — build names from identifier and source instead.

Ridder's Swagger UI documents the API at https://hortos.ridder.com/api/process-control/index.html. The OpenAPI document lives at {base_url}/v1/swagger.json and needs a bearer token.

Development

uv venv && uv pip install -e . --group dev
pytest
ruff check . && ruff format --check . && mypy src

Disclaimer

This library is not affiliated with, endorsed by, or certified by Ridder, and carries no warranty. "Ridder", "HortOS" and "HortiMaX" are used only to name the API and the products this library talks to; they are trademarks of their respective owner.

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

aiohortos-0.1.1.tar.gz (62.3 kB view details)

Uploaded Source

Built Distribution

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

aiohortos-0.1.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file aiohortos-0.1.1.tar.gz.

File metadata

  • Download URL: aiohortos-0.1.1.tar.gz
  • Upload date:
  • Size: 62.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for aiohortos-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c756c0dbe67a41cffa63d82ad6b9ee91044b0c6cede8a5d6cf4c6e08f26c63cf
MD5 e93c693bd844931af7ef3755f40426a2
BLAKE2b-256 c9ff3c9e1fa39950e311c67815cd397bb13595381f90bf11dcb09f8b478e7d79

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohortos-0.1.1.tar.gz:

Publisher: release.yml on wildekek/aiohortos

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

File details

Details for the file aiohortos-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for aiohortos-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa3cc8e1e6fcacfb44fa380012de1d225cd25ccb1fa5ae9dfa9fd7ee46379e23
MD5 d2d2177f5c044fd33f7841379bbd1176
BLAKE2b-256 55cd14dc9a4de4e94cd4f9bdddc7f2da7fa8af5962d30f5a149ff15b99668e03

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohortos-0.1.1-py3-none-any.whl:

Publisher: release.yml on wildekek/aiohortos

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