Coder Social home page Coder Social logo

marq24 / ha-evcc Goto Github PK

View Code? Open in Web Editor NEW
36.0 4.0 2.0 288 KB

Home Assistant integration for evcc☀️🚘- optimized charging of electric vehicles, connecting your EV charger with your PV system. The integration use local polling (interval configurable) of the evcc API. Please note, that this integration is not official and not supported by the evcc developers. This project is not affiliated with evcc in any way.

License: Apache License 2.0

Python 100.00%
evcc hacs home-assistant home-automation pv wallbox home-assistant-hacs home-assistant-integration hacs-integration

ha-evcc's Introduction

Home Assistant Integration: evcc☀️🚘- Solar Charging (unofficial)

logo

I was surprised that looks like that there does not exist a simple Home Assistant integration for evcc - even if I do not believe that I have the need for evcc at all, I want to contribute a very simple & basic integration which allow you to control evcc objects simply via the default HA gui.

Please note, that this 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.

hacs_badge github BuyMeCoffee PayPal hainstall

Disclaimer

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.

Requirements

  • A running & configured evcc instance in your network

Main features

  • 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.

Example Dashboard

Just take a look at this sample Dashboard (showing Sensors from one load point):

sampledashboard

Installation

via HACS

  1. Add a custom integration repository to HACS: https://github.com/marq24/ha-evcc
  2. Install the custom integration
  3. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "evcc☀️🚘- Solar Charging"
  4. Setup the go-eCharger custom integration as described below

manual steps

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called evcc_intg.
  4. Download all the files from the custom_components/evcc_intg/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "evcc☀️🚘- Solar Charging"

Adding or enabling the integration

My Home Assistant (2021.3+)

Just click the following Button to start the configuration automatically:

Open your Home Assistant instance and start setting up a new integration.

Manual steps

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-ip-here:7070
  • Provide area where the wallbox 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.

Use evcc with your Home Assistant sensor data

Please see the separate document where you can find examples how to provide your evcc instance with HA sensor data.

Are you are go-eCharger V3 (or higher) User?

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.

Want to report an issue?

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).

In order 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

Advertisement / Werbung - alternative way to support me

Switch to Tibber!

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!


References

ha-evcc's People

Contributors

marq24 avatar slauth avatar

Stargazers

Lode Smets avatar Dion avatar  avatar Daniel Fernau avatar Alex avatar Flo avatar  avatar Florian Wartner avatar Jonis Kiesbye avatar  avatar  avatar Rainer Poisel avatar  avatar Roeland Lutters avatar  avatar Stefan avatar Torge Rosendahl avatar Armin Burger avatar  avatar Thomas Blankschein avatar  avatar  avatar Johannes Dilli avatar  avatar  avatar Sandalots avatar Michael Geers avatar  avatar  avatar  avatar  avatar  avatar Thomas Dietrich avatar mkaiser avatar Stefan Kral avatar Timo Reimann avatar

Watchers

 avatar ScooterisT5 avatar  avatar  avatar

Forkers

4n4n4s slauth

ha-evcc's Issues

Cannot select "Leistung Heim" and "Leistung PV" in home assistants native section for "Energie"

Checklist

  • I have installed the latest release (or BETA) version of the integration and home assistant.
  • I have prepared DEBUG log output (for technical issues) | In most of the cases of a technical error/issue I would have the need to ask for DEBUG log output of the integration. There is a short tutorial/guide 'How to provide DEBUG log' here
  • I confirm it's really an issue | In the case that you want to understand the functionality of a certain feature/sensor Please be so kind and make use if the discussion feature of this repo (and do not create an issue) - TIA

Add a description

Hi.
GRIDPOWER, HOMEPOWER and PVPOWER have unit_of_measuremen= UnitOfPower.WATT.
I would like to use these sensors to power the native Energy functions of Home Assistant, which means I want to select these sensors under Energie -> Netzverbrauch and Engerie -> Netzeinspeisung in the Home Assistant UI.
But that's not possible as home assistant excepts the unit_of_measuremen to be an energy measurement, not a power measurement, for example UnitOfPower.WATTHOURS.
And idea on what I need to do to make these values available to be consumed by the Energy-area of home assistant?

image

Add your DEBUG log output

No response

Minor comments after first use

Hy @marq24,
thanks for providing this integration. As mentioned in my community thread on the MQTT integration, I am very fond to finally see this being developed :)

May I post two-three smaller things that came to my mind upon first use of your integration?

  1. Integration name: You've named this integration "evcc Bridge (unofficial)". That's not quite in line with typical naming conventions. 99% of integrations are unofficial and your integration technically isn't a bridge, it is quite literally an integration :) In line with other integrations I would suggest "evcc" or "evcc - Solar Charging"
  2. HACS description has a typo: "HACs Home Assistant Integration for a local running evcc backend - control evcc from HA - communicate via the HTTP API" and you could make it more relevant to full text search: "Home Assistant integration for evcc - optimized charging of electric vehicles, connecting your EV charger with your PV system" (taken from their webpage)
  3. Entity friendly names: All entities have an additional "[evcc]" prefix and even though I understand why this might seem useful, it's far from the general guidelines / what you see in other integrations. All entities have a logical link to their integration and the addition in the friendly name isn't needed
  4. Entity IDs are often in the format of sensor.evcc_batterycapacity or sensor.evcc_chargepower_1_my_garage. I believe that 1. words should be separated (e.g. sensor.evcc_battery_capacity) and 2. the hierarchy/topology could be stricter: sensor.evcc_my_garage_charge_power

I hope you found this useful. I don't claim to know any of these points better than you do but would certainly be interested in your opinion about them. Best and thanks!

Wrong state class for some entities

Checklist

  • I have installed the latest release (or BETA) version of the integration and home assistant.
  • I have prepared DEBUG log output (for technical issues) | In most of the cases of a technical error/issue I would have the need to ask for DEBUG log output of the integration. There is a short tutorial/guide 'How to provide DEBUG log' here
  • I confirm it's really an issue | In the case that you want to understand the functionality of a certain feature/sensor Please be so kind and make use if the discussion feature of this repo (and do not create an issue) - TIA

Add a description

While trying to add the energy of my charging stations to the home assistant energy dashboard I found that some energy entities have the wrong state_class attribute. The energy entities should have the state_class "total_increasing" instead of "measurement"

image

Add your DEBUG log output

No response

Mismatch of current selection between EVCC itself and this integration?

Discussed in #3

Originally posted by MortuuS June 3, 2024
Hi!
First of all thanks for this integration. But I think I found a bug, or I am misunderstanding something?

In the dropdown menu of 'charging current max' the selections range from 0.125A to 14A. While the dropdown menu in EVCC goes from 6A to 32A.
Similar problem with 'charging current min' this integration goes from 6A to 32A. While EVCC goes from 0.125A to 16A
So these inputs seem switched to me? And also the upper limit for minimum current seems incorrect (14A vs 16A).

Screenshot 2024-06-03 172958
Screenshot 2024-06-03 173031

Thanks again. 👍

EVCC URL with trailing "/" can do GET requests but POST requests won't work

Checklist

  • I have installed the latest release (or BETA) version of the integration and home assistant.
  • I have prepared DEBUG log output (for technical issues) | In most of the cases of a technical error/issue I would have the need to ask for DEBUG log output of the integration. There is a short tutorial/guide 'How to provide DEBUG log' here
  • I confirm it's really an issue | In the case that you want to understand the functionality of a certain feature/sensor Please be so kind and make use if the discussion feature of this repo (and do not create an issue) - TIA

Add a description

When configuring this integration, I copied the URL to EVCC directly from my browser into the URL field - including a trailing "/". This worked fine for displaying all values provided by EVCC but when trying to change a value it resulted in a 404 error as shown in the debug log and only in the debug log - in the HA UI it doesn't generate an error or anything like that.
Deleting and Re-adding my EVCC instance without the trailing "/" led to a working integration as expected.
This issue is more of a reminder for input checking at the installation stage ;)

Otherwise really nice work - thank you very much!

Add your DEBUG log output

2024-07-11 16:42:13.624 DEBUG (MainThread) [custom_components.evcc_intg.pyevcc_ha] GET request: http://192.168.0.240:7070//api/state
2024-07-11 16:42:13.628 DEBUG (MainThread) [custom_components.evcc_intg] number of fields after query: 39
2024-07-11 16:42:13.628 DEBUG (MainThread) [custom_components.evcc_intg] Finished fetching evcc_intg data in 0.004 seconds (success: True)
2024-07-11 16:42:23.403 DEBUG (MainThread) [custom_components.evcc_intg.pyevcc_ha] POST request: http://192.168.0.240:7070//api/vehicles/peugeote208/plan/soc/100/2024-07-12T07:00:00.000Z
2024-07-11 16:42:23.406 WARNING (MainThread) [custom_components.evcc_intg.pyevcc_ha] APP-API: write_value failed with http-status 404
2024-07-11 16:42:28.624 INFO (MainThread) [custom_components.evcc_intg.pyevcc_ha] going to read all frequent_data from [email protected]:7070/
2024-07-11 16:42:28.624 DEBUG (MainThread) [custom_components.evcc_intg.pyevcc_ha] GET request: http://192.168.0.240:7070//api/state?jq={loadpoints:.loadpoints,auxPower:.auxPower,batteryMode:.batteryMode,batteryPower:.batteryPower,batterySoc:.batterySoc,gridCurrents:.gridCurrents,gridPower:.gridPower,homePower:.homePower,homePower:.homePower,pvPower:.pvPower,vehicles:.vehicles}

Inlude `batteryMode` as entity

Description

If batteryDischargeControl is activated, there is a JSON element batteryMode which can be normal, hold or charge

Due to the fact that i'm using this information for HA automations, it would be nice to have them available in your integration and drop custom MQTT entities

API Keys

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.