docs: split powermeter configuration into separate reference files#397
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR extracts inline powermeter examples from README into two new reference files: ChangesDocumentation Reorganization and Configuration Reference Expansion
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
CHANGELOG.mdREADME.mddocs/esphome-powermeters.mddocs/powermeters.md
| 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. |
There was a problem hiding this comment.
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.
| 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
|
Actionable comments posted: 0 |
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-sourceconfig.iniexamples 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:
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