powersync-docs/docs/api/metier/integrations.md
Patrick Schurig b26274595c
Some checks failed
Build & Deploy docs / build-deploy (push) Failing after 10m17s
feat: référence API JsonRPC générée depuis introspect.json
- Nouveau générateur scripts/gen_api_reference.py : 19 namespaces →
  docs/api/metier/ (10) + docs/api/systeme/ (9) + notifications.md +
  types.md (96 types · 55 enums · 4 flags) + SUMMARY.md literate-nav
- Badges permissionScope (perm-none/control/configure/admin) dans extra.css
- Guide docs/integrations/jsonrpc-api.md (connexion TCP/WS, auth, conventions énergie)
- mkdocs.yml : Référence API dans la nav, REST→JsonRPC renommé
- mkdocs build --strict : 0 warnings · --check idempotent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 08:15:37 +02:00

20 KiB

Integrations

Méthodes

Integrations.AddThing

CONFIGURE

Add a new thing to the system. Only things with a setupMethod of SetupMethodJustAdd can be added this way. For things with a setupMethod different than SetupMethodJustAdd, use PairThing. Things with CreateMethodJustAdd require all parameters to be supplied here. Things with CreateMethodDiscovery require the use of a thingDescriptorId. For discovered things, params are not required and will be taken from the ThingDescriptor, however, they may be overridden by supplying thingParams.

Paramètres :

Champ Type Notes
name String
thingClassId Uuid optionnel
thingDescriptorId Uuid optionnel
thingParams ParamList optionnel

Retour :

Champ Type Notes
displayMessage String optionnel
thingId Uuid optionnel
thingError ThingError

Integrations.BrowseThing

PUBLIC

Browse a thing. If a ThingClass indicates a thing is browsable, this method will return the BrowserItems. If no parameter besides the thingId is used, the root node of this thingwill be returned. Any returned item which is browsable can be passed as node. Results will be children of the given node. In case of an error during browsing, the error will be indicated and the displayMessage may contain additional information for the user. The displayMessage will be translated. A client UI showing this message to the user should be prepared for empty, but also longer strings.

Paramètres :

Champ Type Notes
itemId String optionnel
thingId Uuid

Retour :

Champ Type Notes
displayMessage String optionnel
items BrowserItem[] optionnel
thingError ThingError

Integrations.ConfirmPairing

CONFIGURE

Confirm an ongoing pairing. For SetupMethodUserAndPassword, provide the username in the "username" field and the password in the "secret" field. For SetupMethodEnterPin and provide the PIN in the "secret" field. In case of SetupMethodOAuth, the previously opened web view will eventually be redirected to http://128.0.0.1:8888 and the OAuth code as query parameters to this url. Provide the entire unmodified URL in the secret field.

Paramètres :

Champ Type Notes
secret String optionnel
username String optionnel
pairingTransactionId Uuid

Retour :

Champ Type Notes
displayMessage String optionnel
thingId Uuid optionnel
thingError ThingError

Integrations.ConnectIO

CONFIGURE

Connect two generic IO states. Input and output need to be compatible, that is, either a digital input and a digital output, or an analog input and an analog output. If successful, the connectionId will be returned.

Paramètres :

Champ Type Notes
inputStateTypeId Uuid
inputThingId Uuid
inverted Bool optionnel
outputStateTypeId Uuid
outputThingId Uuid

Retour :

Champ Type Notes
ioConnectionId Uuid optionnel
thingError ThingError

Integrations.DisconnectIO

CONFIGURE

Disconnect an existing IO connection.

Paramètres :

Champ Type Notes
ioConnectionId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.DiscoverThings

CONFIGURE

Performs a thing discovery for things of the given thingClassId and returns the results. This function may take a while to return. Note that this method will include all the found things, that is, including things that may already have been added. Those things will have thingId set to the id of the already added thing. Such results may be used to reconfigure existing things and might be filtered in cases where only unknown things are of interest.

Paramètres :

Champ Type Notes
discoveryParams ParamList optionnel
thingClassId Uuid

Retour :

Champ Type Notes
displayMessage String optionnel
thingDescriptors ThingDescriptors optionnel
thingError ThingError

Integrations.EditThing

CONFIGURE

Edit the name of a thing.

Paramètres :

Champ Type Notes
name String
thingId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.ExecuteAction

CONTROL

Execute a single action.

Paramètres :

Champ Type Notes
actionTypeId Uuid
params ParamList optionnel
thingId Uuid

Retour :

Champ Type Notes
displayMessage String optionnel
thingError ThingError

Integrations.ExecuteBrowserItem

CONTROL

Execute the item identified by itemId on the given thing. In case of an error during execution, the error will be indicated and the displayMessage may contain additional information for the user. The displayMessage will be translated. A client UI showing this message to the user should be prepared for empty, but also longer strings.

Paramètres :

Champ Type Notes
itemId String
thingId Uuid

Retour :

Champ Type Notes
displayMessage String optionnel
thingError ThingError

Integrations.ExecuteBrowserItemAction

CONTROL

Execute the action for the browser item identified by actionTypeId and the itemId on the given thing. In case of an error during execution, the error will be indicated and the displayMessage may contain additional information for the user. The displayMessage will be translated. A client UI showing this message to the user should be prepared for empty, but also longer strings.

Paramètres :

Champ Type Notes
actionTypeId Uuid
itemId String
params ParamList optionnel
thingId Uuid

Retour :

Champ Type Notes
displayMessage String optionnel
thingError ThingError

Integrations.GetActionTypes

PUBLIC

Get action types for a specified thingClassId.

Paramètres :

Champ Type Notes
thingClassId Uuid

Retour :

Champ Type Notes
actionTypes ActionTypes

Integrations.GetBrowserItem

PUBLIC

Get a single item from the browser. This won't give any more info on an item than a regular BrowseThing call, but it allows to fetch details of an item if only the ID is known. In case of an error during browsing, the error will be indicated and the displayMessage may contain additional information for the user. The displayMessage will be translated. A client UI showing this message to the user should be prepared for empty, but also longer strings.

Paramètres :

Champ Type Notes
itemId String optionnel
thingId Uuid

Retour :

Champ Type Notes
displayMessage String optionnel
item BrowserItem optionnel
thingError ThingError

Integrations.GetEventTypes

PUBLIC

Get event types for a specified thingClassId.

Paramètres :

Champ Type Notes
thingClassId Uuid

Retour :

Champ Type Notes
eventTypes EventTypes

Integrations.GetIOConnections

PUBLIC

Fetch IO connections. Optionally filtered by thingId and stateTypeId.

Paramètres :

Champ Type Notes
thingId Uuid optionnel

Retour :

Champ Type Notes
ioConnections IOConnections optionnel
thingError ThingError

Integrations.GetPluginConfiguration

CONFIGURE

Get a plugin's params.

Paramètres :

Champ Type Notes
pluginId Uuid

Retour :

Champ Type Notes
configuration ParamList optionnel
thingError ThingError

Integrations.GetPlugins

PUBLIC

Returns a list of loaded plugins.

Paramètres :

Aucun paramètre.

Retour :

Champ Type Notes
plugins IntegrationPlugins

Integrations.GetStateTypes

PUBLIC

Get state types for a specified thingClassId.

Paramètres :

Champ Type Notes
thingClassId Uuid

Retour :

Champ Type Notes
stateTypes StateTypes

Integrations.GetStateValue

PUBLIC

Get the value of the given thing and the given stateType

Paramètres :

Champ Type Notes
stateTypeId Uuid
thingId Uuid

Retour :

Champ Type Notes
value Variant optionnel
thingError ThingError

Integrations.GetStateValues

PUBLIC

Get all the state values of the given thing.

Paramètres :

Champ Type Notes
thingId Uuid

Retour :

Champ Type Notes
values States optionnel
thingError ThingError

Integrations.GetThingClasses

PUBLIC

Returns a list of supported thing classes, optionally filtered by vendorId or by a list of thing class ids.

Paramètres :

Champ Type Notes
thingClassIds Uuid[] optionnel
vendorId Uuid optionnel

Retour :

Champ Type Notes
thingClasses ThingClasses optionnel
thingError ThingError

Integrations.GetThings

PUBLIC

Returns a list of configured things, optionally filtered by thingId.

Paramètres :

Champ Type Notes
thingId Uuid optionnel

Retour :

Champ Type Notes
things Things optionnel
thingError ThingError

Integrations.GetVendors

PUBLIC

Returns a list of supported Vendors.

Paramètres :

Aucun paramètre.

Retour :

Champ Type Notes
vendors Vendors

Integrations.PairThing

CONFIGURE

Pair a new thing. Use this to set up or reconfigure things for ThingClasses with a setupMethod different than SetupMethodJustAdd. Depending on the CreateMethod and whether a new thing is set up or an existing one is reconfigured, different parameters are required: CreateMethodJustAdd takes the thingClassId and the parameters you want to have with that thing. If an existing thing should be reconfigured, the thingId of said thing should be given additionally. CreateMethodDiscovery requires the use of a thingDescriptorId, previously obtained with DiscoverThings. Optionally, parameters can be overridden with the give thingParams. ThingDescriptors containing a thingId will reconfigure an existing thing, descriptors without a thingId will add a new thing to the system. If success is true, the return values will contain a pairingTransactionId, a displayMessage and the setupMethod. Depending on the setupMethod, the application should present the use an appropriate login mask, that is, For SetupMethodDisplayPin the user should enter a pin that is displayed on the device or online service, for SetupMethodEnterPin the application should present the given PIN so the user can enter it on the device or online service. For SetupMethodPushButton, the displayMessage shall be presented to the user as informational hints to press a button on the device. For SetupMethodUserAndPassword a login mask for a user and password login should be presented to the user. In case of SetupMethodOAuth, an OAuth URL will be returned which shall be opened in a web view to allow the user logging in. Once the login procedure has completed, the application shall proceed with ConfirmPairing, providing the results of the pairing procedure.

Paramètres :

Champ Type Notes
name String optionnel
thingClassId Uuid optionnel
thingDescriptorId Uuid optionnel
thingId Uuid optionnel
thingParams ParamList optionnel

Retour :

Champ Type Notes
displayMessage String optionnel
oAuthUrl String optionnel
pairingTransactionId Uuid optionnel
pin String optionnel
setupMethod SetupMethod optionnel
thingError ThingError

Integrations.ReconfigureThing

CONFIGURE

Reconfigure a thing. This comes down to removing and recreating a thing with new parameters but keeping its thing id the same (and with that keeping rules, tags etc). For things with create method CreateMethodDiscovery, a discovery (DiscoverThings) shall be performed first and this method is to be called with a thingDescriptorId of the re-discovered thing instead of the thingId directly. Thing parameters will be taken from the discovery, but can be overridden individually here by providing them in the thingParams parameter. Only writable parameters can be changed.

Paramètres :

Champ Type Notes
thingDescriptorId Uuid optionnel
thingId Uuid optionnel
thingParams ParamList optionnel

Retour :

Champ Type Notes
displayMessage String optionnel
thingError ThingError

Integrations.RemoveThing

CONFIGURE

Remove a thing and all its childs from the system. RemovePolicy is deprecated and has no effect any more.

Paramètres :

Champ Type Notes
d:o:removePolicy String
thingId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.SetActionLogging

CONFIGURE

Enable/disable logging for the given action type on the given thing.

Paramètres :

Champ Type Notes
actionTypeId Uuid
enabled Bool
thingId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.SetEventLogging

CONFIGURE

Enable/disable logging for the given event type on the given thing.

Paramètres :

Champ Type Notes
enabled Bool
eventTypeId Uuid
thingId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.SetPluginConfiguration

CONFIGURE

Set a plugin's params.

Paramètres :

Champ Type Notes
configuration ParamList
pluginId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.SetStateFilter

CONFIGURE

Set the filter for the given state on the given thing.

Paramètres :

Champ Type Notes
filter StateValueFilter
stateTypeId Uuid
thingId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.SetStateLogging

CONFIGURE

Enable/disable logging for the given state type on the given thing.

Paramètres :

Champ Type Notes
enabled Bool
stateTypeId Uuid
thingId Uuid

Retour :

Champ Type Notes
thingError ThingError

Integrations.SetThingSettings

CONFIGURE

Change the settings of a thing.

Paramètres :

Champ Type Notes
settings ParamList
thingId Uuid

Retour :

Champ Type Notes
thingError ThingError

Notifications

Integrations.EventTriggered

Emitted whenever an Event is triggered.

Paramètres :

Champ Type Notes
event Event

Integrations.IOConnectionAdded

Emitted whenever an IO connection has been added.

Paramètres :

Champ Type Notes
ioConnection IOConnection

Integrations.IOConnectionRemoved

Emitted whenever an IO connection has been removed.

Paramètres :

Champ Type Notes
ioConnectionId Uuid

Integrations.PluginConfigurationChanged

Emitted whenever a plugin's configuration is changed.

Paramètres :

Champ Type Notes
configuration ParamList
pluginId Uuid

Integrations.StateChanged

Emitted whenever a state of a thing changes.

Paramètres :

Champ Type Notes
maxValue Variant
minValue Variant
possibleValues Variant[]
stateTypeId Uuid
thingId Uuid
value Variant

Integrations.ThingAdded

Emitted whenever a thing was added.

Paramètres :

Champ Type Notes
thing Thing

Integrations.ThingChanged

Emitted whenever the params or name of a thing are changed (by EditThing or ReconfigureThing).

Paramètres :

Champ Type Notes
thing Thing

Integrations.ThingRemoved

Emitted whenever a thing was removed.

Paramètres :

Champ Type Notes
thingId Uuid

Integrations.ThingSettingChanged

Emitted whenever the setting of a thing is changed.

Paramètres :

Champ Type Notes
paramTypeId Uuid
thingId Uuid
value Variant