Skip to content

Cloud API

CloudApi wraps every cloud endpoint used by the app; CloudClient handles the HTTP session underneath. See the Cloud API protocol notes for the wire format.

api

Typed wrappers around every cloud endpoint used by the Daisy app.

JsonDict module-attribute

JsonDict = dict[str, Any]

CloudApi

CloudApi(client: CloudClient)

High-level access to the Teleco cloud endpoints.

client instance-attribute

client = client

change_password async

change_password(old: str, new: str) -> None

reset_password async

reset_password(email: str) -> None

register async

register(
    email: str,
    password: str,
    *,
    firstname: str,
    lastname: str,
    advertising: bool = False,
    app: str = "DAISY",
) -> Any

Create an account (account-registration); the e-mail must then be confirmed.

app is the brand app's id (its build flavor in upper case: DAISY, BIOSSUN, GIBUS...).

installations async

installations() -> list[Installation]

node_active async

node_active(installation: Installation) -> bool

Is the box online for the cloud (tmate20/nodestatus).

pair_installation async

pair_installation(
    inst_code: str,
    description: str,
    *,
    order: int = 0,
    active_timer: bool = True,
    workdays: str = "",
    firmware_version: str = "",
) -> Any

Add a box to the account by its code (account-installation-pair).

unpair_installation async

unpair_installation(installation: Installation) -> Any

Remove the box from the account (account-installation-unpair).

rename_installation async

rename_installation(
    installation: Installation, description: str
) -> None

rooms async

rooms(
    installation: Installation, *, full: bool = True
) -> list[Room]

Rooms and devices. full also returns each device's commands and timers.

save_room async

save_room(installation: Installation, room: Room) -> Room

room-setup: re-posts the whole room with all of its devices.

delete_room async

delete_room(
    installation: Installation, id_room: int
) -> None

device_commands async

device_commands(
    installation: Installation, id_installation_device: int
) -> list[Command]

command-device-list: the commands of one device.

scenario_commands async

scenario_commands(
    installation: Installation, id_scenario: int
) -> list[Command]

command-scenario-list: the commands of one scenario.

device_status async

device_status(
    installation: Installation, id_installation_device: int
) -> list[StatusItem]

scenarios async

scenarios(installation: Installation) -> list[Scenario]

save_scenario async

save_scenario(
    installation: Installation,
    *,
    description: str,
    steps: list[ScenarioStep],
    id_installation_scenario: int = 0,
    icon: int = 0,
    order: int = 0,
    id_installation_room: int = 0,
) -> Scenario

Create (id 0) or update a scenario.

delete_scenario async

delete_scenario(
    installation: Installation, id_scenario: int
) -> None

timers async

timers(
    installation: Installation, id_installation_device: int
) -> list[Timer]

save_timers async

save_timers(
    installation: Installation,
    id_installation_device: int,
    timers: list[Timer],
) -> list[Timer]

Replace the device's full timer list (a timer left out is deleted).

feed_commands async

feed_commands(
    installation: Installation,
    commands: list[WireCommand],
    *,
    scenario_id: int = 0,
    is_scenario: bool | None = None,
) -> TmateResponse

get_ack async

get_ack(
    installation: Installation, action_reference: str
) -> TmateResponse

send_and_wait async

send_and_wait(
    installation: Installation,
    commands: list[WireCommand],
    *,
    scenario_id: int = 0,
    is_scenario: bool | None = None,
    ack_timeout: float = 15.0,
    until: tuple[str, ...] = (ACK_PROCESSED, ACK_ACCEPTED),
) -> TmateResponse

Send commands and poll getackcommand until the box confirms.

Device screens stop on PROC; timer/schedule flows wait for ACK.

client

Low-level HTTP client for the Teleco "tmate" cloud.

Every endpoint is a JSON POST protected by a static basic auth. The user session (idSession + idAccount) travels inside the JSON body. Two response formats exist:

  • the standard envelope {codEsito, msgEsito, valRisultato};
  • the tmate20/* format {MessageType, MessageID, MessageText, ActionReference} (nodestatus returns a bare object).

JsonDict module-attribute

JsonDict = dict[str, Any]

SessionFields

Bases: Enum

Which session fields a request body carries.

NONE class-attribute instance-attribute

NONE = 'none'

SESSION class-attribute instance-attribute

SESSION = 'session'

ACCOUNT class-attribute instance-attribute

ACCOUNT = 'account'

CloudSession dataclass

CloudSession(id_session: str, id_account: int)

id_session instance-attribute

id_session: str

id_account instance-attribute

id_account: int

TmateResponse dataclass

TmateResponse(
    message_type: str | None,
    message_id: str | None,
    message_text: str | None,
    action_reference: str | None,
)

Response of feedthecommands / getackcommand.

message_type instance-attribute

message_type: str | None

message_id instance-attribute

message_id: str | None

message_text instance-attribute

message_text: str | None

action_reference instance-attribute

action_reference: str | None

ok property

ok: bool

from_json classmethod

from_json(data: JsonDict) -> TmateResponse

CloudClient

CloudClient(
    http: ClientSession,
    email: str,
    password: str,
    *,
    base_url: str = BASE_URL,
    device_serial: str = DEFAULT_DEVICE_SERIAL,
    device_description: str = DEFAULT_DEVICE_DESCRIPTION,
    request_timeout: float = 15.0,
    auto_relogin: bool = True,
)

Authenticated access to the Teleco cloud.

The aiohttp.ClientSession is injected (Home Assistant provides its own) and is never closed by this class.

session instance-attribute

session: CloudSession | None = None

id_account property

id_account: int

login async

login() -> CloudSession

Open a new cloud session (account-login).

logout async

logout() -> None

ensure_session async

ensure_session() -> CloudSession

call async

call(
    endpoint: Endpoint | str,
    body: JsonDict,
    *,
    fields: SessionFields = ACCOUNT,
) -> Any

POST to a standard-envelope endpoint and return valRisultato.

Session fields are injected; an invalid session triggers one re-login.

call_raw async

call_raw(
    endpoint: Endpoint | str,
    body: JsonDict,
    *,
    fields: SessionFields = ACCOUNT,
) -> JsonDict

POST and return the raw JSON object, handling session expiry.

call_tmate async

call_tmate(
    endpoint: Endpoint | str, body: JsonDict
) -> TmateResponse

POST to a tmate20/* command endpoint.