Skip to content

Update iobroker.yaml - #33146

Open
Chris685 wants to merge 2 commits into
evcc-io:iobroker-vehiclefrom
Chris685:patch-6
Open

Update iobroker.yaml#33146
Chris685 wants to merge 2 commits into
evcc-io:iobroker-vehiclefrom
Chris685:patch-6

Conversation

@Chris685

Copy link
Copy Markdown
Contributor

remove /rest-api

remove /rest-api
@github-actions github-actions Bot added bug Something isn't working vehicles Specific vehicle support labels Aug 24, 2026

@sourcery-ai sourcery-ai Bot left a comment

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.

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/vehicle/iobroker.yaml" line_range="144" />
<code_context>
     source: http
     headers:
       - accept: text/plain;charset=UTF-8
-    uri: {{ .uri }}/rest-api/v1/state/{{ .soc }}/plain?extraPlain=true
+    uri: {{ .uri }}/v1/state/{{ .soc }}/plain?extraPlain=true
     cache: {{ .cache }}
</code_context>
<issue_to_address>
**issue (bug_risk):** With the documented `rest-api` adapter setup and the documented host-only `.uri`, every vehicle request is sent to `/v1/state/...` instead of the adapter's `/rest-api/v1/state/...` mount, so reads and writes fail with an unavailable endpoint rather than accessing the configured datapoints.

**Triggers:** When `.uri` is a host URI as shown in the template example and the ioBroker `rest-api` adapter is mounted under `/rest-api`.

**Suggested fix:** Retain the `/rest-api` prefix, or update the adapter/URI contract consistently and migrate the charger and meter ioBroker templates as well.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: templates/definition/vehicle/iobroker.yaml:144


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.

source: http
headers:
- accept: text/plain;charset=UTF-8
uri: {{ .uri }}/rest-api/v1/state/{{ .soc }}/plain?extraPlain=true

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 (bug_risk): With the documented rest-api adapter setup and the documented host-only .uri, every vehicle request is sent to /v1/state/... instead of the adapter's /rest-api/v1/state/... mount, so reads and writes fail with an unavailable endpoint rather than accessing the configured datapoints.

Triggers: When .uri is a host URI as shown in the template example and the ioBroker rest-api adapter is mounted under /rest-api.

Suggested fix: Retain the /rest-api prefix, or update the adapter/URI contract consistently and migrate the charger and meter ioBroker templates as well.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bug risk: removing /rest-api from all 10 endpoint URIs in this template (templates/definition/vehicle/iobroker.yaml, e.g.

- accept: text/plain;charset=UTF-8
uri: {{ .uri }}/v1/state/{{ .soc }}/plain?extraPlain=true
cache: {{ .cache }}
) likely breaks every read/write for this vehicle integration.

The ioBroker rest-api adapter (distinct from simple-api) is documented to be mounted at /rest-api. The sibling templates using the same adapter still keep the prefix with a bare-host .uri:

Both explicitly document: "The rest-api adapter (not simple-api) must be installed... configured as an extension of a web adapter." Since this vehicle template uses the identical adapter/URI convention, stripping /rest-api sends requests to a path the adapter doesn't serve, so soc, range, status, limitSoc, odometer, climater, finishTime, chargeEnable, setMaxCurrent, and wakeup would all fail — unless .uri was intentionally redefined elsewhere to already include /rest-api (not evident from this diff). Sourcery AI's automated review independently flagged this same line as a blocking issue.

Suggest reverting the prefix removal, or if the adapter's mount path genuinely changed, confirming that and updating the charger/meter templates to match for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working vehicles Specific vehicle support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant