Python Calaos
Client for the Calaos v3 home automation server. This client keeps the home, rooms and items status in cache, in order to reduce the quantity of requests towards the Calaos server.
Use pycalaos.discover to discover the Calaos server IP address.
Use pycalaos.Client to connect to the Calaos server.
This library has been developed with Home Assistant in mind.
Notice
This integration is an independent project: the Calaos team is by no means involved in its development.
discover
The pycalaos.discover function broadcasts a discovery message on the network
and returns the IP address of a discovered Calaos instance, or raises
pycalaos.NoDiscoveryError.
Client
pycalaos.Client is a client that connects to a Calaos server.
Initialize it with:
from pycalaos import Client
client = Client(url, username, password)
When initializing the client, it automatically fetches the Calaos configuration
(rooms and items). In order to reload the configuration,
use client.reload_home().
The client has the following methods and properties:
reload_home(): reload the whole configuration (rooms and items)client.update_all(): checks and updates state for all known items, and returnspycalaos.item.Eventobjects for each change.client.poll()requests changes since the previous poll:- if there is no previous execution of the
pollfunction, it registers for polling and acts asupdate_all - if there is a previous execution of the
pollfunction, it requests only changes for this registration (see the Calaos developer doc for more information) and returnspycalaos.item.Eventobjects for each change since the previous poll
- if there is no previous execution of the
client.rooms: rooms as a list ofpycalaos.client.Roomclient.items: items as dictionary of item ID topycalaos.item.Itemclient.item_types: complete list of item types currently in useclient.items_by_type(type: type): returns all items of that type (see types in the 2nd columns of the mapping table)
Room
Calaos rooms are represented in pycalaos as pycalaos.client.Room objects.
Rooms have the following properties:
name: name of the roomtype: type from Calaositems: items in that room, as a list ofpycalaos.item.common.Itemobjects
Item
All Calaos IOs are represented in pycalaos as pycalaos.item.common.Item
objects, or objects that inherit from this one.
Items have the following properties:
info: item description (id, name, type) as a stringid: ID from Calaosgui_type: "gui_type" from Calaosio_type: "io_type" from Calaosname: name from Calaosstate: current item state (see the mapping section below)type: type from Calaosvar_type: "var_type" from Calaosvisible: "visible" according to Calaosroom: thepycalaos.Roomobject this item belongs to
Items also have the following functions for internal use (they should not be called directly):
internal_set_stateinternal_from_event
Event
Each state change results in a pycalaos.item.common.Event object, when calling
client.update_all() or client.poll().
Events have the following properties:
item: item the event is related to, as apycalaos.item.common.Itemobjectstate: state for this event
Calaos IOs vs pycalaos items mapping
Mapping from Calaos IOs to pycalaos items is based on the Calaos type:
| Calaos type | pycalaos object type |
|---|---|
| Generic | |
| InPlageHoraire | io.InPlageHoraire |
| InputTime | io.InputTime |
| InputTimer | io.InputTimer |
| InternalBool | io.InternalBool |
| InternalInt | io.InternalInt |
| InternalString | io.InternalString |
| Scenario | io.Scenario |
| Wago | |
| WIDigitalBP | io.InputSwitch |
| WIDigitalLong | io.InputSwitchLongPress |
| WIDigitalTriple | io.InputSwitchTriple |
| WODali | io.OutputLightDimmer |
| WODigital | io.OutputLight |
| WOVoletSmart | io.OutputShutterSmart |
| Web | |
| WebInputAnalog | io.InputAnalog |
| WebInputString | io.InputString |
| WebInputTemp | io.InputTemp |
| Fallback | |
| Any other type | common.Item |
common.Item
- state: string
- methods: none
io.InPlageHoraire
- state: boolean:
TrueorFalse - methods: none
io.InputAnalog
- state: float
- methods: none
io.InputString
- state: string
- methods: none
io.InputSwitch
- state: boolean:
TrueorFalse - methods: none
io.InputSwitchLongPress
- state:
pycalaos.item.io.InputSwitchLongPressState:NONE,SHORT,LONG - methods: none
io.InputSwitchTriple
- state:
pycalaos.item.io.InputSwitchTripleState:NONE,SINGLE,DOUBLE,TRIPLE - methods: none
io.InputTemp
- state: float
- methods: none
io.InputTime
- state: boolean:
TrueorFalse - methods: none
io.InputTimer
- state: boolean:
TrueorFalse - methods:
start(): Start the timerstop(): Stop the timerreset(hours, minutes, seconds, milliseconds): Reset the configured time to a value
io.InternalBool
- state: boolean:
TrueorFalse - methods:
true(): Set a value to truefalse(): Set a value to falsetoggle(): Invert boolean valueimpulse(*pattern): Do an impulse on boolean value with a pattern. Arguments may be durations (in ms) or "old" to reset to the previous state after the impulse
io.InternalInt
- state: integer
- methods:
set(value): Set a specific integer valueinc(): Increment value with configured stepdec(): Decrement value with configured stepinc(value): Increment value by valuedec(value): Decrement value by value
io.InternalString
- state: string
- methods:
set(value): Set a specific string value
io.OutputLight
- state: boolean:
TrueorFalse - methods:
true(): Switch the light onfalse(): Switch the light offtoggle(): Invert light stateimpulse(*pattern): Do an impulse on light state with a pattern. Arguments may be durations (in ms) or "old" to reset to the previous state after the impulse
io.OutputLightDimmer
- state: integer between 0 and 100
- methods:
true(): Switch the light onfalse(): Switch the light offtoggle(): Invert light stateimpulse(*pattern): Do an impulse on light state with a pattern. Arguments may be durations (in ms) or "old" to reset to the previous state after the impulseset_off(value): Set light value without switching on. This will be the light intensity for the next ONset(value): Set light intensity and swith on if light is offup(value): Increase intensity by X percentdown(value): Decrease intensity by X percenthold_press(): Dynamically change light intensity when holding a switch (press action)hold_stop(): Dynamically change light intensity when holding a switch (stop action)
io.OutputShutterSmart
- state: dictionary, with two elements:
action:pycalaos.item.io.OutputShutterAction:STATIONARY,UP,DOWN,STOP,CALIBRATIONposition: integer between 0 and 100
- methods:
up(): Open the shutterdown(): Close the shutterstop(): Stop the shuttertoggle(): Invert shutter stateimpulse_up(duration): Open shutter for X msimpulse_down(duration): Close shutter for X msset(value): Set shutter at position X in percentup(value): Open the shutter by X percentdown(value): Close the shutter by X percentcalibrate(): Start calibration on shutter. This opens fully the shutter and resets all internal position values. Use this if shutter sync is lost.
io.Scenario
- state: boolean:
TrueorFalse - methods:
true(): Start the scenariofalse(): Stop the scenario (only for special looping scenarios)
Metadata
Release files for pycalaos 0.0.29
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycalaos-0.0.29.tar.gz | 9.3 kB | Without provenance | Details for pycalaos-0.0.29.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycalaos-0.0.29-py3-none-any.whl | Python 3 | none | any | Details for pycalaos-0.0.29-py3-none-any.whl |
Total release size: 19.9 kB
Release files / pycalaos-0.0.29.tar.gz
| Download URL | pycalaos-0.0.29.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2efa602dfce8950f232bff6748fd38b58944368aa99ce0e0e068e3988070f72
|
|
BLAKE2b-256 checksum How to use checksums |
3aa26dfa9c614a7542cf5a3463013a4b1d1623a45ebd128045a0ef9b43ffa856
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / pycalaos-0.0.29-py3-none-any.whl
| Download URL | pycalaos-0.0.29-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7433a8d10762679a553a1006f7f3367525139de3e7cd673e97d7e99356c4c180
|
|
BLAKE2b-256 checksum How to use checksums |
5c4c90a7a00826dff9e70a5822a5ee3290cb9e4fb0a5805e15afb24cb38c1aa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for pycalaos 0.0.29
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.