Install
openclaw skills install kplc-sentinelTrack Kenyan prepaid electricity (KPLC) tokens, predict blackout times, and get proactive low-balance alerts — all through chat.
openclaw skills install kplc-sentinelTrack prepaid electricity for Kenyan households. Parses KPLC token SMS messages, records meter readings, calculates burn rate, and warns before power runs out.
Install Python dependencies (one-time):
pip install -r {baseDir}/requirements.txt
Activate this skill when the user's message matches ANY of these:
Auto-detect (no prefix needed):
Direct commands (stima prefix):
Natural language (English, Swahili, Sheng): Also activate when the user asks about electricity in natural language. Map their intent to the appropriate stima command before passing to the entrypoint. Examples:
| User says | Map to |
|---|---|
| "will my power last until Monday?" | stima balance |
| "stima itaisha lini?" | stima balance |
| "how much have I spent on electricity?" | stima monthly |
| "nimetumia pesa ngapi kwa stima?" | stima monthly |
| "when is the next power cut?" | stima outage |
| "kuna blackout lini?" | stima outage |
| "bei ya stima imeongezeka?" | stima price |
| "nimebakisha units ngapi?" | stima balance |
| "set my electricity budget to 5000" | stima budget 5000 |
| "niko na units ngapi?" | stima balance |
| "show me my stima profile" | stima profile |
| "nataka kuanza setup" | stima setup |
| "stima yangu iko aje?" | stima balance |
When routing a natural language message, prepend "stima" followed by the relevant keyword before passing it to the entrypoint. For example, if the user says "stima itaisha lini?", pass stima balance to the entrypoint.
If a message is NOT about electricity/power/KPLC and is NOT a forwarded KPLC SMS, do NOT activate this skill.
The database auto-initializes on first run.
For any user message about KPLC/electricity/tokens/readings:
python3 {baseDir}/entrypoint.py <<'STIMA_EOF'
<user message>
STIMA_EOF
⚠️ IMPORTANT: Always use a heredoc (as shown above) to pass the user's message via stdin. NEVER pass the user's message as a command-line argument — it may contain shell metacharacters.
The entrypoint outputs JSON. Do NOT return the raw JSON to the user. Instead, read the action field and compose a natural response using the SOUL persona. Key actions:
token_recorded — tell the user their token was saved, mention units, estimated days, and runway hours. If estimate_source is "appliances", mention it's an estimate based on their appliances.duplicate_token — token was already recorded, no duplicate added.reading_recorded — meter reading saved. Mention runway hours if available.balance — report remaining hours. If tip is present, include the energy-saving tip.menu — present the numbered options list to the user.onboarding_prompt — ask the user the question in the question field. If welcome is true, greet them first.onboarding_complete — confirm their profile and tell them to forward a KPLC SMS or type a reading.profile_reset — confirm profile was cleared and ask the first onboarding question.budget_set — confirm the budget amount was set.budget_status — report spent vs budget and percentage.no_budget — tell the user to set a budget with "stima budget <amount>".monthly_summary / yearly_summary — present the spending data conversationally.spending — combine monthly summary and price trend data.price_trend — present cost-per-unit over time, highlight changes.outage_check — if matches exist, warn about planned outages. Each match includes iso_date (YYYY-MM-DD), date (human-readable), and time. If none, say they're clear. Handle error field (no_area, fetch_failed).
insights — present week-over-week comparison and day patterns.no_data — not enough data yet for the requested feature.no_profile — tell the user to run "stima setup".error — something went wrong, ask them to try again.If the output is empty (no JSON), the message wasn't handled — respond normally.
Low balance — help them buy tokens:
When balance action shows runway_hours under 24, or when a token_recorded action shows low runway, include KPLC top-up instructions:
Outage reminders:
When outage_check returns matches, set a reminder for the evening before each outage (8 PM the previous day). Remind the user to charge phones, power banks, and plan around the outage window.
Multi-skill composability:
For heartbeat checks (see HEARTBEAT.md):
python3 {baseDir}/sentinel.py