I was surprised that looks like that there does not exist a simple Home Assistant integration for the very popular evcc. So before my first EV spawned at my driveway, I want to contribute a very simple & basic integration which allow you to control evcc objects simply via the default HA gui and use sensors and switches in your automations.
Please note, that this Home Assistant integration is not official and not supported by the evcc developers. I am not affiliated with evcc in any way. This integration is based on the evcc API and the evcc API documentation.
Please be aware, that we are developing this integration to best of our knowledge and belief, but cant give a guarantee. Therefore, use this integration at your own risk.
- A running & configured evcc instance in your network
-
Supporting all evcc API-POST & DELETE requests (except
POST /api/settings/telemetry/<status>
) to adjust the evcc settings, loadpoints and the corresponding vehicles- Loadpoint mode [Off, Solar, Min+Solar, Fast]
- Phases to use [Auto, 1p, 3p]
- Assign vehicles to loadpoints
- Configure min & max charging currents
- Configure cost limits (€ or CO₂)
- Adjust home-battery settings
- Adjust/create Vehicle & Loadpoint charging plan via HA-Services http://[YOUR-HA-INSTANCE]:8123/developer-tools/service
-
Supporting most of the other loadpoint and vehicle data that is available via the API - please let me know, if you miss some data - probably it just slipped through my attention during testing.
Just take a look at this sample Dashboard (showing Sensors from one load point):
You must have installed & configured an evcc instance in your network. This can be either a stand-alone installation (e.g via Docker) or as a HASS-IO-AddOn. This AddOn is available via the official evcc hassio-addon repository.
Add a custom integration repository to HACS: https://github.com/marq24/ha-evcc
Let me repeat: This is an HACS integration, not an HASS-IO AddOn, so you need to have HACS installed, and you need to add this as custom integration repository to HACS.Once the repository is added,use the search bar and typeevcc☀️🚘- Solar Charging
- Use the 3-dots at the right of the list entry (not at the top bar!) to download/install the custom integration - the latest release version is automatically selected. Only select a different version if you have specific reasons.
- After you presses download and the process has completed, you must Restart Home Assistant to install all dependencies
- Setup the evcc custom integration as described below (see Step II: Adding or enabling the integration)
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml
). - If you do not have a
custom_components
directory (folder) there, you need to create it. - In the
custom_components
directory (folder) create a new folder calledevcc_intg
. - Download all the files from the
custom_components/evcc_intg/
directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- Setup the evcc custom integration as described below (see Step II: Adding or enabling the integration)
You must have installed the integration (manually or via HACS before)!
Just click the following Button to start the configuration automatically (for the rest see Option 2: Manually steps by step):
Use the following steps for a manual configuration by adding the custom integration using the web interface and follow instruction on screen:
- Go to
Configuration -> Integrations
and add "evcc☀️🚘- Solar Charging" integration
- Provide a unique name for the integration installation (will be used in each sensor entity_id) created by the integration
- Provide the URL of your evcc web server (including the port) - e.g.
http://your-evcc-server-ip:7070
- [optional] Provide the area where the evcc installation is located
After the integration was added you can use the 'config' button to adjust your settings, you can additionally modify the update interval
Please note, that some of the available sensors are not enabled by default.
Please see the separate document where you can find examples how to provide your evcc instance with HA sensor data.
Do you know, that as owners of a go-eCharger (V3+) there is no need to use evcc for solar surplus charging? Even without any additional hardware! Home Assistant and the go-eCharger APIv2 Connect Integration is all you need. Get all details from https://github.com/marq24/ha-goecharger-api2.
By default, evcc and this integration focus on vehicles connected to a loadpoint, this implies that data like SOC or range are only available when the vehicle is actually connected.
Nevertheless, evcc provides this data in the configuration section (no matter of the connection state). If you want to access your vehicle SOC and range, when the vehicle is not connected to a loadpoint, you can do this by adding a command_line sensor to your Home Assistant configuration.yaml file.
Important
You need to know the technical vehicle_id
. Depending on from your configuration this is either the value you have specified in the evcc.yaml
file or it had been automatically generated.
In any case you can request: http://[YOUR_EVCC_IP]:7070/api/config/devices/vehicle
and check the value of the name
attribute to get your vehicle_id
.
Note
You must authorize your request(s) with the evcc password.
requesting http://[YOUR_EVCC_IP]:7070/api/config/devices/vehicle/[YOUR_VEHICLE_ID]/status
will return a json like this one here
{
"result": {
"capacity": {
"value": 84.68,
"error": ""
},
"chargeStatus": {
"value": "B",
"error": ""
},
"range": {
"value": 167,
"error": ""
},
"soc": {
"value": 39.5,
"error": ""
}
}
}
Check if you have already a command_line
section in your configuration.yaml
file - if there is none - create one on as top level entry like this (the line ' - sensor: ...' must (obviously) be replaced with the complete sections shown further below):
command_line:
- sensor: ...
Add in the command_line
section of your configuration.yaml
file the following content: sections with [CHANGE_ME:xxx]
have to be modified to your requirements. E.g. assuming your assuming vehicle_id
is ford_mach_e, then you have to replace [CHANGE_ME:YourVehicleId]
with just ford_mach_e
- sensor:
name: '[CHANGE_ME:Your Vehicle SOC & Range]'
unique_id: [CHANGE_ME:evcc_vehicle_soc_and_range]
command: |-
data='{"password":"[CHANGE_ME:YourEVCCPassword]"}'; ip='http://[CHANGE_ME:YourEVCCServerIP]:7070';\
c=$(curl -H 'Content-Type: application/json' -d $data -ksc - $ip/api/auth/login -o /dev/null);\
echo "${c}" | curl -ksb - $ip/api/config/devices/vehicle/[CHANGE_ME:YourVehicleId]/status
json_attributes_path: '$.result.range'
json_attributes:
- value
value_template: '{{ value_json.result.soc.value | float }}'
unit_of_measurement: '%'
# the scan_interval will be specified in seconds...
# for update every 5min use 300 (60sec * 5min = 300sec)
# for update every 15min use 900 (60sec * 15min = 900sec)
# for update every 1h use 3600 (60sec * 60min = 3600sec)
# for update every 24h use 86400 (60sec * 60min * 24h = 86400sec)
scan_interval: 900
Here is a complete example assuming:
- that your
vehicle_id
is: ford_mach_e - the IP of your evcc server is: 192.168.2.213
- the EVCC password is: myEvCCPwd
and you want to capture the soc as main entity information and the
range
as additional attribute of the entity that will be requested every 5 minutes:
- sensor:
name: 'My Ford Mach-E SOC & Range'
unique_id: evcc_mach_e_soc_and_range
command: |-
data='{"password":"myEvCCPwd"}'; ip='http://192.168.2.213:7070';\
c=$(curl -H 'Content-Type: application/json' -d $data -ksc - $ip/api/auth/login -o /dev/null);\
echo "${c}" | curl -ksb - $ip/api/config/devices/vehicle/ford_mach_e/status
json_attributes_path: '$.result.range'
json_attributes:
- value
value_template: '{{ value_json.result.soc.value | float }}'
unit_of_measurement: '%'
scan_interval: 300
Please use the GitHub Issues for reporting any issues you encounter with this integration. Please be so kind before creating a new issues, check the closed ones, if your problem have been already reported (& solved).
To speed up the support process you might like already prepare and provide DEBUG log output. In the case of a technical issue, I would need this DEBUG log output to be able to help/fix the issue. There is a short tutorial/guide 'How to provide DEBUG log' here - please take the time to quickly go through it.
For this integration you need to add:
logger:
default: warning
logs:
custom_components.evcc_intg: debug
Be smart switch to Tibber - that's what I did in october 2023. If you want to join Tibber (become a customer), you might want to use my personal invitation link. When you use this link, Tibber will we grant you and me a bonus of 50,-€ for each of us. This bonus then can be used in the Tibber store (not for your power bill) - e.g. to buy a Tibber Bridge. If you are already a Tibber customer and have not used an invitation link yet, you can also enter one afterward in the Tibber App (up to 14 days). [see official Tibber support article]
Please consider using my personal Tibber invitation link to join Tibber today or Enter the following code: 6o0kqvzf (six, oscar, zero, kilo, quebec, victor, zulu, foxtrot) afterward in the Tibber App - TIA!