Skip to content

Add enphase solar monitor#189

Closed
ammyyou112 wants to merge 5 commits intoopenhome-dev:devfrom
ammyyou112:add-enphase-solar-monitor
Closed

Add enphase solar monitor#189
ammyyou112 wants to merge 5 commits intoopenhome-dev:devfrom
ammyyou112:add-enphase-solar-monitor

Conversation

@ammyyou112
Copy link
Contributor

What does this Ability do?

Voice-activated solar monitoring for Enphase IQ Gateway systems. Users can check real-time solar production, battery status, consumption, and grid import/export with natural voice commands.

Suggested Trigger Words

  • "solar"
  • "how's my solar"
  • "solar status"
  • "solar production"
  • "battery level"
  • "battery status"
  • "am I exporting"
  • "grid status"
  • "solar today"
  • "enphase"
  • "solar panels"

Type

  • New community Ability
  • Improvement to existing Ability
  • Bug fix
  • Documentation update

External APIs

  • No external APIs
  • Uses external API(s):
    • Enphase Cloud API v4 (requires OAuth 2.0 authentication)
    • Endpoints: /systems/{system_id}/summary, /systems/{system_id}/encharge, /systems/{system_id}/consumption_stats
    • Requires: System ID, API key, OAuth client ID/secret, access/refresh tokens

Testing

  • Tested in OpenHome Live Editor
  • All exit paths tested (said "stop", "exit", etc.)
  • Error scenarios tested (API down, bad input, etc.)

Checklist

  • Files are in community/enphase-solar-monitor/
  • main.py follows SDK pattern (extends MatchingCapability, has register_capability + call)
  • README.md included with description, suggested triggers, and setup
  • resume_normal_flow() called on every exit path
  • No print() — using editor_logging_handler
  • No hardcoded API keys — using placeholders
  • No blocked imports (redis, connection_manager, user_config)
  • No asyncio.sleep() or asyncio.create_task() — using session_tasks
  • Error handling on all external calls
  • Tested in OpenHome Live Editor

Anything else?

Demo Mode Included:
The ability includes a DEMO_MODE = True flag that returns realistic fake data for testing without real Enphase credentials. Perfect for trying out the conversation flow before connecting a real system.

Features:

  • 15-minute data caching to minimize API calls
  • OAuth token auto-refresh
  • Multi-intent classification (production, battery, consumption, grid status)
  • Voice-optimized formatting ("kilowatts" not "kW")
  • Conversational loop with context awareness

Conversation Example:

User: "enphase"
Assistant: "Sure! Let me check your solar system."
Assistant: "You're producing 4.2 kilowatts right now."
Assistant: "Today you've generated 28.0 kilowatt hours."
Assistant: "Your battery is at 73 percent and charging."
User: "what about consumption?"
Assistant: "You're using 3.1 kilowatts right now."
User: "stop"
Assistant: "Okay, talk to you later!"

Loom Demo: https://www.loom.com/share/0ae21d6369eb4310bc96446dd5f5923c


---

## 📋 **Files to Include in PR:**

community/enphase-solar-monitor/
├── main.py
└── README.md

@ammyyou112 ammyyou112 requested review from a team as code owners March 4, 2026 18:11
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🚫 Community PR Path Check — Failed

Community PRs can only modify files inside the community/ folder.

❌ Not Allowed

  • README.md
  • docs/Designing_OpenHome_Abilities.md
  • docs/Futuristic_OpenHome_Abilities.md
  • docs/OpenHome_SDK_Reference.md
  • docs/capability-worker.md
  • templates/Alarm/README.md
  • templates/Alarm/background.py
  • templates/Background/README.md
  • templates/Background/__init__.py
  • templates/Background/alarm.mp3
  • templates/Background/background.py
  • templates/Local/README.md
  • templates/Local/__init__.py
  • templates/Local/main.py
  • templates/OpenClaw/README.md
  • templates/OpenClaw/__init__.py
  • templates/OpenClaw/main.py
  • templates/README.md

✅ Allowed

  • community/enphase-solar-monitor/README.md
  • community/enphase-solar-monitor/__init__.py
  • community/enphase-solar-monitor/main.py

Please remove changes to files outside community/.
If you need changes elsewhere, open an issue to discuss with maintainers.

@github-actions github-actions bot added community-ability Community-contributed ability documentation Documentation improvements labels Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🔀 Branch Merge Check

PR direction: add-enphase-solar-monitordev

Passedadd-enphase-solar-monitordev is a valid merge direction

@github-actions github-actions bot added templates Starter templates first-contribution First-time contributor labels Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

✅ Ability Validation Passed

📋 Validating: community/enphase-solar-monitor
  ✅ All checks passed!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🔍 Lint Results

🔧 Auto-formatted

Some files were automatically cleaned and formatted with autoflake + autopep8 and committed.

  • Unused imports removed (autoflake)
  • Unused variables removed (autoflake)
  • PEP8 formatting applied (autopep8)

__init__.py — Empty as expected

Files linted: community/enphase-solar-monitor/main.py templates/Alarm/background.py templates/Background/background.py templates/Local/main.py templates/OpenClaw/main.py

❌ Flake8 Errors (could not be auto-fixed)

templates/Local/main.py:74:121: W291 trailing whitespace
templates/Local/main.py:75:124: W291 trailing whitespace
templates/OpenClaw/main.py:31:44: F541 f-string is missing placeholders

Fix the remaining issues and push again. The lint will re-run automatically.

@uzair401
Copy link
Contributor

uzair401 commented Mar 5, 2026

Please ensure all changes are within the community folder, as changes outside are not allowed. Fix the issues and reopen the PR.

@uzair401 uzair401 closed this Mar 5, 2026
@ammyyou112
Copy link
Contributor Author

@uzair401 I have fixed it, and Reopen the PR (#193) and now all the relevant files are within the community folder. Please check, and let me know if there is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-ability Community-contributed ability documentation Documentation improvements first-contribution First-time contributor templates Starter templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants