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

6.6 KiB

Rules

Méthodes

Rules.AddRule

CONFIGURE-RULES

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[]
name String
enabled Bool optionnel
eventDescriptors EventDescriptor[] optionnel
executable Bool optionnel
exitActions RuleAction[] optionnel
stateEvaluator StateEvaluator optionnel
timeDescriptor TimeDescriptor optionnel

Retour :

Champ Type Notes
ruleId Uuid optionnel
ruleError RuleError

Rules.DisableRule

CONFIGURE-RULES

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

Rules.EditRule

CONFIGURE-RULES

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[]
name String
enabled Bool optionnel
eventDescriptors EventDescriptor[] optionnel
executable Bool optionnel
exitActions RuleAction[] optionnel
stateEvaluator StateEvaluator optionnel
timeDescriptor TimeDescriptor optionnel
ruleId Uuid

Retour :

Champ Type Notes
rule Rule optionnel
ruleError RuleError

Rules.EnableRule

CONFIGURE-RULES

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

Rules.ExecuteActions

EXECUTE

Execute the action list of the rule with the given ruleId.

Paramètres :

Champ Type Notes
ruleId Uuid

Retour :

Champ Type Notes
ruleError RuleError

Rules.ExecuteExitActions

EXECUTE

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

Rules.FindRules

EXECUTE

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

EXECUTE

Get details for the rule identified by ruleId

Paramètres :

Champ Type Notes
ruleId Uuid

Retour :

Champ Type Notes
rule Rule optionnel
ruleError RuleError

Rules.GetRules

EXECUTE

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[]

Rules.RemoveRule

CONFIGURE-RULES

Remove a rule

Paramètres :

Champ Type Notes
ruleId Uuid

Retour :

Champ Type Notes
ruleError 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

Rules.RuleConfigurationChanged

Emitted whenever the configuration of a Rule changed.

Paramètres :

Champ Type Notes
rule Rule

Rules.RuleRemoved

Emitted whenever a Rule was removed.

Paramètres :

Champ Type Notes
ruleId Uuid