Skip to content

Add multi-phase support for VZLogger powermeter#332

Merged
tomquist merged 2 commits intodevelopfrom
claude/add-3phase-support-LxnCh
Apr 19, 2026
Merged

Add multi-phase support for VZLogger powermeter#332
tomquist merged 2 commits intodevelopfrom
claude/add-3phase-support-LxnCh

Conversation

@tomquist
Copy link
Copy Markdown
Owner

Summary

Added support for multi-phase power meters in the VZLogger integration by allowing comma-separated UUID values to be configured. Each phase is now fetched in parallel for improved performance.

Key Changes

  • Modified VZLogger.__init__() to accept either a single UUID string or a list of UUIDs, normalizing both to an internal list
  • Updated get_json() to accept a UUID parameter, enabling per-UUID queries
  • Refactored get_powermeter_watts() to fetch all phase UUIDs in parallel using asyncio.gather() and return a list of power values (one per phase)
  • Added asyncio import to support concurrent phase fetching
  • Updated configuration loader to parse comma-separated UUID values using the existing _split_labels() utility
  • Added comprehensive test case test_vzlogger_three_phase() validating multi-phase functionality and parallel requests
  • Updated documentation (README.md and config.ini.example) with examples of 3-phase meter configuration
  • Added changelog entry documenting the new feature

Implementation Details

  • Backward compatible: single UUID strings are automatically converted to a single-element list
  • Phases are fetched concurrently rather than sequentially, improving response time for multi-phase meters
  • Configuration uses comma-separated values consistent with other multi-phase powermeters in the codebase (Tasmota, MQTT)

https://claude.ai/code/session_01ERnB6Z8sVcSgbERfKv2SAT

Accept comma-separated UUIDs in the VZLOGGER section so 3-phase smart
meters return one value per phase. UUIDs are fetched in parallel via
asyncio.gather. Single-UUID configs continue to return a one-element
list, matching the str | list[str] idiom used by Tasmota and JSON HTTP.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

Warning

Rate limit exceeded

@tomquist has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 51 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 51 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8488ca1c-0f1c-4043-a861-bd16d3ac4e35

📥 Commits

Reviewing files that changed from the base of the PR and between 1f8445a and d0294c7.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • README.md
  • config.ini.example
  • src/astrameter/config/config_loader.py
  • src/astrameter/powermeter/vzlogger.py
  • src/astrameter/powermeter/vzlogger_test.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/add-3phase-support-LxnCh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomquist tomquist merged commit a886dbd into develop Apr 19, 2026
13 checks passed
@tomquist tomquist deleted the claude/add-3phase-support-LxnCh branch April 19, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants