Rebrand project from B2500 Meter to AstraMeter#302
Conversation
|
Warning Rate limit exceeded
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 12 minutes and 15 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis pull request performs a comprehensive project rebrand from "B2500 Meter" to "AstraMeter", including package namespace migration ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Rename the Python package from b2500_meter to astrameter, update all CLI entry points (astrameter, astra-sim), Docker configuration, Home Assistant add-on metadata, MQTT topic defaults, logger names, and documentation. The project now reflects support for the full range of Marstek storage systems rather than just the B2500. Breaking changes: - Package name: b2500-meter → astrameter - CLI commands: b2500-meter → astrameter, b2500-sim → astra-sim - MQTT base topic default: b2500_meter → astrameter - MQTT node ID prefix: b2500_meter_ → astrameter_ - HA add-on slug: b2500_meter → astrameter - Docker image: ghcr.io/tomquist/b2500-meter → ghcr.io/tomquist/astrameter https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
The B2500 firmware version references (port 1010 for ≤224, port 2220 for ≥226) are specific to the B2500 product, not generic Marstek info. Revert these from "Marstek firmware" back to "B2500 firmware". https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
MQTT Insights is new in the same release, so there are no existing integrations to migrate. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
Released version entries (1.0.x) should be immutable. Revert the GitHub URLs and project name back to their original form in those sections. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
- Rename user-facing "Add-on"/"add-on" references to "App"/"app" in README, CHANGELOG (Next section only), config.ini.example, HA translations, run.sh, and issue template. - Keep ha_addon/ directory, HA config field names, badge URLs, and filesystem paths unchanged (HA build system internals). - Released CHANGELOG entries (1.0.x) left untouched. - Expand rebranding changelog bullet with Docker image and HA app repository URL migration notes. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
Point the HA app repository badge and changelog migration note to https://github.com/tomquist/astrameter#main so Home Assistant resolves the correct branch. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
The slug changed from b2500_meter to astrameter, which moves the custom config directory. Existing users need to move their files manually after upgrading. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
Revert the HA addon slug to b2500_meter so existing installations upgrade in place rather than being treated as a new app. The display name still shows "AstraMeter". Remove Node-RED from the issue template installation method options since the Node-RED flow was removed with CT001. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
Combine "Added CT002/CT003 emulation" and "Added efficiency optimization" into a single bullet since they are closely related. Also restore the MQTT multi-phase line that was between them. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
0161e4a to
6a19af6
Compare
Rewrite entries to describe the final state vs 1.0.8 rather than incremental develop-branch work. Merge related entries, remove internal implementation details, and drop items that are not user-visible on their own. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
Re-add battery activity logs, throttling log cleanup, Shelly UDP robustness, and Modbus docs clarification — all user-visible changes. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/astrameter/simulator/cli.py (1)
22-23: PID/log file paths updated to new naming.The file paths changed from
.b2500-sim.*to.astra-sim.*. Users with a running daemon from the old version may have orphaned.b2500-sim.pidand.b2500-sim.logfiles in their home directory after upgrading. This is a minor consideration but could cause confusion if the old daemon is still running.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/astrameter/simulator/cli.py` around lines 22 - 23, PID_FILE and LOG_FILE were renamed to ".astra-sim.*" and may leave behind legacy ".b2500-sim.pid"/".b2500-sim.log" files from older installs; update the startup routine to detect those legacy files, and if present either migrate them (rename to the new names) or emit a clear warning and attempt safe cleanup: check the PID in ".b2500-sim.pid" and verify whether that process is still running before removing or renaming, and log actions to LOG_FILE via the existing logging mechanism; use the symbols PID_FILE and LOG_FILE to locate where to add this migration/check logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Around line 4-17: The CHANGELOG.md contains broken GitHub links to
"https://github.com/tomquist/astrameter" and PR links like
"https://github.com/tomquist/astrameter/pull/231"; either finish the repository
rename and create tomquist/astrameter (with redirects) before release or revert
the changelog links to the existing repo (e.g., tomquist/b2500-meter) and update
the PR URLs accordingly; search for the exact URL string
"https://github.com/tomquist/astrameter" and the "/pull/" links in CHANGELOG.md
and replace them with the correct target (or add a TODO note pending repo
creation) so no public link returns 404.
In `@README.md`:
- Line 40: The badge alt text contains a duplicated word "add" ("Open your Home
Assistant instance and show the add add-on repository dialog..."); update the
alt text for the markdown image (the badge image link/alt string that begins
"Open your Home Assistant instance and show the add add-on repository
dialog...") to remove the duplicate so it reads e.g. "Open your Home Assistant
instance and show the add-on repository dialog with a specific repository URL
pre-filled."
- Around line 72-73: Add a brief explanatory note to the README next to the path
string `addon_configs/a0ef98c5_b2500_meter` explaining that the `b2500_meter`
suffix is kept intentionally for compatibility/in-place upgrades (e.g., “path
stays ...b2500_meter for compatibility”) so users don’t think it’s stale; update
the sentence that mentions setting `Custom Config` to also reference this
compatibility note so it’s clear why the filename/path remains unchanged.
In `@src/astrameter/main.py`:
- Line 432: Fix the typo in the startup log message by updating the logger.info
call (logger.info("startet astrameter application")) to the correct text
"started astrameter application" so the startup log reads properly.
---
Nitpick comments:
In `@src/astrameter/simulator/cli.py`:
- Around line 22-23: PID_FILE and LOG_FILE were renamed to ".astra-sim.*" and
may leave behind legacy ".b2500-sim.pid"/".b2500-sim.log" files from older
installs; update the startup routine to detect those legacy files, and if
present either migrate them (rename to the new names) or emit a clear warning
and attempt safe cleanup: check the PID in ".b2500-sim.pid" and verify whether
that process is still running before removing or renaming, and log actions to
LOG_FILE via the existing logging mechanism; use the symbols PID_FILE and
LOG_FILE to locate where to add this migration/check logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e9f7e0c1-8501-413d-a8c9-5951c41f0e7f
⛔ Files ignored due to path filters (2)
src/astrameter/powermeter/homewizard_ca.pemis excluded by!**/*.pemuv.lockis excluded by!**/*.lock
📒 Files selected for processing (97)
.github/ISSUE_TEMPLATE/issue_report.md.github/workflows/ci.ymlAGENTS.mdCHANGELOG.mdCONTRIBUTING.mdDockerfileREADME.mdconfig.ini.exampledocker-compose.yamlha_addon/config.yamlha_addon/run.shha_addon/translations/en.yamlpyproject.tomlrelease.shrepository.yamlsrc/astrameter/__init__.pysrc/astrameter/config/__init__.pysrc/astrameter/config/config_loader.pysrc/astrameter/config/config_loader_test.pysrc/astrameter/config/logger.pysrc/astrameter/config/logger_test.pysrc/astrameter/conftest.pysrc/astrameter/ct002/__init__.pysrc/astrameter/ct002/balancer.pysrc/astrameter/ct002/ct002.pysrc/astrameter/ct002/protocol.pysrc/astrameter/ct002/smoother.pysrc/astrameter/health_service.pysrc/astrameter/main.pysrc/astrameter/marstek_api.pysrc/astrameter/mqtt_insights/__init__.pysrc/astrameter/mqtt_insights/discovery.pysrc/astrameter/mqtt_insights/mqtt_insights_test.pysrc/astrameter/mqtt_insights/service.pysrc/astrameter/powermeter/__init__.pysrc/astrameter/powermeter/amisreader.pysrc/astrameter/powermeter/amisreader_test.pysrc/astrameter/powermeter/base.pysrc/astrameter/powermeter/conftest.pysrc/astrameter/powermeter/emlog.pysrc/astrameter/powermeter/emlog_test.pysrc/astrameter/powermeter/esphome.pysrc/astrameter/powermeter/esphome_test.pysrc/astrameter/powermeter/homeassistant.pysrc/astrameter/powermeter/homeassistant_test.pysrc/astrameter/powermeter/homewizard.pysrc/astrameter/powermeter/homewizard_test.pysrc/astrameter/powermeter/iobroker.pysrc/astrameter/powermeter/iobroker_test.pysrc/astrameter/powermeter/json_http.pysrc/astrameter/powermeter/json_http_test.pysrc/astrameter/powermeter/modbus.pysrc/astrameter/powermeter/modbus_test.pysrc/astrameter/powermeter/mqtt.pysrc/astrameter/powermeter/mqtt_test.pysrc/astrameter/powermeter/script.pysrc/astrameter/powermeter/script_test.pysrc/astrameter/powermeter/shelly.pysrc/astrameter/powermeter/shelly_test.pysrc/astrameter/powermeter/shrdzm.pysrc/astrameter/powermeter/shrdzm_test.pysrc/astrameter/powermeter/sma_energy_meter.pysrc/astrameter/powermeter/sma_energy_meter_test.pysrc/astrameter/powermeter/sml.pysrc/astrameter/powermeter/sml_test.pysrc/astrameter/powermeter/tasmota.pysrc/astrameter/powermeter/tasmota_test.pysrc/astrameter/powermeter/throttling.pysrc/astrameter/powermeter/throttling_test.pysrc/astrameter/powermeter/tq_em.pysrc/astrameter/powermeter/tq_em_test.pysrc/astrameter/powermeter/transform.pysrc/astrameter/powermeter/transform_test.pysrc/astrameter/powermeter/vzlogger.pysrc/astrameter/powermeter/vzlogger_test.pysrc/astrameter/shelly/__init__.pysrc/astrameter/shelly/shelly.pysrc/astrameter/shelly/shelly_udp_test.pysrc/astrameter/simulator/__init__.pysrc/astrameter/simulator/battery.pysrc/astrameter/simulator/cli.pysrc/astrameter/simulator/load_model.pysrc/astrameter/simulator/powermeter_sim.pysrc/astrameter/simulator/protocol.pysrc/astrameter/simulator/runner.pysrc/astrameter/simulator/tui.pysrc/astrameter/version_info.pysrc/b2500_meter/__init__.pytests/smoke_efficiency_saturation.pytests/smoke_transitions.pytests/test_balancer.pytests/test_ct002_active_control.pytests/test_ct002_mac_policy.pytests/test_ct002_protocol.pytests/test_efficiency_e2e.pytests/test_marstek_api.pytests/test_version_info.py
💤 Files with no reviewable changes (1)
- src/b2500_meter/init.py
| - **Breaking:** Rebrand project from "B2500 Meter" to "AstraMeter" (formerly b2500-meter). Package renamed to `astrameter`, CLI commands are now `astrameter` and `astra-sim`. Docker image moved from `ghcr.io/tomquist/b2500-meter` to `ghcr.io/tomquist/astrameter`. Home Assistant users must update their app repository URL to `https://github.com/tomquist/astrameter#main`. | ||
| - Added CT002/CT003 emulation for steering multiple Marstek storage devices over the Marstek CT UDP protocol, with opt-in efficiency optimization that concentrates power on fewer batteries at low demand and rotates fairly over time (`MIN_EFFICIENT_POWER`, `EFFICIENCY_ROTATION_INTERVAL`, and related tuning options) | ||
| - Added MQTT Insights: optional `[MQTT_INSIGHTS]` section publishes internal state (grid power, targets, saturation, consumer topology) to MQTT with Home Assistant Device Discovery, per-consumer active/pause control, manual target override, and Shelly battery offline availability; auto-configured in the HA app when Mosquitto is installed | ||
| - Added HomeWizard P1 powermeter support via the device WebSocket API with optional `VERIFY_SSL` ([#231](https://github.com/tomquist/astrameter/pull/231), [#254](https://github.com/tomquist/astrameter/pull/254)) | ||
| - Added SMA Energy Meter / Sunny Home Manager support via Speedwire multicast with auto-detection and per-phase readings ([#252](https://github.com/tomquist/astrameter/pull/252)) | ||
| - Added SML powermeter support for smart meters over a local serial port (IR head), with optional per-phase OBIS overrides ([#229](https://github.com/tomquist/astrameter/pull/229)) | ||
| - Added multi-phase support for Tasmota (`JSON_POWER_MQTT_LABEL`) and MQTT (`TOPICS` / `JSON_PATHS`) powermeters ([#136](https://github.com/tomquist/astrameter/issues/136), [#280](https://github.com/tomquist/astrameter/pull/280)) | ||
| - Added `POWER_OFFSET` and `POWER_MULTIPLIER` transforms for any powermeter, including per-phase calibration, sign flipping, and phase nulling ([#250](https://github.com/tomquist/astrameter/pull/250)) | ||
| - Added optional Marstek cloud auto-registration for managed fake CT devices at startup ([#237](https://github.com/tomquist/astrameter/pull/237)) | ||
| - Switched the Home Assistant powermeter integration from REST polling to the WebSocket API ([#232](https://github.com/tomquist/astrameter/pull/232)) | ||
| - Added `LOG_LEVEL` environment variable support for Docker and CLI runs ([#174](https://github.com/tomquist/astrameter/pull/174)) | ||
| - Added timestamps to application log lines ([#260](https://github.com/tomquist/astrameter/pull/260)) | ||
| - CI-built container images embed `GIT_COMMIT_SHA`; startup logs the git commit and `/health` JSON includes `git_commit` when set | ||
| - Fixed Modbus `UNIT_ID` handling ([#191](https://github.com/tomquist/astrameter/pull/191)) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
urls=(
"https://github.com/tomquist/astrameter"
"https://github.com/tomquist/astrameter#main"
"https://github.com/tomquist/astrameter/pull/231"
"https://github.com/tomquist/astrameter/pull/254"
"https://github.com/tomquist/astrameter/pull/252"
"https://github.com/tomquist/astrameter/pull/229"
"https://github.com/tomquist/astrameter/pull/280"
"https://github.com/tomquist/astrameter/pull/250"
"https://github.com/tomquist/astrameter/pull/237"
"https://github.com/tomquist/astrameter/pull/232"
"https://github.com/tomquist/astrameter/pull/174"
"https://github.com/tomquist/astrameter/pull/260"
"https://github.com/tomquist/astrameter/pull/191"
)
for u in "${urls[@]}"; do
echo "=== $u ==="
curl -sI -L "$u" | awk 'toupper($1) ~ /^HTTP/ {print}'
doneRepository: tomquist/b2500-meter
Length of output: 946
All astrameter GitHub URLs return 404 — repository rename must be completed before release.
The changelog references github.com/tomquist/astrameter, but the repository does not exist yet. All 13 PR links and the main repository URL currently return HTTP 404. This blocks release:
- Home Assistant users cannot access migration instructions (
https://github.com/tomquist/astrameter#main) - All PR references are broken links
- Package documentation will contain dead links
Complete the repository migration to tomquist/astrameter before publishing this release.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CHANGELOG.md` around lines 4 - 17, The CHANGELOG.md contains broken GitHub
links to "https://github.com/tomquist/astrameter" and PR links like
"https://github.com/tomquist/astrameter/pull/231"; either finish the repository
rename and create tomquist/astrameter (with redirects) before release or revert
the changelog links to the existing repo (e.g., tomquist/b2500-meter) and update
the PR URLs accordingly; search for the exact URL string
"https://github.com/tomquist/astrameter" and the "/pull/" links in CHANGELOG.md
and replace them with the correct target (or add a TODO note pending repo
creation) so no public link returns 404.
| 1. **Add the Repository to Home Assistant** | ||
|
|
||
| [](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Ftomquist%2Fb2500-meter) | ||
| [](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Ftomquist%2Fastrameter%23main) |
There was a problem hiding this comment.
Fix small typo in badge alt text.
“add add-on repository” has a duplicated “add”.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` at line 40, The badge alt text contains a duplicated word "add"
("Open your Home Assistant instance and show the add add-on repository
dialog..."); update the alt text for the markdown image (the badge image
link/alt string that begins "Open your Home Assistant instance and show the add
add-on repository dialog...") to remove the duplicate so it reads e.g. "Open
your Home Assistant instance and show the add-on repository dialog with a
specific repository URL pre-filled."
Users might think the path is stale after the AstraMeter rebrand. Add a parenthetical note clarifying it is kept for in-place upgrade compatibility. https://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
Summary
This is a comprehensive rebranding of the project from "B2500 Meter" to "AstraMeter" to better reflect support for the full range of Marstek storage systems (B2500, Jupiter, Venus, etc.), not just the B2500.
Key Changes
b2500_meter→astrameterb2500-meter→astrameter,b2500-sim→astra-simghcr.io/tomquist/b2500-meter→ghcr.io/tomquist/astrameterb2500_metertoastrameterb2500toastraImplementation Details
astrameterpackage namespacehttps://claude.ai/code/session_01Y6qEybudSF6wccwhEusiaW
Summary by CodeRabbit
Release Notes
b2500-meter→astrameter,b2500-sim→astra-simastrameter