EVCC integration via MQTT (sensor entity config)

Found in the documentation for the phase switch the hint. The sensor must be set like:

  - name: evcc_phases
    unique_id: uniqueid__evcc_phases_select
    icon: mdi:backburger
    state_topic: "evcc/loadpoints/1/phasesEnabled"
    command_topic: "evcc/loadpoints/1/phases/set"
    availability_topic: "evcc/status"
    options:
      - "1"
      - "3"

Now it is possible to switch between 1 phase and 3 phase for my NRGKick Charger, because the charger is not directly implemented in evcc and i have to control it with mqtt as an universal charger. With this switch i change the setting within the evcc and also on the charger.

image
image
image

one click on the button →
image
image
image

Thx for your support :wink:

Hey all,
thanks for the ton of useful sensors. I wanted to get rid of my FiatChamp addon, since its doublicating queries against the FIAT API, so I checked and EVCC nicely had all the values I was looking for.
So I also added the following entities:

  sensor:
    - name: evcc_charge_duration_time
      unique_id: uniqueid__evcc_charge_duration_time
      icon: mdi:timer-settings-outline
      state_topic: "evcc/loadpoints/1/chargeDuration"
      value_template: "{{ value | int(0) | timestamp_custom('%-Hh %-Mmin %-Ssec', false) }}"
      availability_topic: "evcc/status"

    - name: evcc_vehicle_soc
      unique_id: uniqueid__evcc_vehicle_soc
      icon: mdi:fuel-cell
      state_topic: "evcc/loadpoints/1/vehicleSoc"
      value_template: "{{ value | round(1) }}"
      unit_of_measurement: "%"
      availability_topic: "evcc/status"

    - name: evcc_vehicle_range
      unique_id: uniqueid__evcc_vehicle_range
      icon: mdi:map-marker-distance
      state_topic: "evcc/loadpoints/1/vehicleRange"
      value_template: "{{ value | round(0) }}"
      unit_of_measurement: "km"
      availability_topic: "evcc/status"

    - name: evcc_session_energy_kwh
      unique_id: uniqueid__evcc_session_energy_kwh
      icon: mdi:battery-charging-high
      state_topic: "evcc/loadpoints/1/sessionEnergy"
      value_template: "{{ (value | float / 1000) | round(1) }}"
      unit_of_measurement: "kWh"
      availability_topic: "evcc/status"

    - name: evcc_session_solar_percent
      unique_id: uniqueid__evcc_session_solar_percent
      icon: mdi:weather-sunny-alert
      state_topic: "evcc/loadpoints/1/sessionSolarPercentage"
      value_template: "{{ value | round(1) }}"
      unit_of_measurement: "%"
      availability_topic: "evcc/status"

Perhaps someone might find them useful.
Best

1 Like

Many thanks for the code here.

A short question, because that just took me some time to fix:

“evcc/status” is not an entity in my installation. I couldn’t control mode without deleting that line.

Is there any harm in not having an availability_topic ?

Hey there, happy you found this useful.
Seems something weird is going on here.

“evcc/status” is not an entity in my installation.

Your EVCC instance should publish the evcc/status topic. Please use an MQTT client (http://mqtt-explorer.com/) and check which messages are on the broker. You might want to restart EVCC to trigger a complete set of published messages.

Is there any harm in not having an availability_topic ?

Not in the first step. However, availability is an important concept in Home Assistant. If your EVCC instance is stopped, you will be left with entities holding the last known value published by EVCC. Your HomeAssistant setup will have you believe false/outdated information (Car still at 30% battery charge after a full day of charging). This could also lead to malfunctioning automations etc.
In order to avoid this and to aid in troubleshooting, it’s important to mark an entity as unavailable. This is where the availability_topic is necessary.

Hi @ThomDietrich

Vielen Dank fĂŒr Deine Konfiguration. Wir haben uns erlaubt auf Basis Deiner Konfiguration in unserem GitHub repository entsprechende YAMLs anzulegen und zu teilen: homeassistant-puzzlepieces/installation/evcc-mqtt-integration at main · ha-puzzles/homeassistant-puzzlepieces · GitHub. Und zwar modular, so dass man diese pro Vehicle und Loadpoint einfacher auswĂ€hlen kann.

Zudem Àndern sich die Topics ja stÀndig.

Da nun auch einige Werte vom Loadpoint zum Vehicle gewandert sind, haben wir außerdem noch Automations und Helfer erzeugt.

Ich hoffe das ist fĂŒr Dich so in Ordnung.

Viele GrĂŒĂŸe,
Carsten

1 Like

Hallo Carsten, das ist absolut in Ordnung! Im Gegenteil, ich finde den Mehrwert den ich auf Anhieb sehe super.
Ich vermute ihr habt euch bewusst dazu entschieden auf Deutsch zu dokumentieren. Das ist gut und fein aber bedeutet leider, dass wir eure Arbeit hier nicht pauschal fĂŒr die breite Community anbieten können


Übrigens, ich dachte mir immer mal wieder, dass statt einer verbesserten Liste an yaml entities eine HA integration/component fĂŒr EVCC stark wĂ€re. Die Implementierung kann nicht so kompliziert sein, im wesentlichen mĂŒssen abhĂ€ngig von ge-publish-ten Daten Entities generiert werden


2 Likes

Hi everyone,

it seems my home assistant config is not capable of receiving any evcc mqtt messages.

State:

  1. Home assistant MQTT is running and working with other devices (DTUs from inverters). MQTT account is set up.
  2. EVCC is running and publishing MQTT, IP/Port/User/Password of mqtt home assistant is properly written in the evcc.yaml. I can see the messages via MQTT explorer. There are 0 error messages in the log of EVCC on the debug level.
  3. There is no way to make the mqtt integration of home assistant read the evcc messages. Listening on topic will also not produce anything. Restart of home assistant has not worked. There is nothing in the logs of MQTT (even though debug protocol is activated).

What am I missing?

Hi everyone,
there is another new value available: bufferStartSoc names the battery level, when pv mode charging starts even w/o enough live solar power. It can be configured identically to buffersoc.
cu, H
image

is it possible to show the pv powers in details. I have 3 pv’s in evcc and i want to show the individually sources, not only the total PV power

add “0” to options if you have automated switching, 0 stands for auto, you need extra lines in evcc.yaml for your charger

Phases1p3p: # phase switching (1/3)
  source: mqtt
  topic: *your topic*
tos: true

This gets charge planner times, start and finish.

sensor:
    - name: evcc_plan_start_time_lp1
      unique_id: uniqueid__evcc_plan_start_time_lp1
      icon: mdi:timer-settings-outline
      state_topic: "evcc/loadpoints/1/planProjectedStart"
      value_template: "{{ value | int(0) | timestamp_custom('%H:%M %d/%m/%y', local=true) }}"
      availability_topic: "evcc/status"
      
    - name: evcc_plan_finish_time_lp1
      unique_id: uniqueid__evcc_plan_finish_time_lp1
      icon: mdi:timer-settings-outline
      state_topic: "evcc/loadpoints/1/effectivePlanTime"
      value_template: "{{ value | int(0) | timestamp_custom('%H:%M %d/%m/%y', local=true) }}"
      availability_topic: "evcc/status"

Can anyone help with getting time and date on seperate lines, like this

12:00
15/05/24

there is now a custom component for evcc
has a lot more capabilites

3 Likes

Finally! I was thinking of creating one more than once but never got around to it.
Thanks to the author for this :slight_smile:

2 Likes

Anyone know how to delete/disable charge plan with MQTT message??
That integration seems to have it


Send a charge plan for some day in the future with 0 kWh of energy.