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

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

274 lines
6.6 KiB
Markdown

# 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 -->