Skip to content

Mqtt: document vehicle selection #810

@grogi

Description

@grogi
Contributor

Is your feature request related to a problem? Please describe.

Evcc publishes topic evcc/loadpoints/{loadpoint_id}/vehicleName which shows which car was selected / autodetected as connected to the given loadpoint. It however doesn't allow the user to update this value through MQTT.

Image

Describe the solution you'd like

Please make the topic evcc/loadpoints/{loadpoint_id}/vehicleName writeable. A message to evcc/loadpoints/{loadpoint_id}/vehicleName/set would update the vehicleName.

Three scenarios here

  1. the payload represents a valid vehicle name - the update happens.
  2. the payload is empty - update happens by setting 'guest vehicle / no vehicle'
  3. the payload is not empty, but not represents valid vehicle name - ignore

Describe alternatives you've considered

HTTP integration already supports updating the vehicleName through POST and DELETE methods. Having everything supported through MQTT would be beneficial for consistency.

Additional context
Add any other context or screenshots about the feature request here.

Activity

andig

andig commented on May 28, 2025

@andig
Member

If you want to change the vehicle name then that needs to be under vehicles, not loadpoints.

grogi

grogi commented on May 28, 2025

@grogi
ContributorAuthor

@andig The vehicleName in this context is an identifier (indeed defined in vehicles) referencing a vehicle. Changing the vehicleName updates the reference, not the name of the vehicle itself.

This is already implemented, but in REST API integration. But it is missing in the MQTT integration.

Please consider reopening this request - I think you dismissed it too quickly because of miscommunication from my side.
I accept if it is low on the priority list and might never be implemented. But I feel it should not be closed because I misunderstand what I want to do :)

andig

andig commented on May 28, 2025

@andig
Member

In oder words: you don't want to update the vehicle name but select a different vehicle? Das geht unter vehicle.

/cc @Maschga

reopened this on May 28, 2025
transferred this issue fromevcc-io/evccon May 28, 2025
changed the title [-]MQTT Integration: evcc/loadpoints/{id}/vehicleName is not writeable[/-] [+]Mqtt: document vehicle selection[/+] on May 28, 2025
grogi

grogi commented on May 28, 2025

@grogi
ContributorAuthor

Genau :) Select a different vehicle that is assigned to given loadpoint.

Basically the same to those two REST API endpoints, but through MQTT.

DELETE /loadpoints/{id}/vehicle
POST /loadpoints/{id}/vehicle/{name}

Maschga

Maschga commented on May 28, 2025

@Maschga
Contributor

Ich schreibe das Issue auf meine TODO Liste.
Ich weiß aber nicht, wann ich Zeit dafür finde.

Maschga

Maschga commented on May 28, 2025

@Maschga
Contributor

Gehört dieses Issue nicht eigentlich ins evcc-io/evcc Repo, @andig ?

andig

andig commented on May 28, 2025

@andig
Member

Die Lösung ist ja nur Doku, nicht Software, deshalb hier.

Maschga

Maschga commented on May 28, 2025

@Maschga
Contributor

Achso, ich dachte, dass muss noch implementiert werden.
In dem Fall verweise ich hierauf: #782 (comment)

andig

andig commented on May 28, 2025

@andig
Member

DIe mqtt-API ist viel zu groß und undurchsichtig, um sie manuell zu dokumentieren und danach zu aktualiseren.

Kann ich helfen? Eigentlich ist mqtt.go halbwegs gut strukturiert :O

Maschga

Maschga commented on May 28, 2025

@Maschga
Contributor

Die mqtt.go ist super, aber beinhaltet nur die Setter. Alle anderen Read-Only Felder sind da leider nicht dokumentiert.

andig

andig commented on May 28, 2025

@andig
Member

Das stimmt. Die sind aber alle 1:1 identisch mit dem HTTP Api. Aus Slices werden 1-based Index Topics, Structs werden hierarchische Topics. Mehr Magie ist eigentlich nicht :) Im Gegensatz zu HTTP ist das aber eigentlich auch egal- was es gibt sieht man ja auch Mqtt!

grogi

grogi commented on May 28, 2025

@grogi
ContributorAuthor

Ok, I think I have a handle on it. I found were all the setters are defined, I can help document the MQTT API.

Maschga

Maschga commented on May 29, 2025

@Maschga
Contributor

I can help document the MQTT API.

That's great! In #746 every Setter should already be documented.
However, it would be nice, to have all the Getters included.

Do you know whether is it possible in Go to extract the Getters from the source Code, @andig ?

andig

andig commented on May 29, 2025

@andig
Member

Basically every single publish becomes a getter. I don‘t think its useful to define these though as they might change any time. The ones from REST api can be considered stable.

Maschga

Maschga commented on May 29, 2025

@Maschga
Contributor

OK, I'll make a PR with Setters only.
But what to do with #714?

linked a pull request that will close this issue on May 29, 2025
naltatis

naltatis commented on May 29, 2025

@naltatis
Member

Mehr Magie ist eigentlich nicht :)

Yes, but there's definitely in value in having a list of all the possibilities on one page. Inferring from REST + a set of transformation rules is not trivial.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @naltatis@andig@grogi@Maschga

      Issue actions

        Mqtt: document vehicle selection · Issue #810 · evcc-io/docs