| name | rule-creator |
| description | Enapter Rule Engine skill covering rule concepts, Lua Rule API (v1 and v3), device automation, and use-case patterns. Use for any Enapter Rule development task. |
Enapter Rule Skill
Consolidated skill for writing Enapter Rules. Use decision trees below to find the appropriate information, then load detailed references.
Workflow
- Confirm the target Enapter Gateway AND Rule Engine version.
- If unfamiliar with rules, read
references/overview.md first.
- Load
references/v1/README.md or references/v3/README.md matching the Rule Engine version.
- If the rule controls a specific device, read
references/devices/README.md.
- Write the rule as a single Lua script following the patterns and gotchas in the loaded version reference.
Quick Decision Trees
"What is a rule, and which Rule Engine version do I need?"
Which Gateway version is this rule for?
├─ Gateway 2.x.x
│ └─ ONLY Rule Engine v1 is supported → references/v1/README.md
├─ Gateway 3.x.x
│ ├─ User explicitly asked for v1 (literally names "v1"/"Rule API v1") → references/v1/README.md
│ ├─ Rule is being ported/migrated/kept-behaving-the-same from a Gateway 2.x.x rule,
│ │ even if the user never says "v1" → references/v1/README.md (v1 and v3 are NOT API-compatible,
│ │ so "same behavior" from a 2.x rule means the same v1 API, not a v3 rewrite)
│ ├─ User explicitly asked for v3 → references/v3/README.md
│ └─ User has no preference / unsure / new rule with no 2.x history → default to v3 → references/v3/README.md
└─ Not sure / need concepts first → references/overview.md
v1 and v3 are not API-compatible — a rule written for one will not run unmodified on the other.
"I need to write a rule"
Need to write a Rule Engine rule?
├─ General API reference (enapter, storage, time, json, ...) → references/v1/api.md or references/v3/api.md
├─ Common patterns (scheduling, state machines, PID-style control) → references/v1/patterns.md or references/v3/patterns.md
├─ Troubleshooting / known pitfalls → references/v1/gotchas.md or references/v3/gotchas.md
├─ Rule needs to read telemetry or run commands on a device → references/devices/README.md
└─ Similar automation already solved by Enapter → references/overview.md "Use Cases"
"I need to control a device from a rule"
Which kind of device?
├─ Native Enapter device (electrolyser, dryer, etc.) → references/devices/README.md, then references/v1/api.md or references/v3/api.md "Devices" section
└─ Third-party device integrated via Enapter Blueprint → references/devices/README.md, then use the blueprint-creator skill
to understand what telemetry/commands that specific blueprint exposes
Reference Index