Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TGTG API Error 410 during startup #89

Closed
4 tasks done
LarsStegman opened this issue Nov 4, 2023 · 2 comments
Closed
4 tasks done

TGTG API Error 410 during startup #89

LarsStegman opened this issue Nov 4, 2023 · 2 comments

Comments

@LarsStegman
Copy link

LarsStegman commented Nov 4, 2023

System Health details

System Information

version core-2023.11.0
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.59
arch x86_64
timezone Europe/Amsterdam
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4469
Installed Version 1.33.0
Stage running
Available Repositories 1324
Downloaded Repositories 30
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 11.1
update_channel stable
supervisor_version supervisor-2023.10.1
agent_version 1.6.0
docker_version 24.0.6
disk_total 30.8 GB
disk_used 17.2 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Zigbee2MQTT (1.33.2-1), File editor (5.6.0), Mosquitto broker (6.3.1), Terminal & SSH (9.7.1), ESPHome (2023.10.6)
Dashboards
dashboards 3
resources 26
views 15
mode storage
Recorder
oldest_recorder_run 31 oktober 2023 om 08:21
current_recorder_run 4 november 2023 om 09:45
estimated_db_size 1062.96 MiB
database_engine sqlite
database_version 3.41.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Sensors fail to work

Error while setting up tgtg platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tgtg/sensor.py", line 77, in setup_platform
    add_entities([TGTGSensor(each_item_id)])
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tgtg/sensor.py", line 97, in __init__
    self.update()
  File "/config/custom_components/tgtg/sensor.py", line 190, in update
    self.tgtg_answer = tgtg_client.get_item(item_id=self.item_id)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/tgtg/__init__.py", line 287, in get_item
    raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (410, b'{"errors":[{"code":"ENTITY_DISABLED"}]}')

Reproduction steps

Config:

sensor:
  - platform: tgtg
    email: !secret tgtg_username
    access_token: !secret tgtg_access_token
    refresh_token: !secret tgtg_refresh_token
    user_id: !secret tgtg_user_id
    cookie: !secret tgtg_cookie
    scan_interval: 180
    item:
      - xxxxx  # this contains actual IDs in my config. All the secrets also exist
      
  1. Restart Home Assistant
  2. The error will show up in the logs

I think this might be related to a new version of Home Assistant, because the problem started occurring after updating to 2023.11

Debug logs

Too big to paste, 15MB of data.

Diagnostics dump

No response

@tjorim
Copy link
Collaborator

tjorim commented Nov 4, 2023

Try checking if all items (IDs) still exist.

@LarsStegman
Copy link
Author

Yes, that solved it. Looks like they did some clean up, because a lot of inactive stores were removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants