evcc-io / hassio-addon

Hass.io add-on for EVCC
92 stars 58 forks source link

eebus not working on hassio #99

Closed jomach closed 3 months ago

jomach commented 3 months ago

Hey, I got the eebus connection working locally on my mac for the evvc. When I try the same config inside of my hass then I do not get the log:

[eebus ] DEBUG 2024/07/15 13:35:20 incoming connection request from a9cfa5fac0e5631cb87f09ce726103519eXXXXX

I think the the wallbox cannot reach the evvc inside of hass due to the containers.

Logs from a working installation Local on my mac:

jorge@MacBook-Pro-4 ~/Downloads                                                                               [8:41:56]
> $ evcc -c evcc.yaml
[main  ] INFO 2024/07/17 08:42:06 evcc 0.128.2
[main  ] INFO 2024/07/17 08:42:06 using config file: evcc.yaml
[db    ] INFO 2024/07/17 08:42:06 using sqlite database: /Users/jorge/.evcc/evcc.db
[mqtt  ] INFO 2024/07/17 08:42:06 connecting evcc-1236254900 at tcp://homeassistant.local:1883
[mqtt  ] DEBUG 2024/07/17 08:42:06 tcp://homeassistant.local:1883 connected
[eebus ] INFO 2024/07/17 08:42:06 Local SKI:  9a46bcb42045efb7a5f449a89482621ca87eb4dc
[eebus ] DEBUG 2024/07/17 08:42:06 starting websocket server on :4712
[eebus ] DEBUG 2024/07/17 08:42:06 mdns: announce
[eebus ] DEBUG 2024/07/17 08:42:06 mdns: using zeroconf
[eebus ] DEBUG 2024/07/17 08:42:06 mdns: start search
[main  ] INFO 2024/07/17 08:42:06 listening at :7070
[main  ] FATAL 2024/07/17 08:43:36 cannot create charger 'wallbox3': cannot create charger type 'template': cannot create charger type 'eebus': i/o timeout
[main  ] FATAL 2024/07/17 08:43:36 will attempt restart in: 15m0s
[eebus ] DEBUG 2024/07/17 08:44:09 ski: a9cfa5fac0e5631cb87f09ce726103519eff0fa6 name: Livo-EVB-500-HIDDEN brand: EVBox model: Livo typ: ChargingStation identifier: EVBox-Livo-EVB-500-HIDDEN register: false host: EVB-500-HIDDEN.local. port: 4712 addresses: [192.168.1.219]
[eebus ] DEBUG 2024/07/17 08:44:09 trying to connect to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 at EVB-500-HIDDEN.local.
[eebus ] DEBUG 2024/07/17 08:44:09 initiating connection to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 at EVB-500-HIDDEN.local.:4712/ship/
[eebus ] DEBUG 2024/07/17 08:44:16 incoming connection request from a9cfa5fac0e5631cb87f09ce726103519eff0fa6
[eebus ] DEBUG 2024/07/17 08:44:16 Send:  read 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/17 08:44:17 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement read 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/17 08:44:17 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN reply 2 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/17 08:44:17 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement reply 3 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/17 08:44:17 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN call 3 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2024/07/17 08:44:17 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN read 4 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/17 08:44:17 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN read 5 DeviceClassificationManufacturerData
[eebus ] DEBUG 2024/07/17 08:44:17 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN read 6 DeviceDiagnosisStateData
[eebus ] DEBUG 2024/07/17 08:44:17 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement call 5 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2024/07/17 08:44:17 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN result 7 5 ResultData 0
[eebus ] DEBUG 2024/07/17 08:44:17 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement result 7 3 ResultData 0
[eebus ] DEBUG 2024/07/17 08:44:17 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement reply 9 4 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/17 08:44:17 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement read 13 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/17 08:44:17 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN reply 8 13 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/17 08:44:18 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement read 15 NodeManagementDestinationListData
[eebus ] DEBUG 2024/07/17 08:44:18 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN reply 9 15 NodeManagementDestinationListData
[eebus ] DEBUG 2024/07/17 08:44:18 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:NodeManagement to NodeManagement read 17 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/17 08:44:18 Send: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN reply 10 17 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/17 08:44:18 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:DeviceClassification to DeviceClassification reply 19 5 DeviceClassificationManufacturerData
[eebus ] DEBUG 2024/07/17 08:44:18 Recv: d:_i:47859_EVBox-Livo-EVB-500-HIDDEN:DeviceDiagnosis to DeviceDiagnosis reply 21 6 DeviceDiagnosisStateData
[eebus ] DEBUG 2024/07/17 08:44:19 connection to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 failed: dial tcp [fe80::ee5c:84ff:fe21:618a%en0]:4712: i/o timeout
[eebus ] DEBUG 2024/07/17 08:44:19 trying to connect to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 at 192.168.1.219

Logs from HA:

starting evcc: 'EVCC_DATABASE_DSN=/data/evcc.db evcc --config /config/evcc.yaml'
[main  ] INFO 2024/07/17 08:49:11 evcc 0.128.2
[main  ] INFO 2024/07/17 08:49:11 using config file: /config/evcc.yaml
[db    ] INFO 2024/07/17 08:49:11 using sqlite database: /data/evcc.db
[mqtt  ] INFO 2024/07/17 08:49:11 connecting evcc-660314251 at tcp://homeassistant.local:1883
[mqtt  ] DEBUG 2024/07/17 08:49:11 tcp://homeassistant.local:1883 connected
[eebus ] INFO 2024/07/17 08:49:11 Local SKI:  9a46bcb42045efb7a5f449a89482621ca87eb4dc
[eebus ] DEBUG 2024/07/17 08:49:11 starting websocket server on :4712
[eebus ] DEBUG 2024/07/17 08:49:11 mdns: announce
[eebus ] DEBUG 2024/07/17 08:49:11 mdns: using zeroconf
[eebus ] DEBUG 2024/07/17 08:49:11 mdns: start search
[main  ] INFO 2024/07/17 08:49:11 listening at :7070
[eebus ] TRACE 2024/07/17 08:49:11 registering ski: a9cfa5fac0e5631cb87f09ce726103519eff0fa6
[main  ] FATAL 2024/07/17 08:50:41 cannot create charger 'wallbox3': cannot create charger type 'template': cannot create charger type 'eebus': i/o timeout
[main  ] FATAL 2024/07/17 08:50:41 will attempt restart in: 15m0s
[eebus ] DEBUG 2024/07/17 08:50:52 ski: a9cfa5fac0e5631cb87f09ce726103519eff0fa6 name: Livo-EVB-500-015-503 brand: EVBox model: Livo typ: ChargingStation identifier: EVBox-Livo-EVB-500-015-503 register: false host: EVB-500-015-503.local. port: 4712 addresses: [192.168.1.219]
[eebus ] DEBUG 2024/07/17 08:50:52 trying to connect to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 at EVB-500-015-503.local.
[eebus ] DEBUG 2024/07/17 08:50:52 initiating connection to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 at EVB-500-015-503.local.:4712/ship/
[eebus ] DEBUG 2024/07/17 08:51:02 connection to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 failed: dial tcp 192.168.1.219:4712: i/o timeout
[eebus ] DEBUG 2024/07/17 08:51:02 trying to connect to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 at 192.168.1.219
[eebus ] DEBUG 2024/07/17 08:51:02 initiating connection to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 at 192.168.1.219:4712/ship/
[eebus ] DEBUG 2024/07/17 08:51:12 connection to a9cfa5fac0e5631cb87f09ce726103519eff0fa6 failed:  dial tcp 192.168.1.219:4712: i/o timeout
[eebus ] DEBUG 2024/07/17 08:51:12 mdns: announce
[eebus ] DEBUG 2024/07/17 08:51:12 mdns: using zeroconf

See the missing line "incoming connection request" on the ha logs ?

jomach commented 3 months ago

This is all in the eebus packages, this is not part of evcc. You should not need a retry, this rather also hints at a problem of the wallbox.

I would really recommend getting it to run without a container in the first place. Because you are adding to much complexity and possible error scenarios.

Looking at the log (using macOS) in the first post:

  • When starting evcc the wallbox does NOT announce itself via mDNS

  • After 90s evcc stopps working as no connection could be established

  • After another 30s suddenly the mDNS announcement was published by the wallbox

  • The eebus stack tried to initiate a connection, and NONE worked

  • At the same time the wallbox initiated a connection, and only that worked

  • But as evcc stopped its main code, it does not function properly!

Overall: your setup does not run properly outside of a container as well.

Can it be that I need to connect the box via ehternet instead of cable ? It does not make much sense....

jomach commented 3 months ago

This is all in the eebus packages, this is not part of evcc. You should not need a retry, this rather also hints at a problem of the wallbox.

I would really recommend getting it to run without a container in the first place. Because you are adding to much complexity and possible error scenarios.

Looking at the log (using macOS) in the first post:

  • When starting evcc the wallbox does NOT announce itself via mDNS
  • After 90s evcc stopps working as no connection could be established
  • After another 30s suddenly the mDNS announcement was published by the wallbox
  • The eebus stack tried to initiate a connection, and NONE worked
  • At the same time the wallbox initiated a connection, and only that worked
  • But as evcc stopped its main code, it does not function properly!

Overall: your setup does not run properly outside of a container as well.

Hallo @DerAndereAndi, so I tried today with the new version with evcc and eebus in trace mode. I think the failure that you observed on the working instance is normal. The explanation for it is that I first started evcc and then I started the binding process over the wallbox app. Today I did the binding and restarted evcc and here are the logs:

[main  ] INFO 2024/07/29 13:46:10 evcc 0.129.0
[main  ] INFO 2024/07/29 13:46:10 using config file: evcc.yaml
[db    ] INFO 2024/07/29 13:46:10 using sqlite database: /Users/jorge/.evcc/evcc.db
[mqtt  ] INFO 2024/07/29 13:46:10 connecting evcc-556441454 at tcp://homeassistant.local:1883
[eebus ] INFO 2024/07/29 13:46:10 Local SKI:  9a46bcb42045efb7a5f449a89482621ca87eb4dc
[mqtt  ] DEBUG 2024/07/29 13:46:10 tcp://homeassistant.local:1883 connected
[eebus ] DEBUG 2024/07/29 13:46:11 starting websocket server on :4712
[eebus ] DEBUG 2024/07/29 13:46:11 mdns: announce
[eebus ] DEBUG 2024/07/29 13:46:11 mdns: using zeroconf
[eebus ] DEBUG 2024/07/29 13:46:11 mdns: start search
[main  ] INFO 2024/07/29 13:46:11 listening at :7070
[eebus ] DEBUG 2024/07/29 13:46:11 incoming connection request from a9cfa5fac0e5631cb87f09ce726103519eff0fa6
[eebus ] DEBUG 2024/07/29 13:46:11 ski a9cfa5fac0e5631cb87f09ce726103519eff0fa6 connected
[eebus ] DEBUG 2024/07/29 13:46:11 Send:  read 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/29 13:46:11 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement read 64 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/29 13:46:11 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 reply 2 64 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/29 13:46:12 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement reply 66 1 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/29 13:46:12 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 call 3 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2024/07/29 13:46:12 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 read 4 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/29 13:46:12 cs-lpc: 0 DeviceDiagnosis Server found
[eebus ] DEBUG 2024/07/29 13:46:12 cs-lpp: 0 DeviceDiagnosis Server found
[eebus ] DEBUG 2024/07/29 13:46:12 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 read 5 DeviceClassificationManufacturerData
[eebus ] DEBUG 2024/07/29 13:46:12 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 read 6 DeviceDiagnosisStateData
[eebus ] DEBUG 2024/07/29 13:46:12 ski a9cfa5fac0e5631cb87f09ce726103519eff0fa6 event cem-evsecc-EvseConnected
[eebus ] DEBUG 2024/07/29 13:46:12 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement call 68 NodeManagementSubscriptionRequestCall
[eebus ] DEBUG 2024/07/29 13:46:12 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 result 7 68 ResultData 0
[eebus ] DEBUG 2024/07/29 13:46:12 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement result 70 3 ResultData 0
[eebus ] DEBUG 2024/07/29 13:46:12 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement reply 72 4 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/29 13:46:12 ski a9cfa5fac0e5631cb87f09ce726103519eff0fa6 event cem-evsecc-UseCaseSupportUpdate
[eebus ] DEBUG 2024/07/29 13:46:12 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement read 76 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/29 13:46:12 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 reply 8 76 NodeManagementDetailedDiscoveryData
[eebus ] DEBUG 2024/07/29 13:46:12 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement read 78 NodeManagementDestinationListData
[eebus ] DEBUG 2024/07/29 13:46:12 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 reply 9 78 NodeManagementDestinationListData
[eebus ] DEBUG 2024/07/29 13:46:13 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:NodeManagement to NodeManagement read 80 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/29 13:46:13 Send: d:_i:47859_EVBox-Livo-EVB-500-015-503 reply 10 80 NodeManagementUseCaseData
[eebus ] DEBUG 2024/07/29 13:46:13 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:DeviceClassification to DeviceClassification reply 82 5 DeviceClassificationManufacturerData
[eebus ] DEBUG 2024/07/29 13:46:13 ski a9cfa5fac0e5631cb87f09ce726103519eff0fa6 event cem-evsecc-DataUpdateManufacturerData
[eebus ] DEBUG 2024/07/29 13:46:13 Recv: d:_i:47859_EVBox-Livo-EVB-500-015-503:DeviceDiagnosis to DeviceDiagnosis reply 84 6 DeviceDiagnosisStateData
[eebus ] DEBUG 2024/07/29 13:46:13 ski a9cfa5fac0e5631cb87f09ce726103519eff0fa6 event cem-evsecc-DataUpdateOperatingState
[site  ] INFO 2024/07/29 13:46:13 site config:
[site  ] INFO 2024/07/29 13:46:13   meters:      grid ✓ pv ✓ battery ✗
[site  ] INFO 2024/07/29 13:46:13     grid:      power ✓ energy ✓ currents ✓
[site  ] INFO 2024/07/29 13:46:13     pv 1:      power ✓ energy ✓ currents ✓
[site  ] INFO 2024/07/29 13:46:13   vehicles:
[site  ] INFO 2024/07/29 13:46:13     vehicle 1: range ✓ finish ✓ status ✓ climate ✗ wakeup ✓
[lp-1  ] INFO 2024/07/29 13:46:13 loadpoint 1:
[lp-1  ] INFO 2024/07/29 13:46:13   mode:        pv
[lp-1  ] INFO 2024/07/29 13:46:13   charger:     power ✓ energy ✗ currents ✓ phases ✗ wakeup ✗
[lp-1  ] INFO 2024/07/29 13:46:13   meters:      charge ✓
[lp-1  ] INFO 2024/07/29 13:46:13     charge:    power ✓ energy ✗ currents ✓
[lp-1  ] DEBUG 2024/07/29 13:46:13 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger)
[lp-1  ] DEBUG 2024/07/29 13:46:13 phase timer inactive
[lp-1  ] DEBUG 2024/07/29 13:46:13 pv timer inactive
[lp-1  ] INFO 2024/07/29 13:46:13 vehicle updated: unknown -> MG
[lp-1  ] DEBUG 2024/07/29 13:46:13 set charge mode: pv
[lp-1  ] DEBUG 2024/07/29 13:46:13 !! active phases: 3p = min(0p measured 3p vehicle 3p physical 0p charger)
[site  ] DEBUG 2024/07/29 13:46:13 ----
[lp-1  ] DEBUG 2024/07/29 13:46:13 charge power: 0W
[lp-1  ] DEBUG 2024/07/29 13:46:13 charge currents: [0 0 0]A
[site  ] DEBUG 2024/07/29 13:46:13 pv power: 8254W
[site  ] DEBUG 2024/07/29 13:46:13 grid meter: -8404W
[site  ] DEBUG 2024/07/29 13:46:13 grid powers: [-3084 -2688 -2633]W
[site  ] DEBUG 2024/07/29 13:46:13 grid currents: [-13.1 -11.3 -10.9]A
[site  ] DEBUG 2024/07/29 13:46:13 site power: -8404W
[eebus ] DEBUG 2024/07/29 13:46:15 ski: a9cfa5fac0e5631cb87f09ce726103519eff0fa6 name: Livo-EVB-500-015-503 brand: EVBox model: Livo typ: ChargingStation identifier: EVBox-Livo-EVB-500-015-503 register: false host: EVB-500-015-503.local. port: 4712 addresses: [192.168.1.219]
[site  ] DEBUG 2024/07/29 13:46:43 ----

Seems to me everything fine locally. Can it be that on hassio we have a issue with ipv6 ?

jomach commented 3 months ago

After hours of debugging I found the issue. The MDNS was exposing 5 hosts for the same container.

You need to add the following config so that it only advertises one IP

eebus:
  URI: 192.168.1.216:4712
  interfaces:
    - end0
jomach commented 3 months ago

I will add the charger to the docs

goebelmeier commented 3 months ago

Maybe better enrich the documentation for https://docs.evcc.io/docs/reference/configuration/eebus#interfaces

jomach commented 3 months ago

@goebelmeier habe es verbessert mit was ich könnte. Freue mich drauf