nordicopen / easee_hass

Custom component for Easee EV charger integration with Home Assistant
195 stars 33 forks source link

Integration doesn't work when IPv6 is configured. #396

Closed nrehn closed 3 months ago

nrehn commented 3 months ago

The problem

When HA is configured with native IPv6 address this integration doesn't work at all.

Version of Easee integration having the issue?

0.9.57

Version of Home Assistant Core having the issue?

2024.3.1

Anything in the logs that might be useful for us?

No response

Additional information

No response

olalid commented 3 months ago

Is there nothing in the logs?

olalid commented 3 months ago

We will not be able to help you unless you provide more information. But, you can try the latest release (v0.9.58) since it does use different libs than earlier versions. No idea if it might help, but it is kind of useless to try to debug the older versions since they are a bit different.

nrehn commented 3 months ago

I will try and get back.

nrehn commented 3 months ago

I updated to latest bit no difference..

Below you can see debug logging when HA uses dualstack:

2024-03-18 00:51:48.066 DEBUG (MainThread) [custom_components.easee.controller] Connection to easee login timed out 2024-03-18 00:51:48.067 DEBUG (MainThread) [custom_components.easee.controller] Controller deleted 2024-03-18 00:51:53.341 DEBUG (MainThread) [custom_components.easee] Setting up Easee component version 0.9.58 2024-03-18 00:51:53.341 INFO (MainThread) [pyeasee.easee] Easee python library version: 0.8.0 2024-03-18 00:51:53.341 DEBUG (MainThread) [pyeasee.easee] getting token for user: +46XXXXXXXXX 2024-03-18 00:52:16.269 ERROR (MainThread) [metno] Access to https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned error 'TimeoutError'

one interesting thing is that if you do a nslookup on "aa015h6buqvih86i1.api.met.no" it only resolves an ipv4 address, so it should not even try communicate on IPv6.

/N

olalid commented 3 months ago

Easees servers does not have IPV6 adress either, but I assume your intention is that IPV4 should work from your HA machine too...? I.e. you did say "dual stack" so that implies that both IPV4 and IPV6 should work, right?

Can you verify that it is actually possible to create a IPV4 connection from your HA machine? For example by using this command locally on it (i.e. connect to it with ssh and type command):

nc -w 10 -v api.easee.com 443

If it works, you would get this response: api.easee.com (52.49.199.160:443) open Otherwise nc: api.easee.com (52.49.199.160:443): Operation timed out (The actual IP adress might be different, since it is hosted by amazon and they might route you to a different server).

nrehn commented 3 months ago

Hi, I think you can close this issue. I have found some issues with DNS resolving which is not related to HA..