home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
5.04k stars 7.32k forks source link

ClientResponseError: 401, message='Unauthorized', url=URL('https://vocapi-cn.wirelesscar.net/customerapi/rest/v3.0/customeraccounts') #21946

Closed xiongrun0912 closed 2 years ago

xiongrun0912 commented 2 years ago

Feedback

2022-03-09 04:31:17 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/volvooncall/init.py", line 174, in update if not await connection.update(journal=True): File "/srv/homeassistant/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 105, in update user = await self.get("customeraccounts") File "/srv/homeassistant/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 91, in get return await self._request(METH_GET, self._make_url(url, rel)) File "/srv/homeassistant/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 76, in _request response.raise_for_status() File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://vocapi-cn.wirelesscar.net/customerapi/rest/v3.0/customeraccounts')

URL

https://www.home-assistant.io/integrations/volvooncall/

Version

2022.3.3

Additional information

2022-03-09 04:31:17 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/volvooncall/init.py", line 174, in update if not await connection.update(journal=True): File "/srv/homeassistant/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 105, in update user = await self.get("customeraccounts") File "/srv/homeassistant/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 91, in get return await self._request(METH_GET, self._make_url(url, rel)) File "/srv/homeassistant/lib/python3.9/site-packages/volvooncall/volvooncall.py", line 76, in _request response.raise_for_status() File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://vocapi-cn.wirelesscar.net/customerapi/rest/v3.0/customeraccounts')

probot-home-assistant[bot] commented 2 years ago

Hey there @molobrakos, @decompil3d, mind taking a look at this feedback as it has been labeled with an integration (volvooncall) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

decompil3d commented 2 years ago

Have you made sure that you are setting the region parameter correctly? What car do you have? Has this worked before?

xiongrun0912 commented 2 years ago

您是否确定正确设置了 region 参数?你有什么车?这以前有效吗?

Yes, this is my own car, I can log in normally on the app

xiongrun0912 commented 2 years ago

您是否确定正确设置了区域参数?你有什么车?这以前有效吗?

region: cn

xiongrun0912 commented 2 years ago

您是否确定正确设置了区域参数?你有什么车?这以前有效吗?

This is my first use. What should I do

xiongrun0912 commented 2 years ago

Have you made sure that you are setting the region parameter correctly? What car do you have? Has this worked before? 20220309-124538

volvooncall: username: +861xxxxxx password: xxxxxxx region: cn

decompil3d commented 2 years ago

Try using email address for username. I haven't used this integration outside of the US but I've heard success from folks in Europe as well.

xiongrun0912 commented 2 years ago

Try using email address for username. I haven't used this integration outside of the US but I've heard success from folks in Europe as well.

Volvo has disabled email login. Email login cannot be performed

xiongrun0912 commented 2 years ago

Try using email address for username. I haven't used this integration outside of the US but I've heard success from folks in Europe as well.

Resolve by placing the password in quotation marks,buts, my front-end is displayed like this. How can I solve it

20220309182057

decompil3d commented 2 years ago

Ah, yes -- if your password contains special characters it can mess with the YAML parsing. Quoting strings like this can avoid such issues.

By default, the integration creates entities for several sensors, switches, device trackers, and more. You can create custom Lovelace views in Home Assistant to show just the entities that matter to you. For example, here is how my Car view looks:

Lovelace car view example

And here is the YAML for that view:

views:
  - title: Thor
    path: thor
    icon: mdi:car-estate
    badges: []
    cards:
      - type: entities
        entities:
          - entity: lock.MY_VIN_door_lock
            secondary_info: last-changed
          - entity: switch.MY_VIN_engine
            secondary_info: last-changed
          - entity: switch.MY_VIN_heater
            secondary_info: last-changed
        title: Settings
        show_header_toggle: false
      - type: glance
        entities:
          - entity: binary_sensor.thor_plug_status
          - entity: binary_sensor.MY_VIN_battery_charging
          - entity: sensor.MY_VIN_battery_level
          - entity: sensor.MY_VIN_time_to_fully_charged
          - entity: sensor.MY_VIN_battery_range_mi
        state_color: true
        columns: 2
        show_name: false
        title: Battery
      - type: glance
        entities:
          - entity: sensor.MY_VIN_fuel_level
          - entity: sensor.MY_VIN_range_mi
        title: Fuel
        show_name: false
        state_color: false
      - type: map
        entities:
          - entity: device_tracker.volvo_MY_VIN
        hours_to_show: 0
        title: Location
      - type: entities
        entities:
          - entity: binary_sensor.MY_VIN_service
          - entity: binary_sensor.MY_VIN_bulbs
          - entity: binary_sensor.MY_VIN_brake_fluid
          - entity: binary_sensor.MY_VIN_washer_fluid
        title: Service
        show_header_toggle: false
        state_color: true
      - type: picture-elements
        elements:
          - type: image
            entity: binary_sensor.MY_VIN_battery_charging
            state_image:
              'on': /local/images/volvo-xc60-top.jpeg
            style:
              transform: translate(0%, -100%)
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_front_left_tyre
                state: 'off'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_front_left_tyre
                style:
                  top: 20%
                  left: 7%
                  '--paper-item-icon-color': '#74b72e'
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_front_left_tyre
                state: 'on'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_front_left_tyre
                style:
                  top: 20%
                  left: 7%
                  '--paper-item-icon-color': red
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_front_right_tyre
                state: 'off'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_front_right_tyre
                style:
                  top: 20%
                  left: 94%
                  '--paper-item-icon-color': '#74b72e'
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_front_right_tyre
                state: 'on'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_front_right_tyre
                style:
                  top: 20%
                  left: 94%
                  '--paper-item-icon-color': red
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_rear_left_tyre
                state: 'off'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_rear_left_tyre
                style:
                  top: 80%
                  left: 7%
                  '--paper-item-icon-color': '#74b72e'
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_rear_left_tyre
                state: 'on'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_rear_left_tyre
                style:
                  top: 80%
                  left: 7%
                  '--paper-item-icon-color': red
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_rear_right_tyre
                state: 'off'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_rear_right_tyre
                style:
                  top: 80%
                  left: 94%
                  '--paper-item-icon-color': '#74b72e'
          - type: conditional
            conditions:
              - entity: binary_sensor.MY_VIN_rear_right_tyre
                state: 'on'
            elements:
              - type: state-icon
                entity: binary_sensor.MY_VIN_rear_right_tyre
                style:
                  top: 80%
                  left: 94%
                  '--paper-item-icon-color': red
        image: /local/images/volvo-xc60-top-unplugged.jpg
title: Cars

I took the image of the car from a screenshot of my phone app. Hope this helps inspire you.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

klaasnicolaas commented 2 years ago

Hi there 👋

It seems like you want to report an issue with an Home Assistant integration, however, you have submitted documentation feedback instead. Please raise an issue in the Home Assistant core issue tracker instead:

https://github.com/home-assistant/core/issues

Thanks! 👍

./Klaas