Unable to Initialize Integration
Closed this issue ยท 12 comments
I made a mistake today and upgraded several things at once. One of the things that didn't restart was the Rivian integration.
I've upgraded both my OS & HA Core, versions listed below:
- Home Assistant 2023.8.1
- Supervisor 2023.07.1
- Operating System 10.4
- Frontend 20230802.0 - latest
I have both upgraded to the latest version (1.0.0-beta4
) and tried downgrading back to the previous version (0.10.5
). They seem to possibly have different issues.
The beta version reports this:
Logger: homeassistant.config_entries
Source: config_entries.py:952
First occurred: 6:14:43 PM (2 occurrences)
Last logged: 6:18:09 PM
Config entry 'Rivian (Unofficial)' for rivian integration not ready yet: Issue loading vehicle data; Retrying in background
The previous version is reporting this:
This error originated from a custom integration.
Logger: homeassistant.config_entries
Source: custom_components/rivian/__init__.py:53
Integration: Rivian (Unofficial) (documentation, issues)
First occurred: 3:10:11 PM (4 occurrences)
Last logged: 4:50:01 PM
Error setting up entry Rivian (Unofficial) for rivian
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/rivian/__init__.py", line 53, in async_setup_entry
client = Rivian("", "", request_timeout=30)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Rivian.__init__() got multiple values for argument 'request_timeout'
I can try to roll back again, but I've tried it a couple times now, and it still won't come up.
I have complete debug logs for the beta version, but they contain a lot of information I'm not comfortable posting to a public forum. If there's a way to send them more privately, I'm happy to send them over. Here's the edited version:
2023-08-07 18:11:30.115 ERROR (SyncWorker_4) [homeassistant] Error doing job: Unclosed client session
2023-08-07 18:11:30.125 ERROR (SyncWorker_4) [homeassistant] Error doing job: Unclosed connector
2023-08-07 18:11:30.128 ERROR (SyncWorker_4) [homeassistant] Error doing job: Unclosed client session
2023-08-07 18:11:30.131 ERROR (SyncWorker_4) [homeassistant] Error doing job: Unclosed connector
2023-08-07 18:13:23.340 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Rivian (Unofficial)' for rivian integration not ready yet: Issue loading vehicle data; Retrying in background
2023-08-07 18:13:40.712 INFO (MainThread) [custom_components.rivian] Rivian integration is starting under version 1.0.0-beta.4. Please report issues at https://github.com/bretterer/home-assistant-rivian/issues
2023-08-07 18:13:41.612 DEBUG (MainThread) [custom_components.rivian.coordinator] {'data': {'currentUser': {'__typename': 'User', 'id': '<<SNIP>>', 'vehicles': [<SNIP-LISTS-TWO-VEHICLES>], 'enrolledPhones': []}}}
2023-08-07 18:13:41.612 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.743 seconds (success: True)
2023-08-07 18:13:41.945 DEBUG (MainThread) [rivian.rivian] 01-XXXXX subscribed to updates
2023-08-07 18:13:42.288 DEBUG (MainThread) [custom_components.rivian.coordinator] Vehicle 01-XXXXX updated: <SNIP-VEHICLE-DATA>
2023-08-07 18:13:42.289 INFO (MainThread) [custom_components.rivian.coordinator] Polling set to 30 seconds
2023-08-07 18:13:42.292 DEBUG (MainThread) [custom_components.rivian.coordinator] Manually updated rivian data
2023-08-07 18:13:42.293 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.680 seconds (success: True)
2023-08-07 18:13:42.447 DEBUG (MainThread) [custom_components.rivian.coordinator] {'data': {'getLiveSessionData': {'__typename': 'LiveSessionData', 'currentPrice': None, 'currentCurrency': None, 'startTime': '2023-08-07T03:19:37.954569Z', 'totalChargedEnergy': {'__typename': 'FloatValueRecord', 'value': 9.9, 'updatedAt': '2023-08-07T19:04:06.52Z'}, 'kilometersChargedPerHour': {'__typename': 'FloatValueRecord', 'value': 0, 'updatedAt': '2023-08-07T19:04:06.52Z'}, 'rangeAddedThisSession': {'__typename': 'FloatValueRecord', 'value': 32, 'updatedAt': '2023-08-07T19:04:06.52Z'}, 'timeElapsed': '68044', 'power': {'__typename': 'FloatValueRecord', 'value': 0, 'updatedAt': '2023-08-07T19:04:06.52Z'}}}}
2023-08-07 18:13:42.447 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.154 seconds (success: True)
2023-08-07 18:13:42.449 DEBUG (MainThread) [rivian.rivian] 01-XXXXX subscribed to updates
2023-08-07 18:13:42.450 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.002 seconds (success: True)
2023-08-07 18:13:42.455 DEBUG (MainThread) [rivian.ws_monitor] WSMessage(type=<WSMsgType.CLOSING: 256>, data=None, extra=None)
2023-08-07 18:13:42.455 DEBUG (MainThread) [rivian.ws_monitor] web socket stopped
It ends here and does not appear to attempt to look at the second vehicle.
Let me know what other information I can provide.
Same here - integration is not working anymore:
2023-08-07 18:31:56.578 INFO (MainThread) [custom_components.rivian] Rivian integration is starting under version 0.10.5. Please report issues at https://github.com/bretterer/home-assistant-rivian/issues
2023-08-07 18:31:56.578 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Rivian (Unofficial) for rivian
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/rivian/init.py", line 53, in async_setup_entry
client = Rivian("", "", request_timeout=30)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Rivian.init() got multiple values for argument 'request_timeout'
Ok, the problem seems to be with HAOS 10.4. I rolled back 10.3 and all works fine again.
Seems I was wrong - this is what is working for me fine:
Home Assistant 2023.8.0
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230802.0 - latest
Having the same issue after the recent HA updates, though rolling back has not fixed them for me. Tried rolling back to HA OS 10.3 as well as HA Core 2023.7.3, but same error is persisting.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/rivian/__init__.py", line 53, in async_setup_entry
client = Rivian("", "", request_timeout=30)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Rivian.__init__() got multiple values for argument 'request_timeout'
These versions are working for me:
Home Assistant 2023.8.0
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230802.0 - latest
If you upgraded to a beta build and then attempted to rollback, please update to release 0.10.6 to solve the TypeError: Rivian.__init__() got multiple values for argument 'request_timeout'
error.
Looks like github has an outage, so the build isn't quite ready yet.
Now it's ready
Huh, I never upgraded to a beta build but in any event, 0.10.6 resolved the issue! Thanks for the quick fix!
I downgraded to 0.10.6
(actually, I fully uninstalled the integration and reinstalled 0.10.6
), and now I don't get an error on setup.
However, I also get no vehicles listed. I can see them on my account when I log into the website directly (it's a dedicated user for HA). Same OS/HA/etc versions as I listed above.
The logs show it loading both vehicles, but then it shows an error:
2023-08-09 15:58:45.417 INFO (MainThread) [custom_components.rivian] Rivian integration is starting under version 0.10.6. Please report issues at https://github.com/bretterer/home-assistant-rivian/issues
2023-08-09 15:58:46.573 DEBUG (MainThread) [custom_components.rivian.coordinator] {'data': {'currentUser': {'__typename': 'User', 'id': '<SNIP>', 'vehicles': [{'id': '<SNIP>'}, {'id': '<SNIP>'}]}}}
2023-08-09 15:58:46.573 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.948 seconds (success: True)
2023-08-09 15:58:47.035 DEBUG (MainThread) [rivian.rivian] 01-<SNIP> subscribed to updates
2023-08-09 15:58:47.035 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.461 seconds (success: True)
2023-08-09 15:58:47.193 DEBUG (MainThread) [custom_components.rivian.coordinator] {'data': {'getLiveSessionData': {'__typename': 'LiveSessionData', 'currentPrice': None, 'currentCurrency': None, 'kilometersChargedPerHour': {'__typename': 'FloatValueRecord', 'value': 0, 'updatedAt': '2023-08-09T18:59:14.642Z'}, 'timeElapsed': '232749', 'totalChargedEnergy': {'__typename': 'FloatValueRecord', 'value': 12.4, 'updatedAt': '2023-08-09T18:59:14.642Z'}, 'startTime': '2023-08-07T03:19:37.954569Z', 'rangeAddedThisSession': {'__typename': 'FloatValueRecord', 'value': 41, 'updatedAt': '2023-08-09T18:59:14.642Z'}, 'power': {'__typename': 'FloatValueRecord', 'value': 0, 'updatedAt': '2023-08-09T18:59:14.642Z'}}}}
2023-08-09 15:58:47.194 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.158 seconds (success: True)
2023-08-09 15:58:47.198 DEBUG (MainThread) [rivian.rivian] 01-<SNIP> subscribed to updates
2023-08-09 15:58:47.198 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.004 seconds (success: True)
2023-08-09 15:58:47.350 DEBUG (MainThread) [custom_components.rivian.coordinator] {'data': {'getLiveSessionData': {'__typename': 'LiveSessionData', 'currentPrice': None, 'currentCurrency': None, 'kilometersChargedPerHour': {'__typename': 'FloatValueRecord', 'value': 0, 'updatedAt': '2023-08-09T18:31:26.017Z'}, 'timeElapsed': '69877', 'totalChargedEnergy': {'__typename': 'FloatValueRecord', 'value': 35.2, 'updatedAt': '2023-08-09T18:31:26.017Z'}, 'startTime': '2023-08-09T00:34:10.298988Z', 'rangeAddedThisSession': {'__typename': 'FloatValueRecord', 'value': 128, 'updatedAt': '2023-08-09T18:31:26.017Z'}, 'power': {'__typename': 'FloatValueRecord', 'value': 0, 'updatedAt': '2023-08-09T18:31:26.017Z'}}}}
2023-08-09 15:58:47.350 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.152 seconds (success: True)
2023-08-09 15:58:47.502 DEBUG (MainThread) [custom_components.rivian.coordinator] {'data': {'getRegisteredWallboxes': []}}
2023-08-09 15:58:47.503 DEBUG (MainThread) [custom_components.rivian.coordinator] Finished fetching rivian data in 0.152 seconds (success: True)
2023-08-09 15:58:47.508 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up rivian platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/rivian/binary_sensor.py", line 30, in async_setup_entry
entities = [
^
File "/config/custom_components/rivian/binary_sensor.py", line 31, in <listcomp>
RivianBinarySensorEntity(coordinators[vin], entry, description, vehicle)
File "/config/custom_components/rivian/binary_sensor.py", line 57, in __init__
super().__init__(coordinator, config_entry, description, vehicle)
File "/config/custom_components/rivian/entity.py", line 64, in __init__
sw_version=self._get_value("otaCurrentVersion"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/rivian/entity.py", line 74, in _get_value
if entity := self.coordinator.data.get(key, {}):
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
2023-08-09 15:58:47.520 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up rivian platform for device_tracker
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/rivian/device_tracker.py", line 34, in async_setup_entry
entities = [
^
File "/config/custom_components/rivian/device_tracker.py", line 35, in <listcomp>
RivianDeviceEntity(coordinators[vin], entry, LOCATION_DESCRIPTION, vehicle)
File "/config/custom_components/rivian/device_tracker.py", line 58, in __init__
super().__init__(coordinator, config_entry, description, vehicle)
File "/config/custom_components/rivian/entity.py", line 64, in __init__
sw_version=self._get_value("otaCurrentVersion"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/rivian/entity.py", line 74, in _get_value
if entity := self.coordinator.data.get(key, {}):
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
2023-08-09 15:58:47.526 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up rivian platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/rivian/sensor.py", line 66, in async_setup_entry
entities = [
^
File "/config/custom_components/rivian/sensor.py", line 67, in <listcomp>
RivianSensorEntity(vehicle_coordinators[vin], entry, description, vehicle)
File "/config/custom_components/rivian/entity.py", line 64, in __init__
sw_version=self._get_value("otaCurrentVersion"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/rivian/entity.py", line 74, in _get_value
if entity := self.coordinator.data.get(key, {}):
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
2023-08-09 15:58:47.533 ERROR (MainThread) [homeassistant.components.update] Error while setting up rivian platform for update
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/rivian/update.py", line 40, in async_setup_entry
entities = [
^
File "/config/custom_components/rivian/update.py", line 41, in <listcomp>
RivianUpdateEntity(coordinators[vin], entry, UPDATE_DESCRIPTION, vehicle)
File "/config/custom_components/rivian/entity.py", line 64, in __init__
sw_version=self._get_value("otaCurrentVersion"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/rivian/entity.py", line 74, in _get_value
if entity := self.coordinator.data.get(key, {}):
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
I'm not sure if it's still running the old version of rivian-python-client
or if it's something else.
Edit I'm going to remove the integration (hub?) and let the server sit for a while, in case I bumped up against their usage limits trying to set this up.
Woohoo! I'm guessing it was the rate limiting. I just ran through the setup again, and my vehicles are back! Note that this is on 0.10.6
, I'm pretty sure the 1.x
beta version is still not working.
I'm pretty sure the
1.x
beta version is still not working.
I've tested the latest beta against my backup raspberry pi with OS 10.4 and the latest HA core/supervisor and it seems to work.