home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.01k stars 31.05k forks source link

Tesla #128688

Open ddanielww opened 1 month ago

ddanielww commented 1 month ago

The problem

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

The tesla fleet integration does not work.

Add it, login, goes back to my home assistant with error 500 internal error.

Is the original one in home assistant still supported as I see many people using the hacs one ?

id rather use the official one and surely it’s still supported or it would be removed ?

But the hacs page it says the official one was removed , very confused !

What version of Home Assistant Core has the issue?

Latest

What was the last working version of Home Assistant Core?

Latest

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tesla Fleet

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @bre77, mind taking a look at this issue as it has been labeled with an integration (tesla_fleet) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tesla_fleet` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tesla_fleet` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tesla_fleet documentation tesla_fleet source (message by IssueLinks)

Bre77 commented 1 month ago

Hey @ddanielww the Tesla integration was in fact removed, and moved to a custom HACS integration. However since Tesla added the Fleet API and Open Source authentication I added the Tesla Fleet integration to core. It is completely independant to the Tesla integration, and in fact is very similar to both Teslemetry and Tessie integrations since all three use the Tesla Fleet API.

As for your issues getting setup, I need you to provide some relevant logs. Enable debug logging for the Tesla Fleet integration, then try add your account again, disable debug logging and attach that file.

ddanielww commented 1 month ago

Any reason to use hacs version instead of the one built in?

I have got it working now, failed on mobile but worked on PC.

Bre77 commented 1 month ago

Any reason to use hacs version instead of the one built in?

I'm biased but I think the Tesla Fleet integration is the way to go for most people.

I'm not fully across where the HACS Tesla integration is these days, but it's working for fewer and fewer people and Tesla intends to shutdown the Owner's API. It is capable of using the command proxy but I'm currently working to build that functionality into Home Assistant directly.

ddanielww commented 1 month ago

I tried both and they seem to do the same thing for me.

I only wanted the sensor information will look at the commands maybe down the road.

awesome work thank you very much, I’m gonna stick to the build it one :)

0x09AF commented 1 month ago

My Tesla integration stopped working a week ago. I had switched over from the HACS version to the built-in one as soon as it was announced: it seemed "more official", and they both achieved the same for me. Is this something on the Tesla side? The integration says: "Failed to set up: Check the logs".

... and as I was typing this message, I tried to Reload the integration (which didn't work when it first failed), and it populated the sensors values this time. I think Tesla is changing something on their end.

These are the only logs I got during reloading the integration:

2024-10-20 09:40:00.168 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [137432800974672] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 132, in _async_press_action
    await self.async_press()
  File "/usr/src/homeassistant/homeassistant/components/tesla_fleet/button.py", line 97, in async_press
    await handle_vehicle_command(self.entity_description.func(self))
  File "/usr/src/homeassistant/homeassistant/components/tesla_fleet/helpers.py", line 53, in handle_vehicle_command
    if (response := result.get("response")) is None:
                    ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Bre77 commented 1 month ago

@0x09AF please create your own issue with a diag so I can address your issue seperately. Your error log talks about a button press but I would also need to know which button you pressed.