Skip to content

Add meter template for V2C Trydan.#28390

Open
grobihh wants to merge 4 commits intoevcc-io:masterfrom
grobihh:trydan_template_meter
Open

Add meter template for V2C Trydan.#28390
grobihh wants to merge 4 commits intoevcc-io:masterfrom
grobihh:trydan_template_meter

Conversation

@grobihh
Copy link

@grobihh grobihh commented Mar 20, 2026

This idea sparked in #28169 (comment)

The tests commenced here #28365 (comment) were run with this Trydan meter template.

@andig andig added the devices Specific device support label Mar 20, 2026
@andig
Copy link
Member

andig commented Mar 20, 2026

Nice one, LGTM

@grobihh grobihh marked this pull request as ready for review March 22, 2026 14:38
Copy link
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, and left some high level feedback:

  • Consider marking the host parameter as required: true to avoid generating a configuration that cannot work without a host being set.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider marking the `host` parameter as `required: true` to avoid generating a configuration that cannot work without a host being set.

## Individual Comments

### Comment 1
<location path="templates/definition/meter/trydan.yaml" line_range="10" />
<code_context>
+  - name: usage
+    choice: ["grid", "pv", "battery"]
+    required: true
+  - name: host
+  - name: port
+    default: 80
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Consider making `host` required or providing a safe default to avoid invalid URIs

Since `host` is interpolated directly into `http://{{ .host }}:{{ .port }}/RealTimeData`, leaving it unset will generate an invalid URL at runtime. Marking it as `required: true` or giving it a sensible default would prevent this silent misconfiguration and make issues easier to detect.

```suggestion
  - name: host
    required: true
```
</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.

Make host required.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
jq: .FVPower
{{- end }}
{{- if eq .usage "grid" }}
jq: .HousePower - .FVPower
Copy link
Member

Choose a reason for hiding this comment

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

This does not look right

Copy link
Author

@grobihh grobihh Mar 22, 2026

Choose a reason for hiding this comment

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

Grid power = house power - solar power.
I confirmed that with the readings from V2C APP.

Copy link
Member

Choose a reason for hiding this comment

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

And what about battery?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, that question occurred to me too.
Unfortunately I do not have a battery and cannot test it.
And I have no documentation about that.
It may be jq: .HousePower - .FVPower - .BatteryPower.

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

Labels

devices Specific device support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants