Patrick Schurig 4a7a1bddf4
All checks were successful
Build & Deploy docs / build-deploy (push) Successful in 4m0s
api : référence régénérée depuis le banc en 1.15.2+etm71 (droits NymeaEnergy.* séparés, GetOptimizerProtocol)
Le badge PUBLIC de PermissionScopeNone devient AUTH : sur un transport
authentifié, nymea exige un token valide pour toute méthode sauf
JSONRPC.Hello, Authenticate et RequestPushButtonAuth
(jsonrpcserverimplementation.cpp, tag 1.15.2). « Lecture publique, aucun
token requis » était faux, en trois langues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 08:49:15 +02:00

176 lines
4.4 KiB
Markdown

# Energy
<!-- BEGIN GENERATED: __api_Energy__ -->
## Methods
### Energy.GetPowerBalance
<span class="badge perm-none">AUTH</span>
Get the current power balance. That is, production, consumption and acquisition.
**Parameters:**
_No parameters._
**Returns:**
| Field | 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">AUTH</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.
**Parameters:**
| Field | Type | Notes |
| --- | --- | --- |
| `from` | `Uint` | optional |
| `to` | `Uint` | optional |
| `sampleRate` | [SampleRate](../types.md#samplerate) | |
**Returns:**
| Field | Type | Notes |
| --- | --- | --- |
| `powerBalanceLogEntries` | [PowerBalanceLogEntries](../types.md#powerbalancelogentries) | |
---
### Energy.GetRootMeter
<span class="badge perm-none">AUTH</span>
Get the root meter ID. If there is no root meter set, the params will be empty.
**Parameters:**
_No parameters._
**Returns:**
| Field | Type | Notes |
| --- | --- | --- |
| `rootMeterThingId` | `Uuid` | optional |
---
### Energy.GetThingPowerLogs
<span class="badge perm-none">AUTH</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.
**Parameters:**
| Field | Type | Notes |
| --- | --- | --- |
| `from` | `Uint` | optional |
| `includeCurrent` | `Bool` | optional |
| `thingIds` | `Uuid`[] | optional |
| `to` | `Uint` | optional |
| `sampleRate` | [SampleRate](../types.md#samplerate) | |
**Returns:**
| Field | Type | Notes |
| --- | --- | --- |
| `currentEntries` | [ThingPowerLogEntries](../types.md#thingpowerlogentries) | optional |
| `thingPowerLogEntries` | [ThingPowerLogEntries](../types.md#thingpowerlogentries) | |
---
### Energy.SetRootMeter
<span class="badge perm-admin">ADMIN</span>
Set the root meter.
**Parameters:**
| Field | Type | Notes |
| --- | --- | --- |
| `rootMeterThingId` | `Uuid` | |
**Returns:**
| Field | 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.
**Parameters:**
| Field | 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.
**Parameters:**
| Field | 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.
**Parameters:**
| Field | Type | Notes |
| --- | --- | --- |
| `rootMeterThingId` | `Uuid` | optional |
---
### Energy.ThingPowerLogEntryAdded
Emitted whenever an entry is added to the thing power log.
**Parameters:**
| Field | Type | Notes |
| --- | --- | --- |
| `sampleRate` | [SampleRate](../types.md#samplerate) | |
| `thingPowerLogEntry` | [ThingPowerLogEntry](../types.md#thingpowerlogentry) | |
---
<!-- END GENERATED -->