Package: pycalaos
Python CalaosClient 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.Usepycalaos.discoverto discover the Calaos server IP address.Usepycalaos.Clientto connect to the Calaos server.This library has been developed withHome Assistantin mind.NoticeThis integration is an independent project: the Calaos team is by no means
involved in its development.discoverThepycalaos.discoverfunction broadcasts a discovery message on the network
and returns the IP address of a discovered Calaos instance, or raisespycalaos.NoDiscoveryError.Clientpycalaos.Clientis a client that connects to a Calaos server.
Initialize it with:frompycalaosimportClientclient=Client(url,username,password)When initializing the client, it automatically fetches the Calaos configuration
(rooms and items). In order to reload the configuration,
useclient.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 thepollfunction, it registers
for polling and acts asupdate_allif there is a previous execution of thepollfunction, it requests only
changes for this registration (see theCalaos developer docfor more information) and returnspycalaos.item.Eventobjects for each
change since the previous pollclient.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)RoomCalaos rooms are represented in pycalaos aspycalaos.client.Roomobjects.Rooms have the following properties:name: name of the roomtype: type from Calaositems: items in that room, as a list ofpycalaos.item.common.ItemobjectsItemAll Calaos IOs are represented in pycalaos aspycalaos.item.common.Itemobjects, 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 toItems also have the following functions for internal use
(they should not be called directly):internal_set_stateinternal_from_eventEventEach state change results in apycalaos.item.common.Eventobject, when callingclient.update_all()orclient.poll().Events have the following properties:item: item the event is related to, as apycalaos.item.common.Itemobjectstate: state for this eventCalaos IOs vs pycalaos items mappingMapping from Calaos IOs to pycalaos items is based on the Calaos type:Calaos typepycalaos object typeGenericInPlageHoraireio.InPlageHoraireInputTimeio.InputTimeInputTimerio.InputTimerInternalBoolio.InternalBoolInternalIntio.InternalIntInternalStringio.InternalStringScenarioio.ScenarioWagoWIDigitalBPio.InputSwitchWIDigitalLongio.InputSwitchLongPressWIDigitalTripleio.InputSwitchTripleWODaliio.OutputLightDimmerWODigitalio.OutputLightWOVoletSmartio.OutputShutterSmartWebWebInputAnalogio.InputAnalogWebInputStringio.InputStringWebInputTempio.InputTempFallbackAny other typecommon.Itemcommon.Itemstate: stringmethods: noneio.InPlageHorairestate: boolean:TrueorFalsemethods: noneio.InputAnalogstate: floatmethods: noneio.InputStringstate: stringmethods: noneio.InputSwitchstate: boolean:TrueorFalsemethods: noneio.InputSwitchLongPressstate:pycalaos.item.io.InputSwitchLongPressState:NONE,SHORT,LONGmethods: noneio.InputSwitchTriplestate:pycalaos.item.io.InputSwitchTripleState:NONE,SINGLE,DOUBLE,TRIPLEmethods: noneio.InputTempstate: floatmethods: noneio.InputTimestate: boolean:TrueorFalsemethods: noneio.InputTimerstate: boolean:TrueorFalsemethods:start(): Start the timerstop(): Stop the timerreset(hours, minutes, seconds, milliseconds): Reset the configured time to
a valueio.InternalBoolstate: boolean:TrueorFalsemethods: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 impulseio.InternalIntstate: integermethods: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 valueio.InternalStringstate: stringmethods:set(value): Set a specific string valueio.OutputLightstate: boolean:TrueorFalsemethods: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
impulseio.OutputLightDimmerstate: integer between 0 and 100methods: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.OutputShutterSmartstate: dictionary, with two elements:action:pycalaos.item.io.OutputShutterAction:STATIONARY,UP,DOWN,STOP,CALIBRATIONposition: integer between 0 and 100methods: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.Scenariostate: boolean:TrueorFalsemethods:true(): Start the scenariofalse(): Stop the scenario (only for special looping scenarios)