feat: référence API JsonRPC générée depuis introspect.json
Some checks failed
Build & Deploy docs / build-deploy (push) Failing after 10m17s

- 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>
This commit is contained in:
Patrick Schurig 2026-06-04 08:15:37 +02:00
parent f3b254c5af
commit b26274595c
32 changed files with 12939 additions and 9 deletions

24
docs/api/SUMMARY.md Normal file
View File

@ -0,0 +1,24 @@
* [Référence API](index.md)
* API — Métier
* [JSONRPC](metier/jsonrpc.md)
* [Energy](metier/energy.md)
* [Integrations](metier/integrations.md)
* [AirConditioning](metier/airconditioning.md)
* [EvDash](metier/evdash.md)
* [Rules](metier/rules.md)
* [Scripts](metier/scripts.md)
* [Tags](metier/tags.md)
* [Logging](metier/logging.md)
* [AppData](metier/appdata.md)
* API — Système
* [Configuration](systeme/configuration.md)
* [System](systeme/system.md)
* [Users](systeme/users.md)
* [NetworkManager](systeme/networkmanager.md)
* [ModbusRtu](systeme/modbusrtu.md)
* [Debug](systeme/debug.md)
* [Transfers](systeme/transfers.md)
* [ZWave](systeme/zwave.md)
* [Zigbee](systeme/zigbee.md)
* [Notifications](notifications.md)
* [Types & Enums](types.md)

42
docs/api/index.md Normal file
View File

@ -0,0 +1,42 @@
---
hide:
- toc
---
# Référence API JsonRPC
ETM PowerSync expose l'**API JSON-RPC de nymea** en local, y compris les extensions ETM
(`Energy`, `AirConditioning`, `EvDash`).
## Connexion
| Mode | Adresse | Notes |
| --- | --- | --- |
| **TCP brut** | `<ip>:2222` | nymea parle en premier (welcome JSON `\n`-delimited) |
| **WebSocket** | `ws://<ip>:4444` | le client envoie `JSONRPC.Hello` en premier |
## Authentification
1. Appeler [`JSONRPC.Authenticate`](metier/jsonrpc.md#jsonrpcauthenticate) avec
`username`, `password` et `deviceName` → reçoit un `token`.
2. Inclure le `token` dans chaque requête suivante.
3. Activer les push : `JSONRPC.SetNotificationStatus` `{ "enabled": true }`.
## Conventions énergie
| Grandeur | Convention |
| --- | --- |
| Production PV | **valeur négative** (convention producteur) |
| `currentPowerAcquisition` | réseau — positif = import, 0 si export |
| `currentPowerStorage` | batterie — positif = charge, négatif = décharge |
| Totaux d'énergie | en **kWh** |
| Timestamps | en **secondes** (Unix epoch) |
## Badges de permission
| Badge | Scope | Description |
| --- | --- | --- |
| <span class="badge perm-none">PUBLIC</span> | `PermissionScopeNone` | Lecture publique, aucun token requis |
| <span class="badge perm-control">CONTROL</span> | `PermissionScopeControlThings` / `ExecuteRules` | Contrôle des appareils et règles |
| <span class="badge perm-configure">CONFIGURE</span> | `PermissionScopeConfigureThings` / `ConfigureRules` | Configuration |
| <span class="badge perm-admin">ADMIN</span> | `PermissionScopeAdmin` | Administration système |

View File

@ -0,0 +1,222 @@
# AirConditioning
<!-- BEGIN GENERATED: __api_AirConditioning__ -->
## Méthodes
### AirConditioning.AddZone
<span class="badge perm-admin">ADMIN</span>
Create a zones.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `name` | `String` | |
| `indoorSensors` | `Uuid`[] | optionnel |
| `notifications` | `Uuid`[] | optionnel |
| `outdoorSensors` | `Uuid`[] | optionnel |
| `thermostats` | `Uuid`[] | optionnel |
| `windowSensors` | `Uuid`[] | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
| `zone` | [ZoneInfo](../types.md#zoneinfo) | optionnel |
---
### AirConditioning.GetZones
<span class="badge perm-control">CONTROL</span>
Get all Zones.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zoneId` | `Uuid` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
| `zones` | [ZoneInfos](../types.md#zoneinfos) | |
---
### AirConditioning.RemoveZone
<span class="badge perm-admin">ADMIN</span>
Remove a zone.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zoneId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
---
### AirConditioning.SetZoneName
<span class="badge perm-admin">ADMIN</span>
Set zone name.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `name` | `String` | |
| `zoneId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
---
### AirConditioning.SetZoneSetpointOverride
<span class="badge perm-control">CONTROL</span>
Set zone setpoint override temperature. Parameter minutes gives the minutes until the setpoint should return to the standby/schedule.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `mode` | [SetpointOverrideMode](../types.md#setpointoverridemode) | |
| `minutes` | `Int` | optionnel |
| `setpointOverride` | `Double` | |
| `zoneId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
---
### AirConditioning.SetZoneStandbySetpoint
<span class="badge perm-admin">ADMIN</span>
Set zone standby setpoint temperature.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `standbySetpoint` | `Double` | |
| `zoneId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
---
### AirConditioning.SetZoneThings
<span class="badge perm-admin">ADMIN</span>
Set Zone things
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `indoorSensors` | `Uuid`[] | optionnel |
| `notifications` | `Uuid`[] | optionnel |
| `outdoorSensors` | `Uuid`[] | optionnel |
| `thermostats` | `Uuid`[] | optionnel |
| `windowSensors` | `Uuid`[] | optionnel |
| `zoneId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
---
### AirConditioning.SetZoneWeekSchedule
<span class="badge perm-control">CONTROL</span>
Set the time schedule for a zone.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `weekSchedule` | [TemperatureWeekSchedule](../types.md#temperatureweekschedule) | |
| `zoneId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `airConditioningError` | [AirConditioningError](../types.md#airconditioningerror) | |
---
## Notifications
### AirConditioning.ZoneAdded
Emitted whenever a zone is added
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zone` | [ZoneInfo](../types.md#zoneinfo) | |
---
### AirConditioning.ZoneChanged
Emitted whenever a zone changes
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zone` | [ZoneInfo](../types.md#zoneinfo) | |
---
### AirConditioning.ZoneRemoved
Emitted whenever a zone is removed
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zoneId` | `Uuid` | |
---
<!-- END GENERATED -->

View File

@ -0,0 +1,69 @@
# AppData
<!-- BEGIN GENERATED: __api_AppData__ -->
## Méthodes
### AppData.Load
<span class="badge perm-control">CONTROL</span>
Retrieve an app data storage value that has previously been set with Store(). If no value had been set for this appId/key combination before, an empty value will be returned.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `appId` | `String` | |
| `key` | `String` | |
| `group` | `String` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `value` | `String` | |
---
### AppData.Store
<span class="badge perm-configure">CONFIGURE</span>
Store an app data entry to the server. App data can be used by the client application to store configuration values. The app data storage is a key-value pair storage. Each entry value is identified by an appId, a key and optionally a group. The value data is a bytearray and can contain arbitrary data, such as a JSON map or image data, however, be aware of the maximum packet size for the used transport.
This might be useful to a client application to sync settings across multiple instances of the same application.
The group parameter might be used to create groups for this application.
IMPORTANT: Currently no verification of the appId is done. The appid is merely a mechanism to prevent different different client apps from colliding by using the same key for data entries. This implies that the app data storage may not be suited for sensitive data given that anyone with a valid server token can read it.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `appId` | `String` | |
| `key` | `String` | |
| `group` | `String` | optionnel |
| `value` | `String` | |
**Retour :**
_Aucun paramètre._
---
## Notifications
### AppData.Changed
Emitted whenever the app data is changed on the server.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `appId` | `String` | |
| `key` | `String` | |
| `group` | `String` | optionnel |
| `value` | `String` | |
---
<!-- END GENERATED -->

175
docs/api/metier/energy.md Normal file
View File

@ -0,0 +1,175 @@
# Energy
<!-- BEGIN GENERATED: __api_Energy__ -->
## Méthodes
### Energy.GetPowerBalance
<span class="badge perm-none">PUBLIC</span>
Get the current power balance. That is, production, consumption and acquisition.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `currentPowerAcquisition` | `Double` | |
| `currentPowerConsumption` | `Double` | |
| `currentPowerProduction` | `Double` | |
| `currentPowerStorage` | `Double` | |
| `totalAcquisition` | `Double` | |
| `totalConsumption` | `Double` | |
| `totalProduction` | `Double` | |
| `totalReturn` | `Double` | |
---
### Energy.GetPowerBalanceLogs
<span class="badge perm-none">PUBLIC</span>
Get logs for the power balance. If from is not give, the log will start at the beginning of recording. If to is not given, the logs will and at the last sample for this sample rate before now.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `from` | `Uint` | optionnel |
| `to` | `Uint` | optionnel |
| `sampleRate` | [SampleRate](../types.md#samplerate) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `powerBalanceLogEntries` | [PowerBalanceLogEntries](../types.md#powerbalancelogentries) | |
---
### Energy.GetRootMeter
<span class="badge perm-none">PUBLIC</span>
Get the root meter ID. If there is no root meter set, the params will be empty.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `rootMeterThingId` | `Uuid` | optionnel |
---
### Energy.GetThingPowerLogs
<span class="badge perm-none">PUBLIC</span>
Get logs for one or more things power values. If thingIds is not given, logs for all energy related things will be returned. If from is not given, the log will start at the beginning of recording. If to is not given, the logs will and at the last sample for this sample rate before now. If the parameter "includeCurrent" is set to true, the result will contain the newest log entries available, regardless of the sample rate (that is, 1 minute). This may be useful to calculate the difference to the newest entry of the fetched sample rate and the current values to display the live value until the current sample is completed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `from` | `Uint` | optionnel |
| `includeCurrent` | `Bool` | optionnel |
| `thingIds` | `Uuid`[] | optionnel |
| `to` | `Uint` | optionnel |
| `sampleRate` | [SampleRate](../types.md#samplerate) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `currentEntries` | [ThingPowerLogEntries](../types.md#thingpowerlogentries) | optionnel |
| `thingPowerLogEntries` | [ThingPowerLogEntries](../types.md#thingpowerlogentries) | |
---
### Energy.SetRootMeter
<span class="badge perm-admin">ADMIN</span>
Set the root meter.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `rootMeterThingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `energyError` | [EnergyError](../types.md#energyerror) | |
---
## Notifications
### Energy.PowerBalanceChanged
Emitted whenever the energy balance changes. That is, when the current consumption, production or acquisition changes. Typically they will all change at the same time.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `currentPowerAcquisition` | `Double` | |
| `currentPowerConsumption` | `Double` | |
| `currentPowerProduction` | `Double` | |
| `currentPowerStorage` | `Double` | |
| `totalAcquisition` | `Double` | |
| `totalConsumption` | `Double` | |
| `totalProduction` | `Double` | |
| `totalReturn` | `Double` | |
---
### Energy.PowerBalanceLogEntryAdded
Emitted whenever an entry is added to the power balance log.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `powerBalanceLogEntry` | [PowerBalanceLogEntry](../types.md#powerbalancelogentry) | |
| `sampleRate` | [SampleRate](../types.md#samplerate) | |
---
### Energy.RootMeterChanged
Emitted whenever the root meter id changes. If the root meter has been unset, the params will be empty.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `rootMeterThingId` | `Uuid` | optionnel |
---
### Energy.ThingPowerLogEntryAdded
Emitted whenever an entry is added to the thing power log.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `sampleRate` | [SampleRate](../types.md#samplerate) | |
| `thingPowerLogEntry` | [ThingPowerLogEntry](../types.md#thingpowerlogentry) | |
---
<!-- END GENERATED -->

141
docs/api/metier/evdash.md Normal file
View File

@ -0,0 +1,141 @@
# EvDash
<!-- BEGIN GENERATED: __api_EvDash__ -->
## Méthodes
### EvDash.AddUser
<span class="badge perm-admin">ADMIN</span>
Add a new user with the given username and password.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `password` | `String` | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `evDashError` | [EvDashError](../types.md#evdasherror) | |
---
### EvDash.GetEnabled
<span class="badge perm-admin">ADMIN</span>
Get the enabled status of EV Dash service.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `enabled` | `Bool` | |
---
### EvDash.GetUsers
<span class="badge perm-admin">ADMIN</span>
Get the list of available users names.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `usernames` | `StringList` | |
---
### EvDash.RemoveUser
<span class="badge perm-admin">ADMIN</span>
Remove the user with the given username.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `evDashError` | [EvDashError](../types.md#evdasherror) | |
---
### EvDash.SetEnabled
<span class="badge perm-admin">ADMIN</span>
Enable/Disable the EV Dash service.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `enabled` | `Bool` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `evDashError` | [EvDashError](../types.md#evdasherror) | |
---
## Notifications
### EvDash.EnabledChanged
Emitted whenever the EV Dash service has been enabled or disabled.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `enabled` | `Bool` | |
---
### EvDash.UserAdded
Emitted whenever a new username has been added for the dashboard.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `username` | `String` | |
---
### EvDash.UserRemoved
Emitted whenever a username has been removed from the dashboard.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `username` | `String` | |
---
<!-- END GENERATED -->

View File

@ -0,0 +1,812 @@
# Integrations
<!-- BEGIN GENERATED: __api_Integrations__ -->
## Méthodes
### Integrations.AddThing
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#paramlist) | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayMessage` | `String` | optionnel |
| `thingId` | `Uuid` | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.BrowseThing
<span class="badge perm-none">PUBLIC</span>
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](../types.md#browseritem)[] | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.ConfirmPairing
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#thingerror) | |
---
### Integrations.ConnectIO
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#thingerror) | |
---
### Integrations.DisconnectIO
<span class="badge perm-configure">CONFIGURE</span>
Disconnect an existing IO connection.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ioConnectionId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.DiscoverThings
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#paramlist) | optionnel |
| `thingClassId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayMessage` | `String` | optionnel |
| `thingDescriptors` | [ThingDescriptors](../types.md#thingdescriptors) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.EditThing
<span class="badge perm-configure">CONFIGURE</span>
Edit the name of a thing.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `name` | `String` | |
| `thingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.ExecuteAction
<span class="badge perm-control">CONTROL</span>
Execute a single action.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `actionTypeId` | `Uuid` | |
| `params` | [ParamList](../types.md#paramlist) | optionnel |
| `thingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayMessage` | `String` | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.ExecuteBrowserItem
<span class="badge perm-control">CONTROL</span>
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](../types.md#thingerror) | |
---
### Integrations.ExecuteBrowserItemAction
<span class="badge perm-control">CONTROL</span>
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](../types.md#paramlist) | optionnel |
| `thingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayMessage` | `String` | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.GetActionTypes
<span class="badge perm-none">PUBLIC</span>
Get action types for a specified thingClassId.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingClassId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `actionTypes` | [ActionTypes](../types.md#actiontypes) | |
---
### Integrations.GetBrowserItem
<span class="badge perm-none">PUBLIC</span>
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](../types.md#browseritem) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.GetEventTypes
<span class="badge perm-none">PUBLIC</span>
Get event types for a specified thingClassId.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingClassId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `eventTypes` | [EventTypes](../types.md#eventtypes) | |
---
### Integrations.GetIOConnections
<span class="badge perm-none">PUBLIC</span>
Fetch IO connections. Optionally filtered by thingId and stateTypeId.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingId` | `Uuid` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ioConnections` | [IOConnections](../types.md#ioconnections) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.GetPluginConfiguration
<span class="badge perm-configure">CONFIGURE</span>
Get a plugin's params.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `pluginId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configuration` | [ParamList](../types.md#paramlist) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.GetPlugins
<span class="badge perm-none">PUBLIC</span>
Returns a list of loaded plugins.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `plugins` | [IntegrationPlugins](../types.md#integrationplugins) | |
---
### Integrations.GetStateTypes
<span class="badge perm-none">PUBLIC</span>
Get state types for a specified thingClassId.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingClassId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `stateTypes` | [StateTypes](../types.md#statetypes) | |
---
### Integrations.GetStateValue
<span class="badge perm-none">PUBLIC</span>
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](../types.md#thingerror) | |
---
### Integrations.GetStateValues
<span class="badge perm-none">PUBLIC</span>
Get all the state values of the given thing.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `values` | [States](../types.md#states) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.GetThingClasses
<span class="badge perm-none">PUBLIC</span>
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](../types.md#thingclasses) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.GetThings
<span class="badge perm-none">PUBLIC</span>
Returns a list of configured things, optionally filtered by thingId.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingId` | `Uuid` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `things` | [Things](../types.md#things) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.GetVendors
<span class="badge perm-none">PUBLIC</span>
Returns a list of supported Vendors.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `vendors` | [Vendors](../types.md#vendors) | |
---
### Integrations.PairThing
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#paramlist) | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayMessage` | `String` | optionnel |
| `oAuthUrl` | `String` | optionnel |
| `pairingTransactionId` | `Uuid` | optionnel |
| `pin` | `String` | optionnel |
| `setupMethod` | [SetupMethod](../types.md#setupmethod) | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.ReconfigureThing
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#paramlist) | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayMessage` | `String` | optionnel |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.RemoveThing
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#thingerror) | |
---
### Integrations.SetActionLogging
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#thingerror) | |
---
### Integrations.SetEventLogging
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#thingerror) | |
---
### Integrations.SetPluginConfiguration
<span class="badge perm-configure">CONFIGURE</span>
Set a plugin's params.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configuration` | [ParamList](../types.md#paramlist) | |
| `pluginId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.SetStateFilter
<span class="badge perm-configure">CONFIGURE</span>
Set the filter for the given state on the given thing.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `filter` | [StateValueFilter](../types.md#statevaluefilter) | |
| `stateTypeId` | `Uuid` | |
| `thingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
### Integrations.SetStateLogging
<span class="badge perm-configure">CONFIGURE</span>
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](../types.md#thingerror) | |
---
### Integrations.SetThingSettings
<span class="badge perm-configure">CONFIGURE</span>
Change the settings of a thing.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `settings` | [ParamList](../types.md#paramlist) | |
| `thingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingError` | [ThingError](../types.md#thingerror) | |
---
## Notifications
### Integrations.EventTriggered
Emitted whenever an Event is triggered.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `event` | [Event](../types.md#event) | |
---
### Integrations.IOConnectionAdded
Emitted whenever an IO connection has been added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ioConnection` | [IOConnection](../types.md#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](../types.md#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](../types.md#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](../types.md#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` | |
---
<!-- END GENERATED -->

210
docs/api/metier/jsonrpc.md Normal file
View File

@ -0,0 +1,210 @@
# JSONRPC
<!-- BEGIN GENERATED: __api_JSONRPC__ -->
## Méthodes
### JSONRPC.Authenticate
<span class="badge perm-none">PUBLIC</span>
Authenticate a client to the api via user & password challenge. Provide a device name which allows the user to identify the client and revoke the token in case the device is lost or stolen. This will return a new token to be used to authorize a client at the API.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `deviceName` | `String` | |
| `password` | `String` | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `scopes` | [PermissionScopes](../types.md#permissionscopes) | optionnel |
| `token` | `String` | optionnel |
| `username` | `String` | optionnel |
| `success` | `Bool` | |
---
### JSONRPC.CreateUser
<span class="badge perm-admin">ADMIN</span>
Create a new user in the API. This is only allowed to be called when the initial setup is required. To create additional users, use Users.CreateUser instead. Call Authenticate after this to obtain a device token for the newly created user.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayName` | `String` | optionnel |
| `email` | `String` | optionnel |
| `password` | `String` | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### JSONRPC.Hello
<span class="badge perm-none">PUBLIC</span>
Initiates a connection. Use this method to perform an initial handshake of the connection. Optionally, a parameter "locale" is can be passed to set up the used locale for this connection. Strings such as ThingClass displayNames etc will be localized to this locale. If this parameter is omitted, the default system locale (depending on the configuration) is used. The reply of this method contains information about this core instance such as version information, uuid and its name. The locale valueindicates the locale used for this connection. Note: This method can be called multiple times. The locale used in the last call for this connection will be used. Other values, like initialSetupRequired might change if the setup has been performed in the meantime.
The field cacheHashes may contain a map of methods and MD5 hashes. As long as the hash for a method does not change, a client may use a previously cached copy of the call instead of fetching the content again. While the Hello call doesn't necessarily require a token, this can be called with a token. If a token is provided, it will be verified and the reply contains information about the tokens validity and the user and permissions for the given token.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `locale` | `String` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `authenticationRequired` | `Bool` | |
| `initialSetupRequired` | `Bool` | |
| `language` | `String` | |
| `locale` | `String` | |
| `name` | `String` | |
| `authenticated` | `Bool` | optionnel |
| `cacheHashes` | [CacheHash](../types.md#cachehash)[] | optionnel |
| `experiences` | [Experience](../types.md#experience)[] | optionnel |
| `permissionScopes` | [PermissionScopes](../types.md#permissionscopes) | optionnel |
| `username` | `String` | optionnel |
| `protocol version` | `String` | |
| `pushButtonAuthAvailable` | `Bool` | |
| `server` | `String` | |
| `uuid` | `Uuid` | |
| `version` | `String` | |
---
### JSONRPC.Introspect
<span class="badge perm-none">PUBLIC</span>
Introspect this API.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `methods` | `Object` | |
| `notifications` | `Object` | |
| `types` | `Object` | |
---
### JSONRPC.KeepAlive
<span class="badge perm-none">PUBLIC</span>
This is basically a Ping/Pong mechanism a client app may use to check server connectivity. Currently, the server does not actually do anything with this information and will return the call providing the given sessionId back to the caller. It is up to the client whether to use this or not and not required by the server to keep the connection alive.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `sessionId` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `sessionId` | `String` | |
| `success` | `Bool` | |
---
### JSONRPC.RequestPushButtonAuth
<span class="badge perm-none">PUBLIC</span>
Authenticate a client to the api via Push Button method. Provide a device name which allows the user to identify the client and revoke the token in case the device is lost or stolen. If push button hardware is available, this will return with success and start listening for push button presses. When the push button is pressed, the PushButtonAuthFinished notification will be sent to the requesting client. The procedure will be cancelled when the connection is interrupted. If another client requests push button authentication while a procedure is still going on, the second call will take over and the first one will be notified by the PushButtonAuthFinished signal about the error. The application should make it clear to the user to not press the button when the procedure fails as this can happen for 2 reasons: a) a second user is trying to auth at the same time and only the currently active user should press the button or b) it might indicate an attacker trying to take over and snooping in for tokens.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `deviceName` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
| `transactionId` | `Int` | |
---
### JSONRPC.SetNotificationStatus
<span class="badge perm-none">PUBLIC</span>
Enable/Disable notifications for this connections. Either "enabled" or "namespaces" needs to be given but not both of them. The boolean based "enabled" parameter will enable/disable all notifications at once. If instead the list-based "namespaces" parameter is provided, all given namespaceswill be enabled, the others will be disabled. The return value of "success" will indicate success of the operation. The "enabled" property in the return value is deprecated and used for legacy compatibilty only. It will be set to true if at least one namespace has been enabled.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `d:o:enabled` | `Bool` | |
| `namespaces` | `StringList` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `d:enabled` | `Bool` | |
| `namespaces` | `StringList` | |
---
### JSONRPC.Version
<span class="badge perm-none">PUBLIC</span>
Version of this nymea/JSONRPC interface.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `protocol version` | `String` | |
| `qtBuildVersion` | `String` | |
| `qtVersion` | `String` | |
| `version` | `String` | |
---
## Notifications
### JSONRPC.PushButtonAuthFinished
Emitted when a push button authentication reaches final state. NOTE: This notification is special. It will only be emitted to connections that did actively request a push button authentication, but also it will be emitted regardless of the notification settings.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `token` | `String` | optionnel |
| `success` | `Bool` | |
| `transactionId` | `Int` | |
---
<!-- END GENERATED -->

View File

@ -0,0 +1,59 @@
# Logging
<!-- BEGIN GENERATED: __api_Logging__ -->
## Méthodes
### Logging.GetLogEntries
<span class="badge perm-control">CONTROL</span>
Get the LogEntries matching the given filter.
"sources": Builtin sources are: "core", "rules", "scripts", "integrations". May be extended by experience plugins.
"columns": Columns to be returned.
"filter": A map of column:value entries. Only = is supported currently.
"startTime": The datetime of the oldest entry, in ms.
"endTime": The datetime of the newest entry, in ms.
"sampleRate": If given, returns a sampled series of the values, filling in gaps with the previous value.
"sortOrder": Sort order of results. Note that this impacts the filling of gaps when resampling.
"limit": Maximum amount of entries to be returned.
"offset": Offset to be skipped before returning entries.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `columns` | `String`[] | optionnel |
| `endTime` | `Uint` | optionnel |
| `filter` | `Variant` | optionnel |
| `limit` | `Int` | optionnel |
| `offset` | `Int` | optionnel |
| `sampleRate` | [SampleRate](../types.md#samplerate) | optionnel |
| `sortOrder` | [SortOrder](../types.md#sortorder) | optionnel |
| `startTime` | `Uint` | optionnel |
| `sources` | `String`[] | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `count` | `Int` | |
| `logEntries` | [LogEntries](../types.md#logentries) | optionnel |
| `offset` | `Int` | |
---
## Notifications
### Logging.LogEntryAdded
Emitted when a log entry is added. This will only be emitted for discrete series, not for resampled entries
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `logEntry` | [LogEntry](../types.md#logentry) | |
---
<!-- END GENERATED -->

273
docs/api/metier/rules.md Normal file
View File

@ -0,0 +1,273 @@
# Rules
<!-- BEGIN GENERATED: __api_Rules__ -->
## Méthodes
### Rules.AddRule
<span class="badge perm-configure">CONFIGURE-RULES</span>
Add a rule. You can describe rules by one or many EventDesciptors and a StateEvaluator. Note that only one of either eventDescriptor or eventDescriptorList may be passed at a time. A rule can be created but left disabled, meaning it won't actually be executed until set to enabled. If not given, enabled defaults to true. A rule can have a list of actions and exitActions. It must have at least one Action. For state based rules, actions will be executed when the system enters a state matching the stateDescriptor. The exitActions will be executed when the system leaves the described state again. For event based rules, actions will be executed when a matching event happens and if the stateEvaluator matches the system's state. ExitActions for such rules will be executed when a matching event happens and the stateEvaluator is not matching the system's state. A rule marked as executable can be executed via the API using Rules.ExecuteRule, that means, its actions will be executed regardless of the eventDescriptor and stateEvaluators.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `actions` | [RuleAction](../types.md#ruleaction)[] | |
| `name` | `String` | |
| `enabled` | `Bool` | optionnel |
| `eventDescriptors` | [EventDescriptor](../types.md#eventdescriptor)[] | optionnel |
| `executable` | `Bool` | optionnel |
| `exitActions` | [RuleAction](../types.md#ruleaction)[] | optionnel |
| `stateEvaluator` | [StateEvaluator](../types.md#stateevaluator) | optionnel |
| `timeDescriptor` | [TimeDescriptor](../types.md#timedescriptor) | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | optionnel |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
### Rules.DisableRule
<span class="badge perm-configure">CONFIGURE-RULES</span>
Disable a rule. The rule won't be triggered by it's events or state changes while it is disabled. If successful, the notification "Rule.RuleConfigurationChanged" will be emitted.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
### Rules.EditRule
<span class="badge perm-configure">CONFIGURE-RULES</span>
Edit the parameters of a rule. The configuration of the rule with the given ruleId will be replaced with the new given configuration. In ordert to enable or disable a Rule, please use the methods "Rules.EnableRule" and "Rules.DisableRule". If successful, the notification "Rule.RuleConfigurationChanged" will be emitted.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `actions` | [RuleAction](../types.md#ruleaction)[] | |
| `name` | `String` | |
| `enabled` | `Bool` | optionnel |
| `eventDescriptors` | [EventDescriptor](../types.md#eventdescriptor)[] | optionnel |
| `executable` | `Bool` | optionnel |
| `exitActions` | [RuleAction](../types.md#ruleaction)[] | optionnel |
| `stateEvaluator` | [StateEvaluator](../types.md#stateevaluator) | optionnel |
| `timeDescriptor` | [TimeDescriptor](../types.md#timedescriptor) | optionnel |
| `ruleId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `rule` | [Rule](../types.md#rule) | optionnel |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
### Rules.EnableRule
<span class="badge perm-configure">CONFIGURE-RULES</span>
Enabled a rule that has previously been disabled.If successful, the notification "Rule.RuleConfigurationChanged" will be emitted.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
### Rules.ExecuteActions
<span class="badge perm-control">EXECUTE</span>
Execute the action list of the rule with the given ruleId.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
### Rules.ExecuteExitActions
<span class="badge perm-control">EXECUTE</span>
Execute the exit action list of the rule with the given ruleId.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
### Rules.FindRules
<span class="badge perm-control">EXECUTE</span>
Find a list of rules containing any of the given parameters.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `thingId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleIds` | `Uuid`[] | |
---
### Rules.GetRuleDetails
<span class="badge perm-control">EXECUTE</span>
Get details for the rule identified by ruleId
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `rule` | [Rule](../types.md#rule) | optionnel |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
### Rules.GetRules
<span class="badge perm-control">EXECUTE</span>
Get the descriptions of all configured rules. If you need more information about a specific rule use the method Rules.GetRuleDetails.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleDescriptions` | [RuleDescription](../types.md#ruledescription)[] | |
---
### Rules.RemoveRule
<span class="badge perm-configure">CONFIGURE-RULES</span>
Remove a rule
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleError` | [RuleError](../types.md#ruleerror) | |
---
## Notifications
### Rules.RuleActiveChanged
Emitted whenever the active state of a Rule changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `active` | `Bool` | |
| `ruleId` | `Uuid` | |
---
### Rules.RuleAdded
Emitted whenever a Rule was added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `rule` | [Rule](../types.md#rule) | |
---
### Rules.RuleConfigurationChanged
Emitted whenever the configuration of a Rule changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `rule` | [Rule](../types.md#rule) | |
---
### Rules.RuleRemoved
Emitted whenever a Rule was removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ruleId` | `Uuid` | |
---
<!-- END GENERATED -->

176
docs/api/metier/scripts.md Normal file
View File

@ -0,0 +1,176 @@
# Scripts
<!-- BEGIN GENERATED: __api_Scripts__ -->
## Méthodes
### Scripts.AddScript
<span class="badge perm-admin">ADMIN</span>
Add a script
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `content` | `String` | |
| `name` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `errors` | `StringList` | optionnel |
| `script` | [Script](../types.md#script) | optionnel |
| `scriptError` | [ScriptError](../types.md#scripterror) | |
---
### Scripts.EditScript
<span class="badge perm-admin">ADMIN</span>
Edit a script
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `Uuid` | |
| `content` | `String` | optionnel |
| `name` | `String` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `errors` | `StringList` | optionnel |
| `scriptError` | [ScriptError](../types.md#scripterror) | |
---
### Scripts.GetScriptContent
<span class="badge perm-admin">ADMIN</span>
Get a scripts content.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `content` | `String` | optionnel |
| `scriptError` | [ScriptError](../types.md#scripterror) | |
---
### Scripts.GetScripts
<span class="badge perm-admin">ADMIN</span>
Get all script, that is, their names and properties, but no content.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `scripts` | [Scripts](../types.md#scripts) | |
---
### Scripts.RemoveScript
<span class="badge perm-admin">ADMIN</span>
remove a script
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `scriptError` | [ScriptError](../types.md#scripterror) | |
---
## Notifications
### Scripts.ScriptAdded
Emitted when a script has been added to the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `script` | [Script](../types.md#script) | |
---
### Scripts.ScriptChanged
Emitted when a script has been changed in the system (e.g. renamed).
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `name` | `String` | |
| `scriptId` | `Uuid` | |
---
### Scripts.ScriptContentChanged
Emitted when a script's content has been changed in the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `scriptId` | `Uuid` | |
---
### Scripts.ScriptLogMessage
Emitted when a script produces a console message.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `message` | `String` | |
| `scriptId` | `Uuid` | |
| `type` | [ScriptMessageType](../types.md#scriptmessagetype) | |
---
### Scripts.ScriptRemoved
Emitted when a script has been removed from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `Uuid` | |
---
<!-- END GENERATED -->

108
docs/api/metier/tags.md Normal file
View File

@ -0,0 +1,108 @@
# Tags
<!-- BEGIN GENERATED: __api_Tags__ -->
## Méthodes
### Tags.AddTag
<span class="badge perm-control">CONTROL</span>
Add a Tag. A Tag must have a thingId OR a ruleId (call this method twice if you want to attach the same tag to a thing and a rule), an appId (Use the appId of your app), a tagId (e.g. "favorites") and a value. Upon success, a TagAdded notification will be emitted. Calling this method twice for the same ids (thing/rule, appId and tagId) but with a different value will update the tag's value and the TagValueChanged notification will be emitted.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tag` | [Tag](../types.md#tag) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tagError` | [TagError](../types.md#tagerror) | |
---
### Tags.GetTags
<span class="badge perm-control">CONTROL</span>
Get the Tags matching the given filter. Tags can be filtered by a thingID, a ruleId, an appId, a tagId or a combination of any (however, combining thingId and ruleId will return an empty result set).
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `appId` | `String` | optionnel |
| `ruleId` | `Uuid` | optionnel |
| `tagId` | `String` | optionnel |
| `thingId` | `Uuid` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tags` | [Tags](../types.md#tags) | optionnel |
| `tagError` | [TagError](../types.md#tagerror) | |
---
### Tags.RemoveTag
<span class="badge perm-control">CONTROL</span>
Remove a Tag. Tag value is optional and will be disregarded. If the ids match, the tag will be deleted and a TagRemoved notification will be emitted.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tag` | [Tag](../types.md#tag) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tagError` | [TagError](../types.md#tagerror) | |
---
## Notifications
### Tags.TagAdded
Emitted whenever a tag is added to the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tag` | [Tag](../types.md#tag) | |
---
### Tags.TagRemoved
Emitted whenever a tag is removed from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tag` | [Tag](../types.md#tag) | |
---
### Tags.TagValueChanged
Emitted whenever a tag's value is changed in the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tag` | [Tag](../types.md#tag) | |
---
<!-- END GENERATED -->

1169
docs/api/notifications.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,795 @@
# Configuration
<!-- BEGIN GENERATED: __api_Configuration__ -->
## Méthodes
### Configuration.CreateAndDownloadBackup
<span class="badge perm-admin">ADMIN</span>
Create a backup of the current configuration and generate a download entry for the dedicated transfer connection.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
| `downloadId` | `String` | |
| `fileName` | `String` | |
| `size` | `Int` | |
---
### Configuration.CreateBackup
<span class="badge perm-admin">ADMIN</span>
Create a backup of the current configuration. It will be stored in the configured destination directory. Also the maxCout configuration will be considered.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DeleteBackupFile
<span class="badge perm-admin">ADMIN</span>
Delete an existing configuration backup file.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `fileName` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DeleteMqttPolicy
<span class="badge perm-admin">ADMIN</span>
Delete a MQTT policy from the broker.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `clientId` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DeleteMqttServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Delete a MQTT Server interface of the server.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DeleteTcpServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Delete a TCP interface of the server. Note: if you are deleting the configuration for the interface you are currently connected to, the connection will be dropped.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DeleteTunnelProxyServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Delete a Tunnel Proxy Server interface of the server. Note: if you are deleting the configuration for the interface you are currently connected to, the connection will be dropped.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DeleteWebServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Delete a WebServer interface of the server.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DeleteWebSocketServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Delete a WebSocket Server interface of the server. Note: if you are deleting the configuration for the interface you are currently connected to, the connection will be dropped.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.DownloadBackupFile
<span class="badge perm-admin">ADMIN</span>
Generate a download entry for an existing configuration backup file.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `fileName` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
| `downloadId` | `String` | optionnel |
| `fileName` | `String` | optionnel |
| `size` | `Int` | optionnel |
---
### Configuration.GetAvailableLanguages
<span class="badge perm-none">PUBLIC</span>
Returns a list of locale codes available for the server. i.e. en_US, de_AT
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `languages` | `String`[] | |
---
### Configuration.GetBackupFiles
<span class="badge perm-admin">ADMIN</span>
Get the list of configuration backup files from the configured destination directory.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `backupFiles` | [BackupFile](../types.md#backupfile)[] | |
---
### Configuration.GetConfigurations
<span class="badge perm-none">PUBLIC</span>
Get all configuration parameters of the server.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `backupConfigurations` | `{'autoBackupEnabled': 'Bool', 'autoBackupInterval': 'Int', 'destinationDirectory': 'String', 'maxCount': 'Uint'}` | |
| `basicConfiguration` | `{'d:language': 'String', 'd:location': {'latitude': 'Double', 'longitude': 'Double', 'name': 'String'}, 'd:serverTime': 'Uint', 'd:timeZone': 'String', 'debugServerEnabled': 'Bool', 'serverName': 'String', 'serverUuid': 'Uuid'}` | |
| `mqttServerConfigurations` | [ServerConfiguration](../types.md#serverconfiguration)[] | |
| `tcpServerConfigurations` | [ServerConfiguration](../types.md#serverconfiguration)[] | |
| `tunnelProxyServerConfigurations` | [TunnelProxyServerConfiguration](../types.md#tunnelproxyserverconfiguration)[] | |
| `webServerConfigurations` | [WebServerConfiguration](../types.md#webserverconfiguration)[] | |
| `webSocketServerConfigurations` | [ServerConfiguration](../types.md#serverconfiguration)[] | |
---
### Configuration.GetMqttPolicies
<span class="badge perm-admin">ADMIN</span>
Get all MQTT broker policies.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `mqttPolicies` | [MqttPolicy](../types.md#mqttpolicy)[] | |
---
### Configuration.GetMqttServerConfigurations
<span class="badge perm-admin">ADMIN</span>
Get all MQTT Server configurations.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `mqttServerConfigurations` | [ServerConfiguration](../types.md#serverconfiguration)[] | |
---
### Configuration.GetTimeZones
<span class="badge perm-none">PUBLIC</span>
Get the list of available timezones.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `timeZones` | `String`[] | |
---
### Configuration.RestoreBackupFile
<span class="badge perm-admin">ADMIN</span>
Restore an existing configuration backup file. Clients should warn the user before calling this method because the current configuration data will be wiped, the server will restart immediately afterwards and it will come back up using the restored backup.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `fileName` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetBackupConfiguration
<span class="badge perm-admin">ADMIN</span>
Set the backup configuration. The destination directory is the location where the archives will be saved, the maxCount is the number of backups which will be kept. If maxCount is 0, all backups will be kept. The autoBackupEnabled property controls periodic configuration backups and autoBackupInterval defines the interval in hours.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `autoBackupEnabled` | `Bool` | |
| `autoBackupInterval` | `Int` | |
| `destinationDirectory` | `String` | |
| `maxCount` | `Uint` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetDebugServerEnabled
<span class="badge perm-admin">ADMIN</span>
Enable or disable the debug server.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `enabled` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetLanguage
<span class="badge perm-admin">ADMIN</span>
Sets the server language to the given language. See also: "GetAvailableLanguages"
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `language` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetLocation
<span class="badge perm-admin">ADMIN</span>
Sets the server location.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `location` | `{'latitude': 'Double', 'longitude': 'Double', 'name': 'String'}` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetMqttPolicy
<span class="badge perm-admin">ADMIN</span>
Configure a MQTT broker policy. If the ID is an existing one, the existing policy will be modified, otherwise a new one will be added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `policy` | [MqttPolicy](../types.md#mqttpolicy) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetMqttServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Configure a MQTT Server interface on the MQTT broker. If the ID is an existing one, the existing config will be modified, otherwise a new one will be added. Setting authenticationEnabled to true will require MQTT clients to use credentials set in the MQTT broker policies.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configuration` | [ServerConfiguration](../types.md#serverconfiguration) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetServerName
<span class="badge perm-admin">ADMIN</span>
Set the name of the server. Default is nymea.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `serverName` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetTcpServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Configure a TCP interface of the server. If the ID is an existing one, the existing config will be modified, otherwise a new one will be added. Note: if you are changing the configuration for the interface you are currently connected to, the connection will be dropped.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configuration` | [ServerConfiguration](../types.md#serverconfiguration) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetTimeZone
<span class="badge perm-admin">ADMIN</span>
Set the time zone of the server. See also: "GetTimeZones"
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `timeZone` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetTunnelProxyServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Configure a Tunnel Proxy Server interface of the server. If the ID is an existing one, the existing config will be modified, otherwise a new one will be added. Note: if you are changing the configuration for the interface you are currently connected to, the connection will be dropped.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configuration` | [TunnelProxyServerConfiguration](../types.md#tunnelproxyserverconfiguration) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetWebServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Configure a WebServer interface of the server. If the ID is an existing one, the existing config will be modified, otherwise a new one will be added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configuration` | [WebServerConfiguration](../types.md#webserverconfiguration) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.SetWebSocketServerConfiguration
<span class="badge perm-admin">ADMIN</span>
Configure a WebSocket Server interface of the server. If the ID is an existing one, the existing config will be modified, otherwise a new one will be added. Note: if you are changing the configuration for the interface you are currently connected to, the connection will be dropped.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configuration` | [ServerConfiguration](../types.md#serverconfiguration) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
---
### Configuration.UploadAndRestoreBackup
<span class="badge perm-admin">ADMIN</span>
Create an upload session for a configuration backup archive. The uploaded file will be stored temporarily under /tmp, the current configuration will be wiped after the upload finishes and the server will restart immediately using the restored backup. Clients should warn the user before calling this method because all current configuration data will be lost.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `fileName` | `String` | |
| `size` | `Int` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `configurationError` | [ConfigurationError](../types.md#configurationerror) | |
| `fileName` | `String` | optionnel |
| `size` | `Int` | optionnel |
| `transferId` | `String` | optionnel |
| `transferToken` | `String` | optionnel |
---
## Notifications
### Configuration.BackupConfigurationChanged
Emitted whenever the backup configuration changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `autoBackupEnabled` | `Bool` | |
| `autoBackupInterval` | `Int` | |
| `destinationDirectory` | `String` | |
| `maxCount` | `Uint` | |
---
### Configuration.BackupFilesChanged
Emitted whenever the list of backup files changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `backupFiles` | [BackupFile](../types.md#backupfile)[] | |
---
### Configuration.BasicConfigurationChanged
Emitted whenever the basic configuration of this server changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `basicConfiguration` | `{'d:language': 'String', 'd:location': {'latitude': 'Double', 'longitude': 'Double', 'name': 'String'}, 'd:serverTime': 'Uint', 'd:timeZone': 'String', 'debugServerEnabled': 'Bool', 'serverName': 'String', 'serverUuid': 'Uuid'}` | |
---
### Configuration.MqttPolicyChanged
Emitted whenever a MQTT broker policy is changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `policy` | [MqttPolicy](../types.md#mqttpolicy) | |
---
### Configuration.MqttPolicyRemoved
Emitted whenever a MQTT broker policy is removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `clientId` | `String` | |
---
### Configuration.MqttServerConfigurationChanged
Emitted whenever the MQTT broker configuration is changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `mqttServerConfiguration` | [ServerConfiguration](../types.md#serverconfiguration) | |
---
### Configuration.MqttServerConfigurationRemoved
Emitted whenever a MQTT server configuration is removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
---
### Configuration.TcpServerConfigurationChanged
Emitted whenever the TCP server configuration changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tcpServerConfiguration` | [ServerConfiguration](../types.md#serverconfiguration) | |
---
### Configuration.TcpServerConfigurationRemoved
Emitted whenever a TCP server configuration is removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
---
### Configuration.TunnelProxyServerConfigurationChanged
Emitted whenever the tunnel proxy server configuration changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tunnelProxyServerConfiguration` | [TunnelProxyServerConfiguration](../types.md#tunnelproxyserverconfiguration) | |
---
### Configuration.TunnelProxyServerConfigurationRemoved
Emitted whenever a tunnel proxy server configuration is removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
---
### Configuration.WebServerConfigurationChanged
Emitted whenever the web server configuration changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `webServerConfiguration` | [WebServerConfiguration](../types.md#webserverconfiguration) | |
---
### Configuration.WebServerConfigurationRemoved
Emitted whenever a Web server configuration is removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
---
### Configuration.WebSocketServerConfigurationChanged
Emitted whenever the web socket server configuration changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `webSocketServerConfiguration` | [ServerConfiguration](../types.md#serverconfiguration) | |
---
### Configuration.WebSocketServerConfigurationRemoved
Emitted whenever a WebSocket server configuration is removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `id` | `String` | |
---
<!-- END GENERATED -->

60
docs/api/systeme/debug.md Normal file
View File

@ -0,0 +1,60 @@
# Debug
<!-- BEGIN GENERATED: __api_Debug__ -->
## Méthodes
### Debug.GetLoggingCategories
<span class="badge perm-admin">ADMIN</span>
Get all available logging categories.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `loggingCategories` | [LoggingCategory](../types.md#loggingcategory)[] | |
---
### Debug.SetLoggingCategoryLevel
<span class="badge perm-admin">ADMIN</span>
Set the logging category with the given name to the given logging level.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `level` | [LoggingLevel](../types.md#logginglevel) | |
| `name` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `debugError` | [DebugError](../types.md#debugerror) | |
---
## Notifications
### Debug.LoggingCategoryLevelChanged
Emitted whenever a logging category has changed the logging level.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `level` | [LoggingLevel](../types.md#logginglevel) | |
| `name` | `String` | |
---
<!-- END GENERATED -->

View File

@ -0,0 +1,179 @@
# ModbusRtu
<!-- BEGIN GENERATED: __api_ModbusRtu__ -->
## Méthodes
### ModbusRtu.AddModbusRtuMaster
<span class="badge perm-admin">ADMIN</span>
Add a new modbus RTU master with the given configuration. The timeout value is in milli seconds and the minimum value is 10 ms.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `baudrate` | `Uint` | |
| `dataBits` | [SerialPortDataBits](../types.md#serialportdatabits) | |
| `numberOfRetries` | `Uint` | |
| `parity` | [SerialPortParity](../types.md#serialportparity) | |
| `serialPort` | `String` | |
| `stopBits` | [SerialPortStopBits](../types.md#serialportstopbits) | |
| `timeout` | `Uint` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusError` | [ModbusRtuError](../types.md#modbusrtuerror) | |
| `modbusUuid` | `Uuid` | optionnel |
---
### ModbusRtu.GetModbusRtuMasters
<span class="badge perm-admin">ADMIN</span>
Get the list of configured modbus RTU masters.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusError` | [ModbusRtuError](../types.md#modbusrtuerror) | |
| `modbusRtuMasters` | [ModbusRtuMaster](../types.md#modbusrtumaster)[] | optionnel |
---
### ModbusRtu.GetSerialPorts
<span class="badge perm-admin">ADMIN</span>
Get the list of available serial ports from the host system.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `serialPorts` | [SerialPorts](../types.md#serialports) | |
---
### ModbusRtu.ReconfigureModbusRtuMaster
<span class="badge perm-admin">ADMIN</span>
Reconfigure the modbus RTU master with the given UUID and configuration.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `baudrate` | `Uint` | |
| `dataBits` | [SerialPortDataBits](../types.md#serialportdatabits) | |
| `modbusUuid` | `Uuid` | |
| `numberOfRetries` | `Uint` | |
| `parity` | [SerialPortParity](../types.md#serialportparity) | |
| `serialPort` | `String` | |
| `stopBits` | [SerialPortStopBits](../types.md#serialportstopbits) | |
| `timeout` | `Uint` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusError` | [ModbusRtuError](../types.md#modbusrtuerror) | |
---
### ModbusRtu.RemoveModbusRtuMaster
<span class="badge perm-admin">ADMIN</span>
Remove the modbus RTU master with the given modbus UUID.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusError` | [ModbusRtuError](../types.md#modbusrtuerror) | |
---
## Notifications
### ModbusRtu.ModbusRtuMasterAdded
Emitted whenever a new modbus RTU master has been added to the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusRtuMaster` | [ModbusRtuMaster](../types.md#modbusrtumaster) | |
---
### ModbusRtu.ModbusRtuMasterChanged
Emitted whenever a modbus RTU master has been changed in the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusRtuMaster` | [ModbusRtuMaster](../types.md#modbusrtumaster) | |
---
### ModbusRtu.ModbusRtuMasterRemoved
Emitted whenever a modbus RTU master has been removed from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `modbusUuid` | `Uuid` | |
---
### ModbusRtu.SerialPortAdded
Emitted whenever a serial port has been added to the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `serialPort` | [SerialPort](../types.md#serialport) | |
---
### ModbusRtu.SerialPortRemoved
Emitted whenever a serial port has been removed from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `serialPort` | [SerialPort](../types.md#serialport) | |
---
<!-- END GENERATED -->

View File

@ -0,0 +1,301 @@
# NetworkManager
<!-- BEGIN GENERATED: __api_NetworkManager__ -->
## Méthodes
### NetworkManager.ConnectWifiNetwork
<span class="badge perm-admin">ADMIN</span>
Connect to the wifi network with the given ssid and password.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
| `password` | `String` | optionnel |
| `ssid` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
---
### NetworkManager.CreateWiredConnection
<span class="badge perm-admin">ADMIN</span>
Create a wired connection.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
| `dns` | `String` | optionnel |
| `gateway` | `String` | optionnel |
| `ip` | `String` | optionnel |
| `prefix` | `Uint` | optionnel |
| `type` | [WiredNetworkConnectionType](../types.md#wirednetworkconnectiontype) | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
---
### NetworkManager.DisconnectInterface
<span class="badge perm-admin">ADMIN</span>
Disconnect the given network interface. The interface will remain disconnected until the user connect it again.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
---
### NetworkManager.EnableNetworking
<span class="badge perm-admin">ADMIN</span>
Enable or disable networking in the NetworkManager.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `enable` | `Bool` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
---
### NetworkManager.EnableWirelessNetworking
<span class="badge perm-admin">ADMIN</span>
Enable or disable wireless networking in the NetworkManager.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `enable` | `Bool` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
---
### NetworkManager.GetNetworkDevices
<span class="badge perm-admin">ADMIN</span>
Get the list of current network devices.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
| `wiredNetworkDevices` | [WiredNetworkDevice](../types.md#wirednetworkdevice)[] | optionnel |
| `wirelessNetworkDevices` | [WirelessNetworkDevice](../types.md#wirelessnetworkdevice)[] | optionnel |
---
### NetworkManager.GetNetworkStatus
<span class="badge perm-admin">ADMIN</span>
Get the current network manager status.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
| `status` | `{'networkingEnabled': 'Bool', 'state': '$ref:NetworkManagerState', 'wirelessNetworkingEnabled': 'Bool'}` | optionnel |
---
### NetworkManager.GetWirelessAccessPoints
<span class="badge perm-admin">ADMIN</span>
Get the current list of wireless network access points for the given interface. The interface has to be a WirelessNetworkDevice.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
| `wirelessAccessPoints` | [WirelessAccessPoint](../types.md#wirelessaccesspoint)[] | optionnel |
---
### NetworkManager.ScanWifiNetworks
<span class="badge perm-admin">ADMIN</span>
Start a wifi scan for searching new networks.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
---
### NetworkManager.StartAccessPoint
<span class="badge perm-admin">ADMIN</span>
Start a WiFi Access point on the given interface with the given SSID and password. Use DisconnectInterface to stop it again.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
| `password` | `String` | |
| `ssid` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkManagerError` | [NetworkManagerError](../types.md#networkmanagererror) | |
---
## Notifications
### NetworkManager.NetworkStatusChanged
Emitted whenever a status of a NetworkManager changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `status` | `{'networkingEnabled': 'Bool', 'state': '$ref:NetworkManagerState', 'wirelessNetworkingEnabled': 'Bool'}` | |
---
### NetworkManager.WiredNetworkDeviceAdded
Emitted whenever a new WiredNetworkDevice was added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `wiredNetworkDevice` | [WiredNetworkDevice](../types.md#wirednetworkdevice) | |
---
### NetworkManager.WiredNetworkDeviceChanged
Emitted whenever the given WiredNetworkDevice has changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `wiredNetworkDevice` | [WiredNetworkDevice](../types.md#wirednetworkdevice) | |
---
### NetworkManager.WiredNetworkDeviceRemoved
Emitted whenever a WiredNetworkDevice was removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
---
### NetworkManager.WirelessNetworkDeviceAdded
Emitted whenever a new WirelessNetworkDevice was added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `wirelessNetworkDevice` | [WirelessNetworkDevice](../types.md#wirelessnetworkdevice) | |
---
### NetworkManager.WirelessNetworkDeviceChanged
Emitted whenever the given WirelessNetworkDevice has changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `wirelessNetworkDevice` | [WirelessNetworkDevice](../types.md#wirelessnetworkdevice) | |
---
### NetworkManager.WirelessNetworkDeviceRemoved
Emitted whenever a WirelessNetworkDevice was removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `interface` | `String` | |
---
<!-- END GENERATED -->

450
docs/api/systeme/system.md Normal file
View File

@ -0,0 +1,450 @@
# System
<!-- BEGIN GENERATED: __api_System__ -->
## Méthodes
### System.CheckForUpdates
<span class="badge perm-admin">ADMIN</span>
Instruct the system to poll the server for updates. Normally the system should automatically do this in regular intervals, however, if the client wants to allow the user to manually check for new updates now, this can be called. Returns true if the operation has been started successfully and the update manager will become busy. In order to know whether there are updates available, clients should walk through the list of packages retrieved from GetPackages and check whether there are packages with the updateAvailable flag set to true.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.EnableRepository
<span class="badge perm-admin">ADMIN</span>
Enable or disable a repository.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `enabled` | `Bool` | |
| `repositoryId` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.FactoryReset
<span class="badge perm-admin">ADMIN</span>
Reset nymea to factory defaults. Clients should warn the user before calling this method because all current configuration data will be lost, the server will restart immediately afterwards and it will come back up using the factory defaults if any are available.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.GetCapabilities
<span class="badge perm-admin">ADMIN</span>
Get the list of capabilites on this system. The property "powerManagement" indicates whether restarting nymea and rebooting or shutting down is supported on this system. The property "updateManagement" indicates whether system update features are available in this system. The "updateManagementType" indicates which kind of update is supported on this platform. The property "timeManagement" indicates whether the system time can be configured on this system. Note that GetTime will be available in any case.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `powerManagement` | `Bool` | |
| `timeManagement` | `Bool` | |
| `updateManagement` | `Bool` | |
| `updateManagementType` | [UpdateType](../types.md#updatetype) | |
---
### System.GetPackages
<span class="badge perm-admin">ADMIN</span>
Get the list of packages currently available to the system. This might include installed available but not installed packages. Installed packages will have the installedVersion set to a non-empty value.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `packages` | [Packages](../types.md#packages) | |
---
### System.GetRepositories
<span class="badge perm-admin">ADMIN</span>
Get the list of repositories currently available to the system.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `repositories` | [Repositories](../types.md#repositories) | |
---
### System.GetSystemInfo
<span class="badge perm-admin">ADMIN</span>
Returns information about the system nymea is running on.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `deviceSerialNumber` | `String` | |
---
### System.GetTime
<span class="badge perm-admin">ADMIN</span>
Get the system time and configuraton. The "time" and "timeZone" properties give the current server time and time zone. "automaticTimeAvailable" indicates whether this system supports automatically setting the clock (e.g. using NTP). "automaticTime" will be true if the system is configured to automatically update the clock.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `automaticTime` | `Bool` | |
| `automaticTimeAvailable` | `Bool` | |
| `time` | `Uint` | |
| `timeZone` | `String` | |
---
### System.GetTimeZones
<span class="badge perm-admin">ADMIN</span>
Returns the list of IANA specified time zone IDs which can be used to select a time zone. It is not required to use this method if the client toolkit already provides means to obtain a list of IANA time zone ids.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `timeZones` | `StringList` | |
---
### System.GetUpdateStatus
<span class="badge perm-admin">ADMIN</span>
Get the current status of the update system. "busy" indicates that the system is current busy with an operation regarding updates. This does not necessarily mean an actual update is running. When this is true, update related functions on the client should be marked as busy and no interaction with update components shall be allowed. An example for such a state is when the system queries the server if there are updates available, typically after a call to CheckForUpdates. "updateRunning" on the other hand indicates an actual update process is ongoing. The user should be informed about it, the system also might restart at any point while an update is running. The "updateProgress" property is optional, if the backend supports it, a progress >= 0 indicated the update progress in percentage.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `busy` | `Bool` | |
| `updateProgress` | `Int` | optionnel |
| `updateRunning` | `Bool` | |
---
### System.Reboot
<span class="badge perm-admin">ADMIN</span>
Initiate a reboot of the system. The return value will indicate whether the procedure has been initiated successfully.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.RemovePackages
<span class="badge perm-admin">ADMIN</span>
Starts removing a package. Returns true if the removal has been started successfully. Before calling this method, clients should check whether the package can be removed (canRemove set to true).
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `packageIds` | `String`[] | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.Restart
<span class="badge perm-admin">ADMIN</span>
Initiate a restart of the nymea service. The return value will indicate whether the procedure has been initiated successfully.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.RollbackPackages
<span class="badge perm-admin">ADMIN</span>
Starts a rollback. Returns true if the rollback has been started successfully. Before calling this method, clients should check whether the package can be rolled back (canRollback set to true).
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `packageIds` | `String`[] | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.SetTime
<span class="badge perm-admin">ADMIN</span>
Set the system time configuraton. The system can be configured to update the time automatically by setting "automaticTime" to true. This will only work if the "timeManagement" capability is available on this system and "GetTime" indicates the availability of automatic time settings. If any of those requirements are not met, this method will return "false" in the "success" property. In order to manually configure the time, "automaticTime" should be set to false and "time" should be set. Note that if "automaticTime" is set to true and a manual "time" is still passed, the system will attempt to configure automatic time updates and only set the manual time if automatic mode fails. A time zone can always be passed optionally to change the system time zone and should be a IANA time zone id.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `automaticTime` | `Bool` | optionnel |
| `time` | `Uint` | optionnel |
| `timeZone` | `String` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.Shutdown
<span class="badge perm-admin">ADMIN</span>
Initiate a shutdown of the system. The return value will indicate whether the procedure has been initiated successfully.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
### System.UpdatePackages
<span class="badge perm-admin">ADMIN</span>
Starts updating/installing packages with the given ids. Returns true if the upgrade has been started successfully. Note that it might still fail later. Before calling this method, clients should check the packages whether they are in a state where they can either be installed (no installedVersion set) or upgraded (updateAvailable set to true).
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `packageIds` | `String`[] | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
---
## Notifications
### System.CapabilitiesChanged
Emitted whenever the system capabilities change.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `powerManagement` | `Bool` | |
| `updateManagement` | `Bool` | |
| `updateManagementType` | [UpdateType](../types.md#updatetype) | |
---
### System.PackageAdded
Emitted whenever a package is added to the list of packages.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `package` | [Package](../types.md#package) | |
---
### System.PackageChanged
Emitted whenever a package in the list of packages changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `package` | [Package](../types.md#package) | |
---
### System.PackageRemoved
Emitted whenever a package is removed from the list of packages.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `packageId` | `String` | |
---
### System.RepositoryAdded
Emitted whenever a repository is added to the list of repositories.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `repository` | [Repository](../types.md#repository) | |
---
### System.RepositoryChanged
Emitted whenever a repository in the list of repositories changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `repository` | [Repository](../types.md#repository) | |
---
### System.RepositoryRemoved
Emitted whenever a repository is removed from the list of repositories.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `repositoryId` | `String` | |
---
### System.TimeConfigurationChanged
Emitted whenever the time configuration is changed
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `automaticTime` | `Bool` | |
| `automaticTimeAvailable` | `Bool` | |
| `time` | `Uint` | |
| `timeZone` | `String` | |
---
### System.UpdateStatusChanged
Emitted whenever the update status changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `busy` | `Bool` | |
| `updateProgress` | `Int` | optionnel |
| `updateRunning` | `Bool` | |
---
<!-- END GENERATED -->

View File

@ -0,0 +1,69 @@
# Transfers
<!-- BEGIN GENERATED: __api_Transfers__ -->
## Méthodes
### Transfers.CreateUpload
<span class="badge perm-configure">CONFIGURE</span>
Create an upload session on the dedicated transfer connection.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `fileName` | `String` | |
| `size` | `Int` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `fileName` | `String` | |
| `size` | `Int` | |
| `transferId` | `String` | |
| `transferToken` | `String` | |
---
### Transfers.StartDownload
<span class="badge perm-control">CONTROL</span>
Create a download session for a previously announced download.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `downloadId` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `fileName` | `String` | |
| `size` | `Int` | |
| `transferId` | `String` | |
| `transferToken` | `String` | |
---
## Notifications
### Transfers.DownloadAvailable
Emitted when a completed upload can be downloaded on the dedicated transfer connection.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `downloadId` | `String` | |
| `fileName` | `String` | |
| `size` | `Int` | |
---
<!-- END GENERATED -->

285
docs/api/systeme/users.md Normal file
View File

@ -0,0 +1,285 @@
# Users
<!-- BEGIN GENERATED: __api_Users__ -->
## Méthodes
### Users.ChangePassword
<span class="badge perm-admin">ADMIN</span>
Change the password for the currently logged in user.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `newPassword` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### Users.ChangeUserPassword
<span class="badge perm-admin">ADMIN</span>
Change the password for the given user. All tokens for this user will be removed in order to force all clients to log in again.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `newPassword` | `String` | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### Users.CreateUser
<span class="badge perm-admin">ADMIN</span>
Create a new user in the API with the given username and password. Use scopes to define the permissions for the new user. If the user has not the permission "PermissionScopeAccessAllThings", the list of things this user has access to can be defined in the "allowedThingIds" property. If no scopes are given, this user will be an admin user. Call Authenticate after this to obtain a device token for this user.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `allowedThingIds` | `Uuid`[] | optionnel |
| `displayName` | `String` | optionnel |
| `email` | `String` | optionnel |
| `scopes` | [PermissionScopes](../types.md#permissionscopes) | optionnel |
| `password` | `String` | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### Users.GetTokens
<span class="badge perm-admin">ADMIN</span>
Get all the tokens for the current user.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
| `tokenInfoList` | [TokenInfoList](../types.md#tokeninfolist) | optionnel |
---
### Users.GetUserInfo
<span class="badge perm-none">PUBLIC</span>
Get info about the current token (the currently logged in user).
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
| `userInfo` | [UserInfo](../types.md#userinfo) | optionnel |
---
### Users.GetUserTokens
<span class="badge perm-admin">ADMIN</span>
Get all the tokens for the given username.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
| `tokenInfoList` | [TokenInfoList](../types.md#tokeninfolist) | optionnel |
---
### Users.GetUsers
<span class="badge perm-admin">ADMIN</span>
Return a list of all users in the system.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `users` | [UserInfoList](../types.md#userinfolist) | |
---
### Users.RemoveToken
<span class="badge perm-admin">ADMIN</span>
Revoke access for a given token. Depending on the logged in user only the own tokens can be removed. If you are logged in as admin, any token can be removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `tokenId` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### Users.RemoveUser
<span class="badge perm-admin">ADMIN</span>
Remove a user from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### Users.SetUserInfo
<span class="badge perm-admin">ADMIN</span>
Change user info. If username is given, info for the respective user is changed, otherwise the current user info is edited. Requires admin permissions to edit user info other than the own.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayName` | `String` | optionnel |
| `email` | `String` | optionnel |
| `username` | `String` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### Users.SetUserScopes
<span class="badge perm-admin">ADMIN</span>
Set the permissions (scopes) for a given user. If the user has not the permission "PermissionScopeAccessAllThings" the list of thing IDs this user has access to can be defined in the "allowedThingIds" property.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `allowedThingIds` | `Uuid`[] | optionnel |
| `scopes` | [PermissionScopes](../types.md#permissionscopes) | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
## Notifications
### Users.PushButtonAuthFinished
Emitted when a push button authentication reaches final state. NOTE: This notification is special. It will only be emitted to connections that did actively request a push button authentication, but also it will be emitted regardless of the notification settings.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `token` | `String` | optionnel |
| `success` | `Bool` | |
| `transactionId` | `Int` | |
---
### Users.UserAdded
Emitted when a user is added to the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `userInfo` | [UserInfo](../types.md#userinfo) | |
---
### Users.UserChanged
Emitted whenever a user is changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `userInfo` | [UserInfo](../types.md#userinfo) | |
---
### Users.UserRemoved
Emitted when a user is removed from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `username` | `String` | |
---
<!-- END GENERATED -->

382
docs/api/systeme/zigbee.md Normal file
View File

@ -0,0 +1,382 @@
# Zigbee
<!-- BEGIN GENERATED: __api_Zigbee__ -->
## Méthodes
### Zigbee.AddNetwork
<span class="badge perm-admin">ADMIN</span>
Create a new ZigBee network for the given 'serialPort', 'baudRate' and 'backend'. The serial ports can be fetched from the available adapters. See 'GetAdapters' for more information. The available backends can be fetched using the 'GetAvailableBackends' method.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `backend` | `String` | |
| `baudRate` | `Uint` | |
| `channelMask` | `Uint` | optionnel |
| `serialPort` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | optionnel |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.CreateBinding
<span class="badge perm-admin">ADMIN</span>
Create a binding. Use destinationAddress and destinationEndpointId to create a node to node binding, or use destinationGroupAddress to create a group binding.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `clusterId` | `Uint` | |
| `networkUuid` | `Uuid` | |
| `destinationAddress` | `String` | optionnel |
| `destinationEndpointId` | `Uint` | optionnel |
| `destinationGroupAddress` | `Uint` | optionnel |
| `sourceAddress` | `String` | |
| `sourceEndpointId` | `Uint` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.FactoryResetNetwork
<span class="badge perm-admin">ADMIN</span>
Factory reset the network with the given 'networkUuid'. The network does not have to be online for this procedure, and all associated nodes and things will be removed permanently.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.GetAdapters
<span class="badge perm-admin">ADMIN</span>
Get the list of available ZigBee adapters and serial ports in order to set up the ZigBee network on the desired interface. The 'serialPort' property can be used as unique identifier for an adapter. If an adapter hardware has been recognized as a well known ZigBee adapter, the 'hardwareRecognized' property will be true and the 'baudRate' and 'backend' configurations can be used as they where given, otherwise the user might set the backend and baud rate manually. The available backends can be fetched using the GetAvailableBackends method.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `adapters` | [ZigbeeAdapters](../types.md#zigbeeadapters) | |
---
### Zigbee.GetAvailableBackends
<span class="badge perm-admin">ADMIN</span>
Get the list of available ZigBee backends.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `backends` | `String`[] | |
---
### Zigbee.GetNetworks
<span class="badge perm-admin">ADMIN</span>
Returns the list of configured ZigBee networks in the system.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeNetworks` | [ZigbeeNetwork](../types.md#zigbeenetwork)[] | |
---
### Zigbee.GetNodes
<span class="badge perm-admin">ADMIN</span>
Returns the list of ZigBee nodes from the network the given 'networkUuid' in the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeNodes` | [ZigbeeNode](../types.md#zigbeenode)[] | optionnel |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.RefreshBindings
<span class="badge perm-admin">ADMIN</span>
Refresh the binding table for the given node.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ieeeAddress` | `String` | |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.RefreshNeighborTables
<span class="badge perm-admin">ADMIN</span>
Refresh the neighbor table for all nodes. Note that calling this may cause a lot of traffic in the ZigBee network.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.RemoveBinding
<span class="badge perm-admin">ADMIN</span>
Remove a binding.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `clusterId` | `Uint` | |
| `networkUuid` | `Uuid` | |
| `destinationAddress` | `String` | optionnel |
| `destinationEndpointId` | `Uint` | optionnel |
| `destinationGroupAddress` | `Uint` | optionnel |
| `sourceAddress` | `String` | |
| `sourceEndpointId` | `Uint` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.RemoveNetwork
<span class="badge perm-admin">ADMIN</span>
Remove the ZigBee network with the given network uuid.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.RemoveNode
<span class="badge perm-admin">ADMIN</span>
Remove a ZigBee node with the given 'ieeeAddress' from the network with the given 'networkUuid'. If there is a thing configured for this node, also the thing will be removed from the system. The coordinator node cannot be removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `ieeeAddress` | `String` | |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
### Zigbee.SetPermitJoin
<span class="badge perm-admin">ADMIN</span>
Allow or deny nodes to join the network with the given 'networkUuid' for a specific 'duration' in seconds. The duration value has to be between 0 and 255 seconds. The 'permitJoinDuration' property of ZigBee network object indicates how long permit has been enabled and the 'permitJoiningRemaining' indicates the rest of the time. Those values can be used to show a countdown or progressbar. This method can be recalled for resetting the timeout. If the duration is set to 0 seconds, joining will be disabled immediatly for the entire network. The 'shortAddress' is optional and defaults to the broadcast address 0xfffc for all routers in the network. If the short address matches the address of a router node in the network, only that specific router will be able to allow new nodes to join the network. A new node will join to the router with the best link quality index (LQI).
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `duration` | `Uint` | |
| `networkUuid` | `Uuid` | |
| `shortAddress` | `Uint` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeError` | [ZigbeeError](../types.md#zigbeeerror) | |
---
## Notifications
### Zigbee.AdapterAdded
Emitted whenever a new ZigBee adapter or serial port has been detected in the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `adapter` | [ZigbeeAdapter](../types.md#zigbeeadapter) | |
---
### Zigbee.AdapterRemoved
Emitted whenever a ZigBee adapter or serial port has been removed from the system (i.e. unplugged).
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `adapter` | [ZigbeeAdapter](../types.md#zigbeeadapter) | |
---
### Zigbee.NetworkAdded
Emitted whenever a new ZigBee network has been added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeNetwork` | [ZigbeeNetwork](../types.md#zigbeenetwork) | |
---
### Zigbee.NetworkChanged
Emitted whenever a new ZigBee network has changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zigbeeNetwork` | [ZigbeeNetwork](../types.md#zigbeenetwork) | |
---
### Zigbee.NetworkRemoved
Emitted whenever a new ZigBee network has been removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
---
### Zigbee.NodeAdded
Emitted whenever a new ZigBee node has joined the network with the given 'networkUuid'.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
| `zigbeeNode` | [ZigbeeNode](../types.md#zigbeenode) | |
---
### Zigbee.NodeChanged
Emitted whenever a ZigBee node has changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
| `zigbeeNode` | [ZigbeeNode](../types.md#zigbeenode) | |
---
### Zigbee.NodeRemoved
Emitted whenever a ZigBee node has removed from the network with the given 'networkUuid'.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
| `zigbeeNode` | [ZigbeeNode](../types.md#zigbeenode) | |
---
<!-- END GENERATED -->

300
docs/api/systeme/zwave.md Normal file
View File

@ -0,0 +1,300 @@
# ZWave
<!-- BEGIN GENERATED: __api_ZWave__ -->
## Méthodes
### ZWave.AddNetwork
<span class="badge perm-admin">ADMIN</span>
Add a new Z-Wave network with the given serial port.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `serialPort` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | optionnel |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
### ZWave.AddNode
<span class="badge perm-admin">ADMIN</span>
Start the node inclusion procedure for the given Z-Wave network.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
### ZWave.CancelPendingOperation
<span class="badge perm-admin">ADMIN</span>
Cancel any running node inclusion or removal procedure for the given Z-Wave network.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
### ZWave.FactoryResetNetwork
<span class="badge perm-admin">ADMIN</span>
Factory reset the controller for the given Z-Wave network.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
### ZWave.GetNetworks
<span class="badge perm-admin">ADMIN</span>
Get all the Z-Wave networks in the system.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networks` | [ZWaveNetwork](../types.md#zwavenetwork)[] | |
---
### ZWave.GetNodes
<span class="badge perm-admin">ADMIN</span>
Get the list of nodes in a network
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `nodes` | [ZWaveNode](../types.md#zwavenode)[] | optionnel |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
### ZWave.GetSerialPorts
<span class="badge perm-admin">ADMIN</span>
Get the list of available serial ports from the host system.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `serialPorts` | [SerialPorts](../types.md#serialports) | |
---
### ZWave.IsZWaveAvailable
<span class="badge perm-admin">ADMIN</span>
Query if the Z-Wave subsystem is available at all.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `available` | `Bool` | |
---
### ZWave.RemoveFailedNode
<span class="badge perm-admin">ADMIN</span>
Remove the given failed node from the given Z-Wave network. This will not work if node is not marked as failed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
| `nodeId` | `Uint` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
### ZWave.RemoveNetwork
<span class="badge perm-admin">ADMIN</span>
Remove the given Z-Wave network from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
### ZWave.RemoveNode
<span class="badge perm-admin">ADMIN</span>
Start the node removal procedure for the given Z-Wave network.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `zwaveError` | [ZWaveError](../types.md#zwaveerror) | |
---
## Notifications
### ZWave.NetworkAdded
Emitted whenever a new Z-Wave network has been added to the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `network` | [ZWaveNetwork](../types.md#zwavenetwork) | |
---
### ZWave.NetworkChanged
Emitted whenever a Z-Wave network changes.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `network` | [ZWaveNetwork](../types.md#zwavenetwork) | |
---
### ZWave.NetworkRemoved
Emitted whenever a Z-Wave network has been removed from the system.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
---
### ZWave.NodeAdded
Emitted whenever a Z-Wave node is added.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
| `node` | [ZWaveNode](../types.md#zwavenode) | |
---
### ZWave.NodeChanged
Emitted whenever a Z-Wave node has changed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
| `node` | [ZWaveNode](../types.md#zwavenode) | |
---
### ZWave.NodeRemoved
Emitted whenever a Z-Wave node is removed.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `networkUuid` | `Uuid` | |
| `nodeId` | `Uint` | |
---
<!-- END GENERATED -->

1835
docs/api/types.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ Vue d'ensemble des fonctions du HEMS et de leur état réel.
| [Surplus solaire](surplus-solaire.md) | <span class="badge testing">EN COURS</span> | | [Surplus solaire](surplus-solaire.md) | <span class="badge testing">EN COURS</span> |
| [Délestage / Load management](delestage.md) | <span class="badge testing">EN COURS</span> | | [Délestage / Load management](delestage.md) | <span class="badge testing">EN COURS</span> |
| [Gestion batterie](gestion-batterie.md) | <span class="badge testing">EN COURS</span> | | [Gestion batterie](gestion-batterie.md) | <span class="badge testing">EN COURS</span> |
| [API REST](../integrations/rest-api.md) / [MQTT](../integrations/mqtt.md) | <span class="badge stable">DISPONIBLE</span> | | [API JsonRPC](../integrations/jsonrpc-api.md) / [MQTT](../integrations/mqtt.md) | <span class="badge stable">DISPONIBLE</span> |
| Tarifs dynamiques (FR) | <span class="badge nightly">ROADMAP</span> | | Tarifs dynamiques (FR) | <span class="badge nightly">ROADMAP</span> |
| Optimisation CO₂ (RTE) | <span class="badge nightly">ROADMAP</span> | | Optimisation CO₂ (RTE) | <span class="badge nightly">ROADMAP</span> |
| Planificateur de charge | <span class="badge nightly">ROADMAP</span> | | Planificateur de charge | <span class="badge nightly">ROADMAP</span> |

View File

@ -17,7 +17,7 @@ libre (GPL-3.0) et une couche d'optimisation propriétaire.
- [Installation](installation/index.md) — déployer ETM PowerSync via le dépôt APT - [Installation](installation/index.md) — déployer ETM PowerSync via le dépôt APT
- [Fonctionnalités](fonctionnalites/index.md) — ce que fait le HEMS, et son état réel - [Fonctionnalités](fonctionnalites/index.md) — ce que fait le HEMS, et son état réel
- [Compatibilité](appareils/compatibilite.md) — les équipements supportés - [Compatibilité](appareils/compatibilite.md) — les équipements supportés
- [Intégrations](integrations/rest-api.md) — API REST, MQTT, Home Assistant - [Intégrations](integrations/jsonrpc-api.md) — API JsonRPC, MQTT, Home Assistant
## Liens ## Liens

View File

@ -0,0 +1,55 @@
# API JsonRPC <span class="badge ok">Supporté</span>
ETM PowerSync expose l'**API JSON-RPC de nymea** en local, étendue avec les namespaces
ETM (`Energy`, `AirConditioning`, `EvDash`).
---
## Connexion
| Mode | Adresse | Notes |
| --- | --- | --- |
| **TCP brut** | `<ip>:2222` | Le serveur envoie un message de bienvenue JSON (`\n`-délimité) à la connexion |
| **WebSocket** | `ws://<ip>:4444` | Le client envoie `JSONRPC.Hello` en premier |
Chaque message est un objet JSON terminé par `\n`. Les requêtes incluent un champ `id`
(entier) pour apparier la réponse. Les notifications n'ont pas de `id`.
---
## Authentification
1. Appeler [`JSONRPC.Authenticate`](../api/metier/jsonrpc.md#jsonrpcauthenticate) avec
`username`, `password` et `deviceName` → le serveur répond avec un `token`.
2. Inclure le `token` dans chaque requête suivante.
3. Pour recevoir les notifications : appeler `JSONRPC.SetNotificationStatus` avec
`{ "namespaces": ["Energy", "Integrations", ...] }`.
---
## Conventions énergie
| Grandeur | Convention |
| --- | --- |
| Production PV | **valeur négative** (convention producteur) |
| `currentPowerAcquisition` | réseau — positif = import, 0 si export |
| `currentPowerStorage` | batterie — positif = charge, négatif = décharge |
| Totaux d'énergie | en **kWh** |
| Timestamps | en **secondes** (Unix epoch) |
---
## Badges de permission
| Badge | Scope | Description |
| --- | --- | --- |
| <span class="badge perm-none">PUBLIC</span> | `PermissionScopeNone` | Lecture publique, aucun token requis |
| <span class="badge perm-control">CONTROL</span> | `PermissionScopeControlThings` / `ExecuteRules` | Contrôle des appareils et règles |
| <span class="badge perm-configure">CONFIGURE</span> | `PermissionScopeConfigureThings` / `ConfigureRules` | Configuration des intégrations et règles |
| <span class="badge perm-admin">ADMIN</span> | `PermissionScopeAdmin` | Administration système |
---
## Référence complète
→ [Référence API JsonRPC](../api/index.md)

View File

@ -1,6 +0,0 @@
# API REST [Supporté]{.badge .ok}
ETM PowerSync expose l'API JSON-RPC de nymea pour lire l'état du système et le piloter,
en local.
> Stub — authentification, endpoints, exemples de requêtes.

View File

@ -35,3 +35,10 @@
.badge.ok {color:#3fd18a;background:rgba(63,209,138,.12);border:1px solid rgba(63,209,138,.3)} .badge.ok {color:#3fd18a;background:rgba(63,209,138,.12);border:1px solid rgba(63,209,138,.3)}
.badge.part {color:#fec113;background:rgba(254,193,19,.1);border:1px solid rgba(254,193,19,.3)} .badge.part {color:#fec113;background:rgba(254,193,19,.1);border:1px solid rgba(254,193,19,.3)}
.badge.road {color:#8fa9b5;background:rgba(143,169,181,.1);border:1px solid rgba(143,169,181,.3)} .badge.road {color:#8fa9b5;background:rgba(143,169,181,.1);border:1px solid rgba(143,169,181,.3)}
/* permission scope badges (API JsonRPC) */
.badge.perm-none {color:#3fd18a;background:rgba(63,209,138,.12);border:1px solid rgba(63,209,138,.3)}
.badge.perm-control {color:#fec113;background:rgba(254,193,19,.1);border:1px solid rgba(254,193,19,.3)}
.badge.perm-configure {color:#fb923c;background:rgba(251,146,60,.1);border:1px solid rgba(251,146,60,.3)}
.badge.perm-admin {color:#ef4444;background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.3)}
.badge.perm-unknown {color:#94a3b8;background:rgba(148,163,184,.1);border:1px solid rgba(148,163,184,.3)}

4003
introspect.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -76,7 +76,8 @@ nav:
- Tarifs dynamiques: tarifs.md - Tarifs dynamiques: tarifs.md
- Référence: - Référence:
- reference.md - reference.md
- API REST: integrations/rest-api.md - API JsonRPC: integrations/jsonrpc-api.md
- Référence API: api/
- MQTT: integrations/mqtt.md - MQTT: integrations/mqtt.md
- Aide: - Aide:
- Dépannage: depannage.md - Dépannage: depannage.md

View File

@ -0,0 +1,634 @@
#!/usr/bin/env python3
"""
gen_api_reference.py génère la référence API JsonRPC depuis introspect.json.
Lit le dump d'introspection nymea (introspect.json) et produit :
- Une page par namespace dans docs/api/metier/ ou docs/api/systeme/
- docs/api/notifications.md
- docs/api/types.md
- docs/api/index.md (page d'accueil statique — créée si absente, jamais écrasée)
- docs/api/SUMMARY.md (nav literate-nav)
Marqueurs gérés :
<!-- BEGIN GENERATED: __api_<Namespace>__ -->
<!-- BEGIN GENERATED: __api_notifications__ -->
<!-- BEGIN GENERATED: __api_types__ -->
Usage :
python3 scripts/gen_api_reference.py --src introspect.json --docs docs
python3 scripts/gen_api_reference.py --src introspect.json --docs docs --check
"""
from __future__ import annotations
import argparse
import json
import re
import sys
from collections import defaultdict
from pathlib import Path
try:
pass # stdlib only
except ImportError:
pass
# ── Namespaces ────────────────────────────────────────────────────────────────
NS_METIER_ORDER = [
"JSONRPC", "Energy", "Integrations", "AirConditioning", "EvDash",
"Rules", "Scripts", "Tags", "Logging", "AppData",
]
NS_SYSTEM_ORDER = [
"Configuration", "System", "Users", "NetworkManager", "ModbusRtu",
"Debug", "Transfers", "ZWave", "Zigbee",
]
NS_METIER = set(NS_METIER_ORDER)
NS_SYSTEM = set(NS_SYSTEM_ORDER)
# ── Badges permission scope ───────────────────────────────────────────────────
PERM_BADGES: dict[str, str] = {
"PermissionScopeNone":
'<span class="badge perm-none">PUBLIC</span>',
"PermissionScopeControlThings":
'<span class="badge perm-control">CONTROL</span>',
"PermissionScopeExecuteRules":
'<span class="badge perm-control">EXECUTE</span>',
"PermissionScopeConfigureThings":
'<span class="badge perm-configure">CONFIGURE</span>',
"PermissionScopeConfigureRules":
'<span class="badge perm-configure">CONFIGURE-RULES</span>',
"PermissionScopeAdmin":
'<span class="badge perm-admin">ADMIN</span>',
}
MARKER_RE = re.compile(
r"(<!-- BEGIN GENERATED: (?P<key>[^\s]+) -->)(?P<body>.*?)(<!-- END GENERATED -->)",
re.DOTALL,
)
# ── Helpers ───────────────────────────────────────────────────────────────────
def ns_slug(ns: str) -> str:
return ns.lower()
def ns_folder(ns: str) -> str:
return "metier" if ns in NS_METIER else "systeme"
def parse_field_name(raw: str) -> tuple[str, bool, bool]:
"""Strip `o:` / `r:` prefixes. Returns (name, optional, readonly)."""
name, optional, readonly = raw, False, False
while True:
if name.startswith("o:"):
optional = True
name = name[2:]
elif name.startswith("r:"):
readonly = True
name = name[2:]
else:
break
return name, optional, readonly
def render_type(value: object, types_path: str = "../types.md") -> str:
"""Render a type value as Markdown, resolving $ref to a clickable link."""
if isinstance(value, list):
inner = render_type(value[0], types_path) if value else "`?`"
return f"{inner}[]"
if isinstance(value, str):
if value.startswith("$ref:"):
type_name = value[5:]
anchor = type_name.lower()
return f"[{type_name}]({types_path}#{anchor})"
return f"`{value}`"
return f"`{value!s}`"
def render_type_self(value: object) -> str:
"""Like render_type but for self-referencing anchors (types page)."""
if isinstance(value, list):
inner = render_type_self(value[0]) if value else "`?`"
return f"{inner}[]"
if isinstance(value, str):
if value.startswith("$ref:"):
type_name = value[5:]
anchor = type_name.lower()
return f"[{type_name}](#{anchor})"
return f"`{value}`"
return f"`{value!s}`"
def render_fields_table(fields: dict, types_path: str = "../types.md") -> str:
"""Render a params/returns dict as a Markdown table. Returns trailing newline."""
if not fields:
return "_Aucun paramètre._\n"
rows = []
for raw_name in sorted(fields):
value = fields[raw_name]
name, optional, readonly = parse_field_name(raw_name)
type_str = render_type(value, types_path)
notes = []
if optional:
notes.append("optionnel")
if readonly:
notes.append("lecture seule")
rows.append([f"`{name}`", type_str, " · ".join(notes)])
lines = [
"| Champ | Type | Notes |",
"| --- | --- | --- |",
]
for r in rows:
lines.append("| " + " | ".join(r) + " |")
return "\n".join(lines) + "\n"
# ── Rendu d'une méthode ───────────────────────────────────────────────────────
def render_method(name: str, method: dict, types_path: str) -> str:
perm = method.get("permissionScope", "")
badge = PERM_BADGES.get(perm)
if not badge:
badge = f'<span class="badge perm-unknown">{perm or "inconnu"}</span>'
print(f" INFO : permissionScope inconnu '{perm}' pour {name}", file=sys.stderr)
desc = method.get("description", "").strip()
params = method.get("params") or {}
returns = method.get("returns") or {}
parts: list[str] = []
parts.append(f"### {name}")
parts.append("")
parts.append(badge)
parts.append("")
if desc:
parts.append(desc)
parts.append("")
parts.append("**Paramètres :**")
parts.append("")
parts.append(render_fields_table(params, types_path).rstrip())
parts.append("")
parts.append("**Retour :**")
parts.append("")
parts.append(render_fields_table(returns, types_path).rstrip())
parts.append("")
parts.append("---")
parts.append("")
return "\n".join(parts)
# ── Contenu des blocs générés ─────────────────────────────────────────────────
def render_namespace_content(
ns: str,
methods: dict,
notifications: dict,
types_path: str,
) -> str:
"""Contenu du bloc BEGIN/END d'une page namespace."""
ns_methods = {k: v for k, v in methods.items() if k.startswith(ns + ".")}
ns_notifs = {k: v for k, v in notifications.items() if k.startswith(ns + ".")}
parts: list[str] = []
if ns_methods:
parts.append("## Méthodes")
parts.append("")
for name in sorted(ns_methods):
parts.append(render_method(name, ns_methods[name], types_path))
if ns_notifs:
parts.append("## Notifications")
parts.append("")
for name in sorted(ns_notifs):
notif = ns_notifs[name]
desc = notif.get("description", "").strip()
notif_params = notif.get("params") or {}
parts.append(f"### {name}")
parts.append("")
if desc:
parts.append(desc)
parts.append("")
parts.append("**Paramètres :**")
parts.append("")
parts.append(render_fields_table(notif_params, types_path).rstrip())
parts.append("")
parts.append("---")
parts.append("")
return "\n".join(parts).rstrip() + "\n"
def render_notifications_content(notifications: dict, types_path: str = "types.md") -> str:
"""Contenu du bloc BEGIN/END de la page Notifications."""
by_ns: dict[str, dict] = defaultdict(dict)
for k, v in notifications.items():
ns = k.split(".")[0]
by_ns[ns][k] = v
all_ns_sorted = sorted(
by_ns.keys(),
key=lambda x: (0 if x in NS_METIER else 1, x),
)
parts: list[str] = []
for ns in all_ns_sorted:
parts.append(f"## {ns}")
parts.append("")
for name in sorted(by_ns[ns]):
notif = by_ns[ns][name]
desc = notif.get("description", "").strip()
notif_params = notif.get("params") or {}
parts.append(f"### {name}")
parts.append("")
if desc:
parts.append(desc)
parts.append("")
parts.append("**Paramètres :**")
parts.append("")
parts.append(render_fields_table(notif_params, types_path).rstrip())
parts.append("")
parts.append("---")
parts.append("")
return "\n".join(parts).rstrip() + "\n"
def render_types_content(types: dict, enums: dict, flags: dict) -> str:
"""Contenu du bloc BEGIN/END de la page Types & Enums."""
parts: list[str] = []
# Types (objets et listes)
parts.append("## Types")
parts.append("")
for name in sorted(types):
anchor = name.lower()
defn = types[name]
parts.append(f'### {name} {{#{anchor}}}')
parts.append("")
if isinstance(defn, list):
inner = render_type_self(defn[0]) if defn else "`?`"
parts.append(f"Liste de {inner}.")
parts.append("")
elif isinstance(defn, dict):
rows = []
for raw_name in sorted(defn):
value = defn[raw_name]
field_name, optional, readonly = parse_field_name(raw_name)
type_str = render_type_self(value)
notes = []
if optional:
notes.append("optionnel")
if readonly:
notes.append("lecture seule")
rows.append([f"`{field_name}`", type_str, " · ".join(notes)])
lines = ["| Champ | Type | Notes |", "| --- | --- | --- |"]
for r in rows:
lines.append("| " + " | ".join(r) + " |")
parts.append("\n".join(lines))
parts.append("")
else:
parts.append(f"`{defn}`")
parts.append("")
parts.append("---")
parts.append("")
# Enums
parts.append("## Enums")
parts.append("")
for name in sorted(enums):
anchor = name.lower()
values = enums[name]
parts.append(f'### {name} {{#{anchor}}}')
parts.append("")
if isinstance(values, list):
for v in values:
if isinstance(v, str) and v.startswith("$ref:"):
parts.append(f"- {render_type_self(v)}")
else:
parts.append(f"- `{v}`")
parts.append("")
parts.append("---")
parts.append("")
# Flags
if flags:
parts.append("## Flags")
parts.append("")
for name in sorted(flags):
anchor = name.lower()
values = flags[name]
parts.append(f'### {name} {{#{anchor}}}')
parts.append("")
if isinstance(values, list):
for v in values:
if isinstance(v, str) and v.startswith("$ref:"):
parts.append(f"- {render_type_self(v)}")
else:
parts.append(f"- `{v}`")
parts.append("")
parts.append("---")
parts.append("")
return "\n".join(parts).rstrip() + "\n"
# ── Construction des pages complètes ─────────────────────────────────────────
def build_namespace_page(ns: str, methods: dict, notifications: dict) -> str:
"""Page namespace complète (pour ensure_pages — doit correspondre à process())."""
gen = render_namespace_content(ns, methods, notifications, types_path="../types.md")
block = f"<!-- BEGIN GENERATED: __api_{ns}__ -->\n{gen}\n<!-- END GENERATED -->"
return f"# {ns}\n\n{block}\n"
def build_notifications_page(notifications: dict) -> str:
gen = render_notifications_content(notifications, types_path="types.md")
block = f"<!-- BEGIN GENERATED: __api_notifications__ -->\n{gen}\n<!-- END GENERATED -->"
return f"# Notifications\n\n{block}\n"
def build_types_page(types: dict, enums: dict, flags: dict) -> str:
gen = render_types_content(types, enums, flags)
block = f"<!-- BEGIN GENERATED: __api_types__ -->\n{gen}\n<!-- END GENERATED -->"
return f"---\nhide:\n - toc\n---\n\n# Types & Enums\n\n{block}\n"
INDEX_PAGE_CONTENT = """\
---
hide:
- toc
---
# Référence API JsonRPC
ETM PowerSync expose l'**API JSON-RPC de nymea** en local, y compris les extensions ETM
(`Energy`, `AirConditioning`, `EvDash`).
## Connexion
| Mode | Adresse | Notes |
| --- | --- | --- |
| **TCP brut** | `<ip>:2222` | nymea parle en premier (welcome JSON `\\n`-delimited) |
| **WebSocket** | `ws://<ip>:4444` | le client envoie `JSONRPC.Hello` en premier |
## Authentification
1. Appeler [`JSONRPC.Authenticate`](metier/jsonrpc.md#jsonrpcauthenticate) avec
`username`, `password` et `deviceName` reçoit un `token`.
2. Inclure le `token` dans chaque requête suivante.
3. Activer les push : `JSONRPC.SetNotificationStatus` `{ "enabled": true }`.
## Conventions énergie
| Grandeur | Convention |
| --- | --- |
| Production PV | **valeur négative** (convention producteur) |
| `currentPowerAcquisition` | réseau positif = import, 0 si export |
| `currentPowerStorage` | batterie positif = charge, négatif = décharge |
| Totaux d'énergie | en **kWh** |
| Timestamps | en **secondes** (Unix epoch) |
## Badges de permission
| Badge | Scope | Description |
| --- | --- | --- |
| <span class="badge perm-none">PUBLIC</span> | `PermissionScopeNone` | Lecture publique, aucun token requis |
| <span class="badge perm-control">CONTROL</span> | `PermissionScopeControlThings` / `ExecuteRules` | Contrôle des appareils et règles |
| <span class="badge perm-configure">CONFIGURE</span> | `PermissionScopeConfigureThings` / `ConfigureRules` | Configuration |
| <span class="badge perm-admin">ADMIN</span> | `PermissionScopeAdmin` | Administration système |
"""
# ── SUMMARY.md (literate-nav) ─────────────────────────────────────────────────
def generate_summary(all_ns: list[str], docs: Path, check: bool) -> int:
"""Génère docs/api/SUMMARY.md pour literate-nav. Retourne 1 si périmé en --check."""
metier_ns = [ns for ns in NS_METIER_ORDER if ns in set(all_ns)]
system_ns = [ns for ns in NS_SYSTEM_ORDER if ns in set(all_ns)]
unknown_ns = sorted(ns for ns in all_ns if ns not in NS_METIER and ns not in NS_SYSTEM)
if unknown_ns:
for ns in unknown_ns:
print(f" INFO : namespace '{ns}' non classé → groupe systeme par défaut",
file=sys.stderr)
lines = ["* [Référence API](index.md)"]
if metier_ns:
lines.append("* API — Métier")
for ns in metier_ns:
lines.append(f" * [{ns}](metier/{ns_slug(ns)}.md)")
if system_ns or unknown_ns:
lines.append("* API — Système")
for ns in system_ns + unknown_ns:
lines.append(f" * [{ns}](systeme/{ns_slug(ns)}.md)")
lines.append("* [Notifications](notifications.md)")
lines.append("* [Types & Enums](types.md)")
new_content = "\n".join(lines) + "\n"
path = docs / "api" / "SUMMARY.md"
if check:
if not path.exists() or path.read_text(encoding="utf-8") != new_content:
print(f" SUMMARY.md périmé : {path.relative_to(docs.parent)}")
return 1
return 0
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(new_content, encoding="utf-8")
print(f"SUMMARY.md → {path.relative_to(docs.parent)}")
return 0
# ── Création des fichiers manquants ───────────────────────────────────────────
def ensure_pages(data: dict, docs: Path, check: bool) -> int:
"""Crée les pages API inexistantes. Retourne 1 si manquant en mode --check."""
methods = data["methods"]
notifications = data["notifications"]
types_d = data["types"]
enums = data["enums"]
flags = data["flags"]
all_ns = data["_all_ns"]
rc = 0
# Pages namespace
for ns in all_ns:
folder = ns_folder(ns)
path = docs / "api" / folder / f"{ns_slug(ns)}.md"
if path.exists():
continue
content = build_namespace_page(ns, methods, notifications)
if check:
print(f" MANQUANT : {path.relative_to(docs.parent)}")
rc = 1
else:
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(content, encoding="utf-8")
print(f" CRÉÉ : {path.relative_to(docs.parent)}")
# Notifications
notif_path = docs / "api" / "notifications.md"
if not notif_path.exists():
content = build_notifications_page(notifications)
if check:
print(f" MANQUANT : {notif_path.relative_to(docs.parent)}")
rc = 1
else:
notif_path.parent.mkdir(parents=True, exist_ok=True)
notif_path.write_text(content, encoding="utf-8")
print(f" CRÉÉ : {notif_path.relative_to(docs.parent)}")
# Types
types_path = docs / "api" / "types.md"
if not types_path.exists():
content = build_types_page(types_d, enums, flags)
if check:
print(f" MANQUANT : {types_path.relative_to(docs.parent)}")
rc = 1
else:
types_path.parent.mkdir(parents=True, exist_ok=True)
types_path.write_text(content, encoding="utf-8")
print(f" CRÉÉ : {types_path.relative_to(docs.parent)}")
# Index (statique — créé une fois, jamais écrasé)
index_path = docs / "api" / "index.md"
if not index_path.exists():
if check:
print(f" MANQUANT : {index_path.relative_to(docs.parent)}")
rc = 1
else:
index_path.parent.mkdir(parents=True, exist_ok=True)
index_path.write_text(INDEX_PAGE_CONTENT, encoding="utf-8")
print(f" CRÉÉ : {index_path.relative_to(docs.parent)}")
return rc
# ── Injection dans les marqueurs ──────────────────────────────────────────────
def process(docs: Path, data: dict, check: bool) -> int:
"""Injecte le contenu généré dans les marqueurs BEGIN/END des pages API."""
methods = data["methods"]
notifications = data["notifications"]
types_d = data["types"]
enums = data["enums"]
flags = data["flags"]
all_ns_set = set(data["_all_ns"])
changed: list[Path] = []
api_dir = docs / "api"
for md in sorted(api_dir.rglob("*.md")):
if md.name == "SUMMARY.md":
continue
text = md.read_text(encoding="utf-8")
if "<!-- BEGIN GENERATED:" not in text:
continue
def repl(m: re.Match, _md: Path = md) -> str:
key = m.group("key")
if key == "__api_notifications__":
gen = render_notifications_content(notifications, types_path="types.md")
elif key == "__api_types__":
gen = render_types_content(types_d, enums, flags)
elif key.startswith("__api_"):
ns = key.removeprefix("__api_").removesuffix("__")
if ns not in all_ns_set:
print(f" ! {_md.name}: namespace '{ns}' absent d'introspect.json",
file=sys.stderr)
return m.group(0)
# Détermine le chemin relatif vers types.md selon la profondeur du fichier
t = "../types.md" if _md.parent.name in ("metier", "systeme") else "types.md"
gen = render_namespace_content(ns, methods, notifications, types_path=t)
else:
print(f" ! {_md.name}: clé inconnue '{key}'", file=sys.stderr)
return m.group(0)
return f"{m.group(1)}\n{gen}\n{m.group(4)}"
new = MARKER_RE.sub(repl, text)
if new != text:
changed.append(md)
if not check:
md.write_text(new, encoding="utf-8")
if check:
if changed:
print("Doc PAS à jour :", ", ".join(str(c) for c in changed))
return 1
print("Doc à jour.")
return 0
print(f"Régénéré : {len(changed)} page(s).")
for c in changed:
print(f" - {c.relative_to(docs)}")
return 0
# ── Chargement du dump ────────────────────────────────────────────────────────
def load_introspect(src: Path) -> dict:
if not src.exists():
sys.exit(f"ERREUR : {src} introuvable")
raw = src.read_text(encoding="utf-8").strip()
if not raw:
sys.exit(f"ERREUR : {src} est vide")
try:
d = json.loads(raw)
except json.JSONDecodeError as exc:
sys.exit(f"ERREUR : {src} non parsable : {exc}")
try:
params = d["params"]
methods = params["methods"]
notifications = params["notifications"]
types_d = params["types"]
enums = params.get("enums", {})
flags = params.get("flags", {})
except KeyError as exc:
sys.exit(f"ERREUR : clé manquante dans introspect.json : {exc}")
for key, val in [("methods", methods), ("notifications", notifications),
("types", types_d)]:
if not isinstance(val, dict):
sys.exit(f"ERREUR : introspect.json params.{key} n'est pas un objet")
all_ns = sorted(
{k.split(".")[0] for k in methods} | {k.split(".")[0] for k in notifications}
)
print(f"{len(methods)} méthodes · {len(notifications)} notifications · "
f"{len(types_d)} types · {len(enums)} enums · {len(flags)} flags · "
f"{len(all_ns)} namespaces")
return {
"methods": methods,
"notifications": notifications,
"types": types_d,
"enums": enums,
"flags": flags,
"_all_ns": all_ns,
}
# ── Point d'entrée ────────────────────────────────────────────────────────────
def main() -> int:
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument("--src", default="introspect.json", type=Path,
help="Chemin vers introspect.json (défaut : introspect.json)")
ap.add_argument("--docs", default="docs", type=Path,
help="Dossier docs/ (défaut : docs)")
ap.add_argument("--check", action="store_true",
help="CI : exit 1 si la doc n'est pas à jour")
a = ap.parse_args()
data = load_introspect(a.src)
rc_pages = ensure_pages(data, a.docs, a.check)
rc_summary = generate_summary(data["_all_ns"], a.docs, a.check)
rc_process = process(a.docs, data, a.check)
return max(rc_pages, rc_summary, rc_process)
if __name__ == "__main__":
raise SystemExit(main())

View File

@ -0,0 +1,100 @@
#!/usr/bin/env python3
"""Introspection JsonRPC de nymea via WebSocket (port 4444) avec authentification.
Séquence (comme le NymeaService Flutter) :
1. WebSocket connect ws://host:4444
2. JSONRPC.Hello -> welcome (authenticationRequired ?)
3. JSONRPC.Authenticate -> token (si auth requise)
4. JSONRPC.Introspect -> la référence complète de l'API
Le token est ensuite inclus dans chaque requête.
Usage:
pip3 install websockets --break-system-packages
python3 nymea_introspect_ws.py <host> <user> <password> > introspect.json
Le welcome + la liste des méthodes vont sur stderr ; le JSON d'introspection sur stdout.
"""
import asyncio, json, sys
host = sys.argv[1] if len(sys.argv) > 1 else "127.0.0.1"
user = sys.argv[2] if len(sys.argv) > 2 else ""
pwd = sys.argv[3] if len(sys.argv) > 3 else ""
port = 4444
try:
import websockets
except ImportError:
sys.stderr.write("ERREUR: pip3 install websockets --break-system-packages\n")
sys.exit(2)
def err(msg):
sys.stderr.write(msg + "\n")
async def main():
uri = f"ws://{host}:{port}"
err(f"== Connexion {uri} ==")
async with websockets.connect(uri, max_size=None) as ws:
rid = 0
token = ""
async def call(method, params=None):
nonlocal rid
rid += 1
msg = {"id": rid, "method": method, "params": params or {}}
if token:
msg["token"] = token
await ws.send(json.dumps(msg))
# lire jusqu'à trouver la réponse à ce rid (ignorer notifications)
while True:
raw = await ws.recv()
data = json.loads(raw)
if data.get("id") == rid:
return data
# sinon c'est une notification, on continue
# 1. Hello
hello = await call("JSONRPC.Hello")
err("== WELCOME ==")
err(json.dumps(hello, indent=2)[:2000])
p = hello.get("params", hello)
auth_required = p.get("authenticationRequired", False)
already_auth = p.get("authenticated", False)
# 2. Authenticate si nécessaire
if auth_required and not already_auth:
if not user:
err("\n!! Auth requise mais pas d'identifiants. "
"Usage: python3 ... <host> <user> <password>")
sys.exit(3)
err(f"\n== Authenticate user={user} ==")
a = await call("JSONRPC.Authenticate", {
"username": user,
"password": pwd,
"deviceName": "etm-docs-introspect",
})
ap = a.get("params", {})
token = ap.get("token", "")
if not token:
err("!! Authentification échouée: " + json.dumps(ap)[:500])
sys.exit(4)
err("== Token obtenu ==")
# 3. Introspect
err("\n== Introspect ==")
intro = await call("JSONRPC.Introspect")
# résumé sur stderr
ip = intro.get("params", intro)
methods = ip.get("methods", {})
notifs = ip.get("notifications", {})
types = ip.get("types", {})
err(f" méthodes: {len(methods)}")
err(f" notifications: {len(notifs)}")
err(f" types: {len(types)}")
if methods:
err("\n== Liste des méthodes ==")
for m in sorted(methods.keys()):
err(" " + m)
# JSON complet sur stdout
print(json.dumps(intro, indent=2, ensure_ascii=False))
asyncio.run(main())