Closed krazos closed 1 year ago
If the API is being deprecated, your secrets probably aren't as useful, but you should really redact them from your issue here, and change your password ASAP.
I too am getting these errors.
Can confirm. Will have to migrate to their GraphQL API before the integration works again.
If the API is being deprecated, your secrets probably aren't as useful, but you should really redact them from your issue here, and change your password ASAP.
I too am getting these errors.
It would probably be best to update the integration itself to redact the token
, client_id
and client_secret
(or the GraphQL API equivalents) from the logs. The client_id
and client_secret
aren't exactly secrets, but I recognize that there is some sensitivity around how they are shared. I expect that most Home Assistant users are accustomed to core integrations redacting sensitive information from the logs, diagnostics, etc. and likely won't take the time to redact anything before copying-and-pasting logs.
Can confirm. Will have to migrate to their GraphQL API before the integration works again.
Bummer. Not trying to rush anything as I know everyone has lives, jobs, etc. But is there a roadmap in place for the migration, or a rough sense of how long that might take?
I got the fix programmed, but might be broken past 2 hours during a refresh token operation. Waiting to find out.
Maybe my patch was bad, but did you test this with two-factor enabled on your Rivian account? I patched my local copy with your diff, and could only sign in with two-factor disabled. When it's enabled, I get this error in the logs:
...
File "/config/custom_components/rivian/config_flow.py", line 222, in async_step_init
auth = await self._rivian.authenticate_graphql(self._data.get(CONF_USERNAME), self._data.get(CONF_PASSWORD))
File "/usr/local/lib/python3.10/site-packages/rivian/rivian.py", line 357, in authenticate_graphql
self._access_token = response_json["data"]["login"]["accessToken"]
KeyError: 'accessToken'
It's displayed as an "unknown error" in the UI:
v0.6.0-beta.3 has everything working for me again. Many thanks! 🙌
I'm still getting the unknown error - is this merged?
Seeing a 401 after installing 6.0-beta3
This error originated from a custom integration.
Logger: custom_components.rivian
Source: custom_components/rivian/__init__.py:219
Integration: Rivian (Unofficial) (documentation)
First occurred: 7:29:13 AM (32 occurrences)
Last logged: 8:02:10 AM
Unexpected error fetching rivian data: Error communicating with API
Traceback (most recent call last):
File "/config/custom_components/rivian/__init__.py", line 156, in _update_api_data
vehicle_info = await self._api.get_vehicle_info(
File "/usr/local/lib/python3.10/site-packages/rivian/rivian.py", line 292, in get_vehicle_info
raise Exception(
Exception: (401, {'error_code': -41, 'error_desc': "Authentication Error <class 'rcore.rexceptions.RPermissionErrorTokenInvalid'>", 'error_name': 'AuthError'}, {'User-Agent': 'RivianApp/707 CFNetwork/1237 Darwin/20.4.0', 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Bearer <SNIP>'}, {'car': '<SNIP>', 'properties': ['core/ota_status/cgm_ota_install_fast_charging', 'core/ota_status/cgm_ota_install_hv_batt_low', 'core/ota_status/cgm_ota_install_not_parked', 'core/ota_status/cgm_ota_install_ready', 'core/power_modes/power_state', 'dynamics/hv_battery_notifications/BMS_thermal_event', 'dynamics/modes/drive_mode', 'dynamics/odometer/value', 'dynamics/powertrain_status/brake_fluid_level_low', 'dynamics/propulsion_status/PRNDL', 'dynamics/tires/tire_FL_pressure_status', 'dynamics/tires/tire_FR_pressure_status', 'dynamics/tires/tire_RL_pressure_status', 'dynamics/tires/tire_RR_pressure_status', 'energy_storage/charger/adjusted_soc', 'energy_storage/charger/EMS_charger_remainingtime_min_1', 'energy_storage/icd_cid_notifications/b_pack_thermal_runaway_propagation', 'energy_storage/icd_cid_notifications/range_threshold', 'energy_storage/vehicle_efficiency/lifetime_wh_per_km', 'energy_storage/vehicle_energy/vehicle_range', 'telematics/ota_status/available_version_number', 'telematics/ota_status/available_version_week', 'telematics/ota_status/available_version_year', 'telematics/ota_status/available_version', 'telematics/ota_status/current_version_number', 'telematics/ota_status/current_version_week', 'telematics/ota_status/current_version_year', 'telematics/ota_status/current_version', 'telematics/ota_status/download_progress', 'telematics/ota_status/install_duration', 'telematics/ota_status/install_progress', 'telematics/ota_status/install_time', 'telematics/ota_status/install_type', 'telematics/ota_status/pending_reason_active_mode', 'telematics/ota_status/pending_reason_lv_batt', 'telematics/ota_status/pending_reason_other', 'telematics/ota_status/status_current', 'telematics/ota_status/status', 'thermal/hvac_cabin_control/cabin_temperature', 'thermal/hvac_cabin_control/driver_temperature', 'thermal/hvac_settings/pet_mode_temperature_status', 'body/closures/window_calibration_FL_state', 'body/closures/window_calibration_FR_state', 'body/closures/window_calibration_RL_state', 'body/closures/window_calibration_RR_state', 'energy_storage/charger_status/vehicle_charger_status', 'energy_storage/charger/EMS_charger_evse_type', 'energy_storage/mobile/remote_charging_available', 'energy_storage/mobile/soc_limit', 'telematics/privacy/offline_mode_enabled', 'thermal/hvac_mobile_status/3rd_row_left_seat_heat_status', 'thermal/hvac_mobile_status/3rd_row_right_seat_heat_status', 'thermal/hvac_mobile_status/defrost_defog_status', 'thermal/hvac_mobile_status/estimated_cabin_temp_mobile', 'thermal/hvac_mobile_status/left_seat_heat_status', 'thermal/hvac_mobile_status/left_seat_vent_status', 'thermal/hvac_mobile_status/rear_left_seat_heat_status', 'thermal/hvac_mobile_status/rear_right_seat_heat_status', 'thermal/hvac_mobile_status/right_seat_heat_status', 'thermal/hvac_mobile_status/right_seat_vent_status', 'thermal/hvac_mobile_status/set_temp_status_mobile', 'thermal/hvac_mobile_status/steering_wheel_heat_status', 'body/alarm/sound_alarm', 'body/closures/door_FL_locked_state', 'body/closures/door_FL_state', 'body/closures/door_FR_locked_state', 'body/closures/door_FR_state', 'body/closures/door_RL_locked_state', 'body/closures/door_RL_state', 'body/closures/door_RR_locked_state', 'body/closures/door_RR_state', 'body/closures/front_left_window_state', 'body/closures/front_right_window_state', 'body/closures/frunk_locked_state', 'body/closures/frunk_state', 'body/closures/gear_guard_locked_state', 'body/closures/liftgate_locked_state', 'body/closures/liftgate_state', 'body/closures/rear_left_window_state', 'body/closures/rear_right_window_state', 'body/closures/sidebin_L_locked_state', 'body/closures/sidebin_L_state', 'body/closures/sidebin_R_locked_state', 'body/closures/sidebin_R_state', 'body/closures/tailgate_locked_state', 'body/closures/tailgate_state', 'body/closures/tonneau_locked_state', 'body/closures/tonneau_state', 'body/wipers/fluid_state', 'dynamics/tires/tire_FL_pressure_status_valid', 'dynamics/tires/tire_FR_pressure_status_valid', 'dynamics/tires/tire_RL_pressure_status_valid', 'dynamics/tires/tire_RR_pressure_status_valid', 'energy_storage/charger/vehicle_charger_state', 'thermal/hvac_settings/pet_mode_status', 'thermal/tmm_status/cabin_precondition_state', 'telematics/gnss/position']})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/rivian/__init__.py", line 204, in _async_update_data
return await self._update_api_data()
File "/config/custom_components/rivian/__init__.py", line 189, in _update_api_data
auth = await self._rivian.authenticate_graphql(self._entry.data.get(CONF_USERNAME), self._entry.data.get(CONF_PASSWORD))
File "/usr/local/lib/python3.10/site-packages/rivian/rivian.py", line 354, in authenticate_graphql
response = await self.__graphql_query(headers, url, graphql_json)
File "/usr/local/lib/python3.10/site-packages/rivian/rivian.py", line 506, in __graphql_query
raise Exception("Error occurred while reading the graphql response from Rivian.")
Exception: Error occurred while reading the graphql response from Rivian.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/rivian/__init__.py", line 219, in _async_update_data
raise Exception("Error communicating with API") from err
Exception: Error communicating with API
If you are still getting the error after updating to 0.6.0-beta.3, you may need to remove the integration and re-add it. Also, make sure you disable OTP for now. See #35
I removed and re-added and still experiencing the error
@kylerw could you please provide the logs for the error?
Also, please make sure you have the correct password, and do NOT have OTP enabled on your account. Our latest update does not support OTP right now
Thanks - missed that OTP isn't supported right now. That was my issue.
Completely removing the integration and existing device, then re-adding fixed it!
It appears that changes to the Rivian API may have broken the integration; I started to see errors in my logs yesterday evening, and I have been unable to reload/reconfigure with the usual login credentials.