They have changed a few API and MQTT names the last couple of releases. The screenshot in my first post should not be your reference
Checking the MQTT broker for published messages beyond what I use is anyhow a good idea. Any MQTT client will do the job. I can recommend MQTT Explorer.
Let me rephrase that. You took a snippet of valid Home Assistant configuration and added it to the end of your evcc configuration. Hope you can hear the irony in this
What I’ve posted must be part of your Home Assistant configuration. The code must go in a file under <HomeAssistantConfig>/packages/evcc-or-similar-name.yaml. In order to load that file you need to also enable packages in your <HomeAssistantConfig>/configuration.yaml. Read:
It works nearly perfectly now. The only thing missing is that I can’t use the sensors for the energy dashboard. Is it only my problem or do we need to configure the sensors differently?
for the energy dashboard to work, you need to add state_class: measurement to the relevant sensor definitions. Which ones do you think are relevant and I am happy to amend them above.
Second, you need to create helper sensors “Riemann sum integral” with “k (kilo)” and “hour” for each of these new sensors (and in addition for the pv_grid_power sensor).
Third, you can use this Riemann sensors for the energy dashboard.
Hello, if you add the unique_id to the sensors you don’t need to do the conversion with Riemann, you can also do this via the user interface at the gear wheel at the top of the sensor.
Sorry if I didn’t understand that thought: Why do you need Riemann (which intrinsically introduces a drift) if we already have evcc_charged_energy_kwh coming directly from EVCC?
Would love to update my set of complete MQTT entities above, as soon as we agree on the solution.
@ThomDietrich
EVCC exports also the evcc/site/gridEnergy if the meter supports it.
Since the meter is placed at feed-in, is that the total grid consumption (home usage - PV produced) ?
First of all: Thank you very much @ThomDietrich for your effort in integrating evcc into Home Assistant via MQTT. It works like a charm and adds an unbelievable amount of WAF
I have a side question: Do you know how to change the frontend values of the mqtt-state-options? As far as I know, these values don’t have friendly names. I’d like to enhance the WAF further and like to change the displayed names to stuff like “No Charging”, “PV only”, “Charge fast”:
I can’t think of an easy way. Sadly you can’t “translate” states like in the example. You have to define a new input with your desired display names, then set the MQTT entity from that via an automation.
Something like the below. Please share your working solution!!
Gnah, I thought there will be an easier way than another automation. Thanks for your input!
Edit: I found a solution. I don’t know if its easier but it’s at least prettier than the MQTT topics in a drop down menu (in my opinion):
The Buttons will change their color according to the current state of the select-entity. When the Mode is off, the other buttons will be dark, in any other case, they will light up so that you can see that your charger is ready for operation.
I couldn’t get what I wanted with on-board lovelace cards and used a custom integration. If you’d like to recreate the dashboard, you’ve got to install the Custom Button Card Integration first - use HACS for your convenience.
Then I stacked a couple of buttons horizontally with the following code:
You could even beautify that more with a grid (I’m not yet lucky with the colors, does anyone know the standard “yellow” for the default dark skin? ):