Add generic ioBroker vehicle template - #33113
Conversation
Deprecates the BMW-specific ioBroker template in favour of a generic one modeled after the ioBroker charger and meter templates.
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="templates/definition/vehicle/iobroker.tpl" line_range="12-17" />
<code_context>
+ quote: true
+ jq: {{ .jq }}
+{{- end }}
+{{- if .user }}
+ auth:
+ type: basic
+ user: {{ .user }}
+ password: {{ .password }}
+{{- end }}
+{{- end }}
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The template enables Basic authentication when `.user` is set, even if `.password` is absent. This contradicts the template's documented behavior that no password means no authentication and sends requests with an empty password instead of unauthenticated requests.
**Triggers:** When a configuration supplies `user` without `password`.
**Suggested fix:** Gate the `auth` blocks on `.password` (or on both `.user` and `.password`) so missing credentials do not enable Basic authentication.
</issue_to_address>
### Comment 2
<location path="templates/definition/vehicle/iobroker.yaml" line_range="23" />
<code_context>
+ - name: uri
+ required: true
+ description:
+ en: The full uri of the host to query
+ de: Der vollständige URI der ioBroker Instanz
+ example: https://iobroker.homelab.lan:8082
</code_context>
<issue_to_address>
**issue (review_instructions):** Use consistent capitalization for the technical term `URI`.
Please change `uri` to `URI` here, matching the capitalization used for this acronym elsewhere in the template documentation and parameter terminology.
<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>
### Comment 3
<location path="templates/definition/vehicle/iobroker.yaml" line_range="24" />
<code_context>
+ required: true
+ description:
+ en: The full uri of the host to query
+ de: Der vollständige URI der ioBroker Instanz
+ example: https://iobroker.homelab.lan:8082
+ - name: cache
</code_context>
<issue_to_address>
**issue (review_instructions):** Correct the German article for `URI`.
`URI` is conventionally feminine in German; use `Die vollständige URI der ioBroker-Instanz` (including the hyphenated compound) for consistent, idiomatic wording.
<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 assessment
Needs a human reviewer. 1 finding to address first, and the template adds HTTP write operations that can start or stop charging, change the charging current, or wake a vehicle through configured ioBroker datapoints. If the mapping or value handling is wrong, a command can take effect before the change is reverted, leaving an external vehicle action and associated energy or access impact that reverting cannot undo.
Blocking findings: templates/definition/vehicle/iobroker.tpl:17
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| {{- if .user }} | ||
| auth: | ||
| type: basic | ||
| user: {{ .user }} | ||
| password: {{ .password }} | ||
| {{- end }} |
There was a problem hiding this comment.
issue (bug_risk): The template enables Basic authentication when .user is set, even if .password is absent. This contradicts the template's documented behavior that no password means no authentication and sends requests with an empty password instead of unauthenticated requests.
Triggers: When a configuration supplies user without password.
Suggested fix: Gate the auth blocks on .password (or on both .user and .password) so missing credentials do not enable Basic authentication.
|
Actually this is not possible to request. We have to change following topic: See also discription of this Adapter: https://github.com/ioBroker/ioBroker.rest-api#usage At the same time, we should also change the port from 8082 to the generic 8093. This will work for more people plug & play. Request from EVCC: |
Adds a generic
iobrokervehicle template, modeled after the existing ioBroker charger and meter templates (rest-apiadapter, basic auth, URL-encoded datapoint ids). Any ioBroker adapter that exposes vehicle data can now be used, not justioBroker.bmw.Feature set is on par with the generic Home Assistant vehicle:
soc,range,status,statusA/B/C,limitSoc,odometer,climater,finishTimestart_charging/stop_chargingchargeEnable(single writable datapoint)wakeup,setMaxCurrentstatusA/B/Caccept comma-separated datapoint values and compile into a jq mapping toA/B/C. If none are given the raw value is passed through, so a datapoint that already yieldsA/B/Cworks without further configuration.The BMW-specific
ioBroker.bmwtemplate is markeddeprecated: true. Existing configurations keep resolving viaByName, it is only hidden from new configurations.🤖 Generated with Claude Code