mbillow / ha-chargepoint

Home Assistant ChargePoint EV Charger Integration
MIT License
49 stars 7 forks source link

Retrying setup: 'device_ip' #1

Closed CitizenRacer closed 2 years ago

CitizenRacer commented 2 years ago

I just tried to install this integration via hacs. After accepting my login credentials I get the error: "Retrying setup: 'device_ip'"

Looking at log viewer, this looked relevant:


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 190, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/chargepoint/__init__.py", line 153, in async_update_data
    await hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/python_chargepoint/client.py", line 41, in check_login
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/python_chargepoint/client.py", line 298, in get_home_charger_technical_info
    return HomeChargerTechnicalInfo.from_json(
  File "/usr/local/lib/python3.9/site-packages/python_chargepoint/types.py", line 142, in from_json
    device_ip=json["device_ip"],
KeyError: 'device_ip'

I'm running latest haos, ha, and hacs:

System Health

version core-2022.4.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.108
arch x86_64
timezone America/Los_Angeles
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4593 Installed Version | 1.24.5 Stage | running Available Repositories | 1102 Downloaded Repositories | 17
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | March 18, 2023, 5:00 PM relayer_connected | true remote_enabled | false remote_connected | false alexa_enabled | true google_enabled | false remote_server | us-west-2-1.ui.nabu.casa can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 7.6 -- | -- update_channel | stable supervisor_version | supervisor-2022.04.0 docker_version | 20.10.9 disk_total | 118.5 GB disk_used | 15.1 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | UniFi Network Application (2.1.0), Let's Encrypt (4.12.0), Terminal & SSH (9.3.0), Log Viewer (0.13.0), Home Assistant Google Drive Backup (0.106.2), Check Home Assistant configuration (3.10.0), Studio Code Server (4.2.0), Samba share (9.5.1), Z-Wave JS to MQTT (0.37.0), Mosquitto broker (6.0.1), AppDaemon (0.8.2), MariaDB (2.4.0), Nginx Proxy Manager (0.11.0), File editor (5.3.3)
keymaster zwave_integration | zwave_js -- | -- network_status | on
Dashboards dashboards | 1 -- | -- resources | 10 views | 5 mode | storage
aleck011mi commented 2 years ago

I am having the same issue. Really excited about this integration, please let me know if there is anything I can provide.

aleck011mi commented 2 years ago

I resolved this by rebooting my charger through the chargepoint app

CitizenRacer commented 2 years ago

That fixed it for me too. Thanks!

mbillow commented 2 years ago

Oops, I didn't have notifications turned on for new issues. That is definitely an interesting issue. I'll catch this error and provide a better error to help people in the future!

dbhagen commented 2 years ago

It is curious. When looking at the About Charger section in the ChargePoint app, the IP field has no data. I'm curious if it's the model of the charger. I'm still rocking the CPH25-P.

Being a network guy, I can totally tell you what (static IP I've) assigned it. Maybe we can have a manual override field?

mbillow commented 2 years ago

I’m not aware of anything that uses the IP field, so I am tempted to just make it an Optional[str] and call it a day. 🤷🏼‍♂️

If there are chargers that just don’t report their IP, it is likely better that way.

brettonw commented 2 years ago

I've also started seeing this problem. A bit baffling, as it's not in your code, I think. My "about charger" also does not report the IP of the device, but rebooting the charger didn't change this.

I see, it's in your pypi project python-chargepoint.

mbillow commented 2 years ago

I have updated python-chargepoint to treat the device_ip field as optional and handle it's absence correctly when initializing an instance of HomeChargerTechnicalInfo. I pulled this update into v0.2.1 of the HA add-on and just released it.

Let me know how it works for y'all.