Skip to content

docs: split powermeter configuration into separate reference files#397

Merged
tomquist merged 5 commits into
developfrom
claude/nice-hopper-DfnOY
May 28, 2026
Merged

docs: split powermeter configuration into separate reference files#397
tomquist merged 5 commits into
developfrom
claude/nice-hopper-DfnOY

Conversation

@tomquist
Copy link
Copy Markdown
Owner

@tomquist tomquist commented May 28, 2026

Extracted powermeter configuration documentation from the main README into two dedicated reference files:

  • docs/powermeters.md — Configuration reference for the Python add-on, Docker, and direct install deployments. Contains per-source config.ini examples for all 17 supported powermeter types (Shelly, Tasmota, Modbus, MQTT, JSON HTTP, HomeAssistant, etc.).

  • docs/esphome-powermeters.md — Configuration reference for the ESPHome external component running on an ESP32. Includes complete, copy-pasteable YAML examples for each meter type, with a support tier legend (🟢 Native / 🔵 Generic / 🟠 Alternate / 🔴 Not yet available) and notes on which sources are available on ESP32 vs. Python-only.

Changes to README.md:

  • Removed ~400 lines of inline powermeter configuration examples
  • Added cross-references to the new docs in the Configuration section and ESPHome component section
  • Kept general configuration guidance (PID, throttling, value transformation, etc.) in the main README

This improves maintainability by centralizing meter-specific docs and makes it easier for users to find the right reference based on their deployment method (Python vs. ESPHome).

https://claude.ai/code/session_01TZavoryWVZJTkJfJEMPBgQ

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive ESPHome powermeter reference with copy‑paste YAML examples for many meter sources and a support legend; notes on meters not yet supported.
    • Added a per‑source Python/Docker/direct‑install powermeter reference with INI snippets and detailed options.
    • Reworked README and changelog pointers to direct users to the new, source‑specific reference docs.

Review Change Stack

claude added 4 commits May 28, 2026 07:51
Move the per-source config.ini sections out of the README into
docs/powermeters.md, and add docs/esphome-powermeters.md documenting the
equivalent grid-power sensor for the ESPHome external component (including
meters not yet supported on the ESP, e.g. Enphase Envoy and SMA Energy Meter).
Both docs are linked from the README.

https://claude.ai/code/session_01TZavoryWVZJTkJfJEMPBgQ
Make the sensor-id -> power_sensor_l* contract explicit and show one complete
end-to-end file (poller through ct002) so the per-source http_request fragments
have an obvious home.

https://claude.ai/code/session_01TZavoryWVZJTkJfJEMPBgQ
Every meter section is now a complete, copy-pasteable config from
external_components through ct002, instead of a fragment to assemble against a
shared skeleton. Also adds the missing native SML section (fixing the dangling
#sml links from VZLogger/HomeWizard).

https://claude.ai/code/session_01TZavoryWVZJTkJfJEMPBgQ
Clarify that the ESPHome example splits EM.GetStatus per phase while the Python
3EMPro source reads the aggregate total_act_power.

https://claude.ai/code/session_01TZavoryWVZJTkJfJEMPBgQ
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 761e8127-71c0-494a-b8be-f77c24c282d3

📥 Commits

Reviewing files that changed from the base of the PR and between e13ed46 and d88513d.

📒 Files selected for processing (2)
  • docs/esphome-powermeters.md
  • docs/powermeters.md
✅ Files skipped from review due to trivial changes (1)
  • docs/esphome-powermeters.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/powermeters.md

Walkthrough

This PR extracts inline powermeter examples from README into two new reference files: docs/powermeters.md (Python/AstraMeter) and docs/esphome-powermeters.md (ESPHome ct002:), and updates README and CHANGELOG to point to those documents.

Changes

Documentation Reorganization and Configuration Reference Expansion

Layer / File(s) Summary
README and Changelog navigation updates
CHANGELOG.md, README.md
CHANGELOG bullet for ct002: is expanded to reference new documentation. README's ESPHome section, Configuration overview, and Powermeter sources section are updated to direct readers to docs/powermeters.md and docs/esphome-powermeters.md instead of inline examples.
Python powermeter configuration reference
docs/powermeters.md
New reference document for Python/Docker/add-on configurations. Provides INI configuration snippets and field documentation for Shelly, Tasmota, ioBroker, HomeAssistant, VZLogger, Modbus, MQTT, JSON HTTP, TQ Energy Manager, HomeWizard, Enphase Envoy, SMA Energy Meter, Script, and SML sources. Includes multi-phase variants and example values.
ESPHome powermeter configuration reference
docs/esphome-powermeters.md
New reference document for ESPHome ct002: external component wiring. Provides complete YAML examples for HTTP/RPC polling (Shelly, Tasmota, ioBroker), native sensor integrations (HomeAssistant, VZLogger), serial protocols (Modbus RS485, SML), MQTT subscriptions, JSON HTTP requests, and notes on missing implementations for Enphase Envoy and SMA Speedwire with implementation guidance.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary objective of the pull request: extracting powermeter configuration documentation from README into dedicated reference files for Python and ESPHome deployments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/nice-hopper-DfnOY

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 marked this pull request as ready for review May 28, 2026 17:41
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/esphome-powermeters.md`:
- Line 10: The heading "How a reading reaches the emulator" is at H3 and breaks
heading sequence; change the markdown heading from "### How a reading reaches
the emulator" to an H2 ("## How a reading reaches the emulator") so it follows
the H1 and resolves the MD001 violation.
- Around line 63-65: Remove the internal blank line inside the blockquote
containing the Script note so the entire note is a single continuous blockquote;
locate the blockquote that begins with "**Script** (the Python `[SCRIPT]`
source)" and merge the separated lines into one contiguous blockquote paragraph.

In `@docs/powermeters.md`:
- Line 309: Update the inline code spans in the docs/powermeters.md text that
describe JSON_PATH and JSON_PATHS so there are no spaces immediately inside the
backticks (fix markdownlint MD038/no-space-in-code). Locate the examples that
reference JSON_PATH/JSON_PATHS and the chained extensions (the instances showing
split(...) and sub(/regex/, replacement)) and remove the extra spaces between
the backticks and the content so each code span is like `split(...)` and
`sub(/.../,...)` with no leading or trailing space inside the backticks.
🪄 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: 69445e1e-fdf2-4435-908b-49f66c3b635d

📥 Commits

Reviewing files that changed from the base of the PR and between 350bb1c and e13ed46.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • README.md
  • docs/esphome-powermeters.md
  • docs/powermeters.md

Comment thread docs/esphome-powermeters.md Outdated
Comment thread docs/esphome-powermeters.md Outdated
Comment thread docs/powermeters.md Outdated
The `JSON_PATH` option is used to extract the power value from a JSON payload. The path must be a [valid JSONPath expression](https://goessner.net/articles/JsonPath/).
If the payload is a simple integer value, you can omit this option.

Both `JSON_PATH` and `JSON_PATHS` are parsed with the [`jsonpath-ng` extended syntax](https://github.com/h2non/jsonpath-ng#extensions), so you can chain extensions like `` `split(...)` `` or `` `sub(/regex/, replacement)` `` to massage a payload value before it's converted to a float — for instance `$.state.`split( , 0, -1)`` or `$.state.`sub(/[^0-9.\-]+$/, )`` to strip a unit suffix like `"331.74 W"`. See the [JSON HTTP](#json-http) section below for more examples.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix inline code-span spacing to satisfy markdownlint MD038.

Line 309 contains code spans with internal spacing that triggers no-space-in-code; this can fail docs lint in CI.

Suggested edit
-Both `JSON_PATH` and `JSON_PATHS` are parsed with the [`jsonpath-ng` extended syntax](https://github.com/h2non/jsonpath-ng#extensions), so you can chain extensions like `` `split(...)` `` or `` `sub(/regex/, replacement)` `` to massage a payload value before it's converted to a float — for instance `$.state.`split( , 0, -1)`` or `$.state.`sub(/[^0-9.\-]+$/, )`` to strip a unit suffix like `"331.74 W"`. See the [JSON HTTP](`#json-http`) section below for more examples.
+Both `JSON_PATH` and `JSON_PATHS` are parsed with the [`jsonpath-ng` extended syntax](https://github.com/h2non/jsonpath-ng#extensions), so you can chain extensions like `` `split(...)` `` or `` `sub(/regex/,replacement)` `` to massage a payload value before it's converted to a float — for instance ``$.state.`split( ,0,-1)` `` or ``$.state.`sub(/[^0-9.\-]+$/,)` `` to strip a unit suffix like `"331.74 W"`. See the [JSON HTTP](`#json-http`) section below for more examples.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Both `JSON_PATH` and `JSON_PATHS` are parsed with the [`jsonpath-ng` extended syntax](https://github.com/h2non/jsonpath-ng#extensions), so you can chain extensions like `` `split(...)` `` or `` `sub(/regex/, replacement)` `` to massage a payload value before it's converted to a float — for instance `$.state.`split( , 0, -1)`` or `$.state.`sub(/[^0-9.\-]+$/, )`` to strip a unit suffix like `"331.74 W"`. See the [JSON HTTP](#json-http) section below for more examples.
Both `JSON_PATH` and `JSON_PATHS` are parsed with the [`jsonpath-ng` extended syntax](https://github.com/h2non/jsonpath-ng#extensions), so you can chain extensions like `` `split(...)` `` or `` `sub(/regex/,replacement)` `` to massage a payload value before it's converted to a float — for instance ``$.state.`split( ,0,-1)` `` or ``$.state.`sub(/[^0-9.\-]+$/,)` `` to strip a unit suffix like `"331.74 W"`. See the [JSON HTTP](`#json-http`) section below for more examples.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 309-309: Spaces inside code span elements

(MD038, no-space-in-code)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/powermeters.md` at line 309, Update the inline code spans in the
docs/powermeters.md text that describe JSON_PATH and JSON_PATHS so there are no
spaces immediately inside the backticks (fix markdownlint
MD038/no-space-in-code). Locate the examples that reference JSON_PATH/JSON_PATHS
and the chained extensions (the instances showing split(...) and sub(/regex/,
replacement)) and remove the extra spaces between the backticks and the content
so each code span is like `split(...)` and `sub(/.../,...)` with no leading or
trailing space inside the backticks.

- esphome-powermeters.md: promote "How a reading reaches the emulator" to H2
  (MD001), and merge the adjacent Script/generic-HTTP notes into one blockquote
  via a > continuation (MD028).
- powermeters.md: fix malformed nested backticks in the $.state.`split`/`sub`
  jsonpath examples so the code spans render correctly and no longer have a
  stray leading space (MD038); the split delimiter space is preserved.

https://claude.ai/code/session_01TZavoryWVZJTkJfJEMPBgQ
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@tomquist tomquist merged commit 11e358c into develop May 28, 2026
25 checks passed
@tomquist tomquist deleted the claude/nice-hopper-DfnOY branch May 28, 2026 18:02
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