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.2.0.tar.gz (63.8 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.2.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiohortos-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5152a4fe9a1ed6fd116deaf965c9999ef3860f5c3b516888664580261bed2dd1
MD5 82259fed98d8f81ce950917d575331fa
BLAKE2b-256 057b2b7cb809d1fb14a730da9e708f8c08820968bb0f2f311cba5fc2c9897893

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: aiohortos-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 988b4aaa8d4d0f85b576c21f613bb52551a01210cc66e9a5caa9c21a3a341527
MD5 d41705a86f1175af160ba0fcdc7b6220
BLAKE2b-256 29aef4779a138ca0b169d95090bb7e6b2e82fb66b16e9049d351cfc57e155d71

See more details on using hashes here.

Provenance

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