Evcc Binding [4.0.0.0;5.0.0.0)

Hi, first of all, thank you very much for the binding. I can integrate my PV perfectly into Openhab via evcc.

I have a Luxtronic heat pump as a load point and read ‘loadpoint-charging-power’. Unfortunately, the value is only displayed correctly once initially and then no longer changes.

If I delete the linked item and recreate it, the value is correct again, but then remains unchanged.

I’m not sure how to debug this at the moment.

Can anyone help me?

openHAB 5.1.0 Release Build Main UI Commit 69bf7f37

Hi, how did you configure the heating loadpoint in openHAB and in evcc?

Can you send me the JSON of the loadpoint?

http://<your evcc instance IP / URI>:7070/api/state

I will also cross check here with a demo setup.

api-state.json (163.3 KB)

Hi, I hope I’m answering the questions correctly. I simply created the heat pump in the evcc webUI, which basically just meant selecting the manufacturer and entering the IP address.

Then I installed the binding in openHAB and created the things that were discovered. I then created equipment using the semantic model and selected the data points I wanted.

I then noticed that the loadpoint power was not changing.

Attached is the *.json from the evcc API and the config from evcc itself.

Edit: the loadpoints → 0 → chargePower in the api/state json response is correct.

{
  "site": {
    "title": "Home",
    "grid": "db:6",
    "pv": ["db:8"],
    "battery": ["db:7"],
    "aux": null,
    "ext": null
  },
  "loadpoints": [
    {"id":2,"name":"db:2","charger":"db:1","title":"Novelan LADV 9","defaultMode":"off","priority":0,"phasesConfigured":1,"minCurrent":0.2,"maxCurrent":16,"smartCostLimit":null,"smartFeedInPriorityLimit":null,"planEnergy":0,"planTime":"0001-01-01T00:00:00Z","planPrecondition":0,"limitEnergy":0,"limitSoc":57,"planStrategy":{"continuous":false,"precondition":0},"thresholds":{"enable":{"delay":60000000000,"threshold":0},"disable":{"delay":180000000000,"threshold":0}},"soc":{"poll":{"mode":"charging","interval":3600000000000},"estimate":true}}
  ],
  "charger": [
    {"config":{"heatoffset":2,"host":"192.168.178.52","modbus":"tcpip","template":"luxtronik","wwoffset":5},"deviceProduct":"Novelan WPR NET","id":1,"name":"db:1","type":"template"}
  ],
  "meter": [
    {"config":{"forceaccharging":"false","host":"192.168.178.87","maxacpower":"0","maxchargepower":"10000","modbus":"tcpip","storageunit":"1","template":"huawei-sun2000","timeout":"15s","usage":"pv"},"deviceProduct":"Huawei SUN2000","deviceTitle":"Huawei SUN 2000","id":8,"name":"db:8","type":"template"},
    {"config":{"forceaccharging":"false","host":"192.168.178.87","maxacpower":"0","maxchargepower":"10000","modbus":"tcpip","storageunit":"1","template":"huawei-sun2000","timeout":"15s","usage":"grid"},"deviceProduct":"Huawei SUN2000","id":6,"name":"db:6","type":"template"},
    {"config":{"capacity":13.8,"forceaccharging":"false","host":"192.168.178.87","maxacpower":"0","maxchargepower":7000,"maxdischargepower":7000,"modbus":"tcpip","storageunit":"1","template":"huawei-sun2000","timeout":"15s","usage":"battery"},"deviceProduct":"Huawei SUN2000","deviceTitle":"Huawei LUNA 2000","id":7,"name":"db:7","type":"template"}
  ],
  "tariffs": "currency: EUR

grid: # price using energy from the grid
  type: fixed
  price: 0.294 # EUR/kWh

feedin: # price for feeding solar energy to the grid
  type: fixed
  price: 0.08 # EUR/kWh

#co2: # carbon intensity forecast
#  type: template
#  template: grünstromindex
#  zip: *****

#solar: # list of pv generation forecast (additive)
#- type: template
#  template: solcast
#  site: <site>
#  token: *****",
  "mqtt": {"broker":"","user":"","password":"","clientID":"","insecure":false,"caCert":"","clientCert":"","clientKey":"","topic":"evcc"},
  "influx": {"url":"","database":"","token":"","org":"","user":"","password":"","insecure":false},
  "shm": {"vendorId":"","deviceId":""},
  "interval": 30
}

Thanks for your input. I’ve found the bug and could fix it. Please use the latest jar file linked at first post. Otherwise you will have to wait until the code gets merged and a snapshot gets released.

1 Like

That’s somewhat off, I can’t even come up with a proper use case for that right away, and the average user will want examples to work with the default setup. Please change it in the docs.

Sure no worries, will be fixed when the current PR gets merged.

Thank you very much, Marcel, for your quick response.
I updated the binding as described in Bundle Management | openHAB. As expected, everything was initially set to UNDEF, then the values were updated.
Great.

1 Like

I recently updated to evcc Binding Release 1.5 (together with openHAB 4.3.9)

I’ve noticed that the vehicle things stay uninitialized with the following error:

HANDLER_INITIALIZING_ERROR
Cannot invoke “com.google.gson.JsonObject.entrySet()” because “jsonState” is null

All others things work as expected.

I’ve updated the jar File for the community market.
Please reinstall. Everything should work then.

1 Like

I need your advice again. There are two Channels loadpoint-effective-limit-soc and loadpoint-limit-soc. Both linked to Items of type Number:Dimensionless.

The state of the first one always has the same state as shown in the evcc UI for SoC limit (“Ladelimit”) which you can see in the following screenshot.

The state of the second one is according to my observations always UnDefType or 0 %. But it can handle commands which will be sent to the evcc API and change the SoC limit (“Ladelimit”) for the active session.

Do you have any idea why there are two Channels for the SoC limit? One for the state and one to handle commands?

Currently it is not comfortable to use it for a slider card in Main UI. The card is not capable of separating between Item for displaying the State and another Item for handling the Commands.

I, too, stumbled across it and use loadpoint-effective-limit-soc
Cannot explain the difference though. cc: @weymann

it can be done e.g.

component: oh-slider-item
config:
  action: command
  actionCommand: =items.SollSoCHausbatterie.state
  actionFeedback: ='Batterie wird auf SoC ' + items.SollSoCHausbatterie.state + " geladen."
  actionItem: HausbatterieSoCSetzen
  autorepeat: true
  autorepeatDynamic: true
  badge: ='lade'
  color: orange
  footer: ='Der aktuelle SoC liegt bei ' + items.SoCHaus.state + '. Nach dieser
    Auswahl wird die Batterie auf den hier angegebenen Ladestand geladen.'
  icon: iconify:mdi:battery-charging
  item: SollSoCHausbatterie
  label: true
  max: 100
  min: 0
  releaseOnly: true
  scale: true
  style:
    font-size: 1.0em
  title: Batterie laden
  unit: "%"

I wasn’t aware that I can add an
command action configuration for a slider in the YAML. Will try that.

I was tinkering around with the Follow Profile which seems to work too.

items:
  wallboxSessionMaxBatteryLevel:
    type: Number
    label: Ladevorgang Max. Batterieladung
    icon: energy
    format: '%d %%'
    groups:
      - gWALLBOX
    tags:
      - Control
      - Energy
    channels:
      evcc:loadpoint:api:vestel-evc04:loadpoint-effective-limit-soc: {}
      evcc:loadpoint:api:vestel-evc04:loadpoint-limit-soc:
        profile: system:follow

As far as I know the effective soc limit will be set either by user, by plan or by vehicle. So whatever is active / the minimum will become the effective soc limit.

Limit soc should only be 0 or UNDEF if no car is connected to charging point. Otherwise the user defined value should be displayed.

I tried the latest from the Marketplace, I tried the latest from Github - but both are throwing ava.lang.ClassCastException: class com.google.gson.JsonObject cannot be cast to class com.google.gson.JsonArray (com.google.gson.JsonObject and com.google.gson.JsonArray are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @131fb73c) - and not showing any other things discovered

My evcc version is: v0.301.2, Openhab 5.2.0
Maybe that’s the issue? But I read further up in this topic than someone else has it working

Hi, sorry for the inconvenience. Evcc changed its API lrecently, there is already a PR for the fix. Once it got merged I will rebuild the jar files and it should work again.

do you know a safe evcc version before that change was introduced?

cc: @weymann

Any version before 0.300.0

1 Like