Skip to content

Meter (SlimmeLezer V2): use ESPHome entity-name sensor URLs#30466

Merged
andig merged 2 commits into
masterfrom
fix/slimmelezer-esphome-entity-urls
Jun 5, 2026
Merged

Meter (SlimmeLezer V2): use ESPHome entity-name sensor URLs#30466
andig merged 2 commits into
masterfrom
fix/slimmelezer-esphome-entity-urls

Conversation

@andig
Copy link
Copy Markdown
Member

@andig andig commented Jun 3, 2026

fixes #30442

ESPHome 2026.1.0 reworked the web_server component to address entities by name (esphome/esphome#12627). The legacy /sensor/<object_id> URLs the slimmelezer-V2 template polls are now deprecated and emit warnings, and they will be removed in ESPHome 2026.7.0.

This switches all 13 polled sensors to the entity-name form, e.g. /sensor/Power Consumed instead of /sensor/power_consumed. The names match Zuidwijk's upstream slimmelezer.yaml, which has used these friendly names for many releases, so any device this template targets already serves them. The web_server returns identical JSON for both URL forms, so the jq extractors are unchanged.

The spaces in the entity names are left literal in the template; the http plugin url-encodes them on the request side.

ESPHome 2026.1.0 (web_server) deprecates the legacy /sensor/<object_id>
URLs and removes them in 2026.7.0, telling callers to use the entity
name instead. Switch all 13 polled sensors to the entity-name form
(e.g. /sensor/Power Consumed); the http plugin url-encodes the spaces on
the request side. The returned JSON is identical, so the jq extractors
are unchanged.

fixes #30442
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="templates/definition/meter/slimmelezer-v2.yaml" line_range="31" />
<code_context>
     add:
     - source: http
-      uri: http://{{ .host }}/sensor/power_consumed
+      uri: http://{{ .host }}/sensor/Power Consumed
       headers:
       - content-type: application/json
</code_context>
<issue_to_address>
**issue (review_instructions):** The updated sensor URIs introduce capitalization and spaces in the path, which appears inconsistent with the existing snake_case, lowercase sensor naming used elsewhere in templates and likely violates the naming conventions in templates/README.md.

Previously these URIs used snake_case and lowercase segments (e.g. `power_consumed`, `power_produced_phase_1`, etc.). The new versions such as `/sensor/Power Consumed`, `/sensor/Energy Produced Tariff 1`, `/sensor/Current Phase 1`, etc. change that to capitalized words with spaces in the path.

This is inconsistent with the original naming and, based on the rest of the templates directory, with the general convention of lowercase, underscore-separated identifiers. It is also likely to break any client expecting the old paths.

Please align these URIs with the conventions in `templates/README.md` and with other meter templates (probably reverting to lowercase snake_case without spaces), or update the README and other templates accordingly if this naming change is intentional and broadly adopted.

<details>
<summary>Review instructions:</summary>

**Path patterns:** `templates/**/*.yaml`

**Instructions:**
Verify that the changes comply to the rules defined in templates/README.md. Also check consistence (wording) with other files inside templates directory.

</details>
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

add:
- source: http
uri: http://{{ .host }}/sensor/power_consumed
uri: http://{{ .host }}/sensor/Power Consumed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue (review_instructions): The updated sensor URIs introduce capitalization and spaces in the path, which appears inconsistent with the existing snake_case, lowercase sensor naming used elsewhere in templates and likely violates the naming conventions in templates/README.md.

Previously these URIs used snake_case and lowercase segments (e.g. power_consumed, power_produced_phase_1, etc.). The new versions such as /sensor/Power Consumed, /sensor/Energy Produced Tariff 1, /sensor/Current Phase 1, etc. change that to capitalized words with spaces in the path.

This is inconsistent with the original naming and, based on the rest of the templates directory, with the general convention of lowercase, underscore-separated identifiers. It is also likely to break any client expecting the old paths.

Please align these URIs with the conventions in templates/README.md and with other meter templates (probably reverting to lowercase snake_case without spaces), or update the README and other templates accordingly if this naming change is intentional and broadly adopted.

Review instructions:

Path patterns: templates/**/*.yaml

Instructions:
Verify that the changes comply to the rules defined in templates/README.md. Also check consistence (wording) with other files inside templates directory.

@andig andig added devices Specific device support waiting for feedback Suspended progress labels Jun 3, 2026
@andig andig merged commit 81bede7 into master Jun 5, 2026
7 checks passed
@andig andig deleted the fix/slimmelezer-esphome-entity-urls branch June 5, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support waiting for feedback Suspended progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

templates: slimmelezer-V2 — ESPHome 2026.5.x deprecates legacy /sensor/<object_id> URLs

1 participant