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. CardinalWindDirection is the one decoded so far:

    from aiohortos import decode_cardinal_wind_direction
    
    decode_cardinal_wind_direction(8783)  # 247.5, i.e. WSW
    decode_cardinal_wind_direction(1234)  # None — not a member of the table
    

    The 16 compass points occupy contiguous ids 8772–8787 on a HortiMaX controller, clockwise in 22.5° steps, confirmed over a day of history and cross-checked against the official app. Anything outside that block, or not a whole number, decodes to None rather than to a plausible bearing.

  • 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.3.0.tar.gz (66.0 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.3.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiohortos-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ddd00c3217a9ff5d76290513c93026b09781e316b967c3598e94c55224882806
MD5 32030eb81c109a3ab948405b3c2a4427
BLAKE2b-256 598d8ea8c51f54ac6b22b5d52d4b8e0733de0fd0b4ee5e59ca178cb40af84194

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohortos-0.3.0.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: aiohortos-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8a99ef7522541ce6088c429d821a56e84a3821b2f57612738e8a97eaf8e2049
MD5 9c823b0ef1a90ef4cd3ea0db6201271a
BLAKE2b-256 5a3d48c61fe56f4a8acb65bc37ede6420a64fc1713ba34823b47779f19cadf74

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohortos-0.3.0-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