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
69.82k stars 28.95k forks source link

Tessie error fetching energy data #121239

Open JackTerok opened 3 days ago

JackTerok commented 3 days ago

The problem

On startup, the Integration doesn't initialize properly. Error while getting energy data.

What version of Home Assistant Core has the issue?

core-2024.7.0

What was the last working version of Home Assistant Core?

core-2024.6.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tessie

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Unexpected error fetching Tessie Energy Site Live data

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tessie/coordinator.py", line 115, in _async_update_data
    wc["din"]: wc for wc in (data.get("wall_connectors") or [])
                             ^^^^^^^^
AttributeError: 'str' object has no attribute 'get'

Additional information

No response

home-assistant[bot] commented 3 days ago

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

Code owner commands Code owners of `tessie` 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 tessie` 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)


tessie documentation tessie source (message by IssueLinks)

Bre77 commented 3 days ago

Turn on debug logging for the integration, reload it, and then once it's failed turn debug logging off and upload that file.

JackTerok commented 3 days ago

home-assistant_tessie_2024-07-05T15-11-05.449Z.log

Bre77 commented 2 days ago

So it looks like you have two energy sites, one is working and the other is returning something I havent seen before.

I'll need you to get your Tessie API token and run the following in your browser: https://api.tessie.com/api/1/products?access_token=ACCESS_TOKEN

There you will find the energy_site_id of each of your energy site id's run in your browser: https://api.tessie.com/api/1/energy_sites/{energy_site_id}/live_status?access_token=ACCESS_TOKEN

One of them will have a lot of useful JSON information in the response, the other apparently will have just a string. I need to see the full response of the one with a string and without useful data.

JackTerok commented 2 days ago

Ah yes. We upgraded from an older gateway version some years ago to get backup functionality. But the old gateway never went away in the app. We have an unreachable second energy site in the app. Anyway, here is the really short response:

{ "response": "" }