chouffy / home_assistant_tgtg Goto Github PK
View Code? Open in Web Editor NEWTooGoodToGo items stock as sensor in Home Assistant
License: MIT License
TooGoodToGo items stock as sensor in Home Assistant
License: MIT License
Hi,
I implemented your component yesterday, looks great. When I showed my wife, she added some more favorites to our TooGoodToGo app, which now has about 35 favorites (it was like 22).
After a reboot of HomeAssistant I see that some previous working sensors are now gone, and the amount of working sensors is 25. It looks like a hard limit, and by adding more than 25 favorites, some existing disappeared and some new do not show up.
Is the limit 25? If yes, is it possible to increase the limit?
version | core-2023.7.3 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.11.4 |
os_name | Linux |
os_version | 6.1.21-v8 |
arch | aarch64 |
timezone | Europe/Warsaw |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4716 |
Installed Version | 1.32.1 |
Stage | running |
Available Repositories | 1273 |
Downloaded Repositories | 20 |
can_reach_server | ok |
---|---|
requests_remaining | 7 |
requests_per_day | 100 |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
can_reach_server | pending |
---|
host_os | Home Assistant OS 10.3 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2023.07.1 |
agent_version | 1.5.1 |
docker_version | 23.0.6 |
disk_total | 116.5 GB |
disk_used | 15.2 GB |
healthy | true |
supported | true |
board | rpi4-64 |
supervisor_api | ok |
version_api | ok |
installed_addons | Terminal & SSH (9.7.1), File editor (5.6.0), Node-RED (14.4.1), RPC Shutdown (2.4), Mosquitto broker (6.2.1), Spotify Connect (0.12.4), Grocy (0.19.1), Home Assistant Google Drive Backup (0.111.1), AdGuard Home (4.8.12), ESPHome (2023.7.0), Zigbee2MQTT (1.32.1-1), Matter Server (4.8.3), Music Assistant BETA (2.0.0b59) |
dashboards | 7 |
---|---|
resources | 1 |
views | 19 |
mode | storage |
oldest_recorder_run | 23 maja 2023 12:11 |
---|---|
current_recorder_run | 23 lipca 2023 00:13 |
estimated_db_size | 1403.11 MiB |
database_engine | sqlite |
database_version | 3.41.2 |
api_endpoint_reachable | pending |
---|
Integration cannot set up.
Please note this is a brand new account.
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 353, 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 76, in setup_platform
add_entities([TGTGSensor(each_item_id)])
^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tgtg/sensor.py", line 96, in __init__
self.update()
File "/config/custom_components/tgtg/sensor.py", line 189, 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","message":"Entity ItemId(1234) is not active"}]}')
No response
Hello,
thank you for your work on this integration!
I have the problem, that I add new favourites in the TGTG-app and after a restart they are not showing up. They are even missing if I check the favourites using the python script.
First of all, I do thank you for this add-on that is really great.
I configured the add-on using Manual list of items because i was having unavailable items.
but since today, I have two issues actually :
Thank you in advance for your precious help.
Hi,
When i use the python code i got an 404
tgtg.exceptions.TgtgLoginError: (404, b'')
Have a ready-to-launch *.py file to retrieve the 3 tokens
I’m getting this error when logging in:
Logger:
homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:113
Integration: Sensor (documentation, issues)
First occurred: 9:15:52 PM (1 occurrences)
Last logged: 9:15:52 PM
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 63, in setup_platform
add_entities([TGTGSensor(each_item_id)])
File "/config/custom_components/tgtg/sensor.py", line 81, in __init__
self.update()
File "/config/custom_components/tgtg/sensor.py", line 113, in update
tgtg_answer = tgtg_client.get_item(item_id=self.item_id)
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 180, in get_item
self.login()
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 106, in login
self._refresh_token()
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 91, in _refresh_token
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMAhDZvcVAoZ5oBKhA3gReKAABmQr8Yv76uRg==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35560,\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
Hi there, what a great idea for addon!
Sadly I'm experiencing the same thing you talked about in the Q&A, but even after I added items manually I'm still getting Unavailable.
I'm running HA in docker.
the only log:
2022-02-09 14:08:58 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration tgtg which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
Sometimes I don't need TGTG to be active, why keep polling. Sometimes I would like to poll it more frequently.
I would like to have the ability to set the polling to a very high or a lower interval. On the sensor configuration something like a slider that I can set with an automation.
Updating the config and manually restarting and
None.
Integration of tgtg is not working on my setup.
In the logs i see error 403, it responds with geo.captcha-delivery.com
Any ideas?
version | core-2023.5.2 |
---|---|
installation_type | Home Assistant Container |
dev | false |
hassio | false |
docker | true |
user | root |
virtualenv | false |
python_version | 3.10.11 |
os_name | Linux |
os_version | 5.19.0-41-generic |
arch | x86_64 |
timezone | Europe/Berlin |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4993 |
Installed Version | 1.32.1 |
Stage | running |
Available Repositories | 1289 |
Downloaded Repositories | 21 |
HACS Data | ok |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
dashboards | 4 |
---|---|
resources | 14 |
views | 7 |
mode | storage |
oldest_recorder_run | May 1, 2023 at 1:00 PM |
---|---|
current_recorder_run | May 10, 2023 at 6:10 PM |
estimated_db_size | 115.11 MiB |
database_engine | sqlite |
database_version | 3.40.1 |
Hello Chouffy,
first of all thank you so much for your great integration! My girlfriend and I are very happy about getting a chance with the bags now :D
Unfortunately there is something weird happening now with some sensors of mine.
I had it configured without any special item IDs in the config and some sensors started showing as "unavailable".
I got a new token from your script and replaced the old one in my config, but the result was the same.
Next i tried the method of getting the item IDs through your script, but unfortunately the "unavalable" sensors didn't show up in the list:
item:
# ERGO Gourmet - Nürnberg (Mittag (VYTAL Mehrwegsystem))
- 980868
# Bean's coffee & more
- 52430
# Grand Zhang (Sushi Abends)
- 763621
# Grand Zhang (Buffet Abends)
- 755005
# 994 GINZA - Sushi | Izakaya (Überraschungstüte)
- 834205
# 994 GINZA - Sushi | Izakaya (Überraschungstüte (Groß))
- 841690
# Der Beck - Schwabacher Straße
- 344514
# Aral mit REWE To Go - Herrnstraße 27 Fürth (Vegetarisches Mittagsangebot)
- 849914
# Galeria Markthalle - Nürnberg (Obst & Gemüse)
- 807027
# Flink - Fürth (Obst und Gemüse)
- 827081
# Flink - Fürth (Ready to Eat)
- 685116
# Flink - Fürth (Überraschungstüte)
- 685114
# Früchte Fürther Freiheit
- 587630
# Flink - Johannis (Obst und Gemüse)
- 831828
# Aral mit REWE To Go - Nürnberger Straße 131 Fürth (Abendangebot)
- 835539
# Aral mit REWE To Go - Nürnberger Straße 126 Fürth (Abendangebot)
- 840710
# Kantine Wolke 7 (Überraschungstüte)
- 1046693
# Kantine Wolke 7 (Vegetarische Überraschungstüte)
- 1050321
# E center Schuler - Fürth (Obst & Gemüse)
- 463
# Suppenkaspar Fürth
- 342765
In the Screenshot you can see, that the missing IDs match the unavailable sensors.
In this screenshot you can see, that the item exists in the Tgtg App and was even available today, which it hasn't been in homeassistant for some time.
Dropping the homeassistant.log here:
homeassistant.log
I am not sure what else might be relevant as I didn't really do anything out of the ordinary.
Github told me this comment was too long, so i appended the debug log to the issue.
No response
The problem is that not every tgtg item is available.
Below is the error message in the log:
Logger: homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:186
Integration: Sensor (documentation, issues)
First occurred: 11:21:44 (1 occurrences)
Last logged: 11:21:44
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 73, in setup_platform
add_entities([TGTGSensor(each_item_id)])
File "/config/custom_components/tgtg/sensor.py", line 93, in init
self.update()
File "/config/custom_components/tgtg/sensor.py", line 186, in update
self.tgtg_answer = tgtg_client.get_item(item_id=self.item_id)
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 273, in get_item
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (410, b'{"errors":[{"code":"ENTITY_DISABLED","message":"Entity ItemId(56298) is not active"}]}')
Hello,
First of all, thank you for the good work you've been doing with the integration !
I installed the latest update to solve the 403 error I've been having for months, but the integration doesn't seem to launch.
I renewed my tokens using the script and updated the config accordingly, but it doesn't work even after several reboots.
I have nothing in the system journal, no tgtg entities.
Am I missing something ?
Hello,
Thanks voor the good integration, works perfect !
I have one problem with trigger state.
Some state attributes have spacing instead of underscore between words.
That means that my automation not giving the correct info, it give me error.
I use folllowing : {{trigger.to_state.attributes.TGTG Price}} , its not working because of spacing between TGTG and Price.
Following is working: {{trigger.to_state.attributes.friendly_name}}, it has the underscore between friendly and name.
Example attributes of sensor:
Item ID: '75581'
Item URL: https://share.toogoodtogo.com/item/75581
TGTG Price: 4.99 EUR
Original value: 14.99 EUR
unit_of_measurement: pcs
icon: mdi:storefront-outline
friendly_name: TGTG 't Bakkershuys
The attributes with underscores are working but I cant get the attributes with spacing instead of underscore,=.
Is there a simple tip or trick to get them in my automation?
Example: {{ trigger.to_state.attributes.TGTG Price}}
Hope the here from you.
Already Thanks,
I am experiencing the following error during Home Assistant startup. Could it be that it is requesting a Captcha response now to prevent this kind of integration?
Logger: homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:69
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 10:28:27 (1 occurrences)
Last logged: 10:28:27
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 69, in setup_platform
tgtgReply = tgtg_client.get_items()
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 211, in get_items
self.login()
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 121, in login
self._refresh_token()
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 111, in _refresh_token
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMASz11yZGnomMBKgKkaqsXAAF4H05OUfi8_A==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'0f8d99b29500025d4e6d59b9f1758e231521a0c6e81bdcd5686e3e08f827e7de\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
Hi,
I get this error: see below
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script data-cfasync="false">var dd={\'rt\':\'c\',\'cid\':\'********==\',\'hsh\':\'********\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'********\',\'host\':\'geo.captcha-delivery.com\'}</script><script data-cfasync="false" src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
Hi guys, HA nooby here, I have the component installed via HACS, i've added to my configuration.yarl after running the py scripts etc..
I've added a custom sensor before and been fine, but for some reason I can't seem to get this one going - I get nothing in HA at all, no entitity or sensor at all - i've done the custom ID's etc, just wondering if there's anything obvious i'm missing?
I'm running HA via Truenas Scale - all files are downloaded in the custom component folder seemingly fine.
First of all: Thanks for this great integration!
Since yesterday, the tgtg platform can't setup sensors for me anymore. The stack trace indicates the API does require to solve a captcha, which can't be served obviously.
My first instinct would be the API is applying a rate limit, but I have an update_interval of 90 seconds, which imo is far from enough to warrant rate limiting.
So my second guess is TGTG changed their API and the integration needs to be updated, hence this issue.
Any help is much appreciated!
Stack trace:
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 67, in setup_platform
add_entities([TGTGSensor(each_item_id)])
File "/config/custom_components/tgtg/sensor.py", line 87, in __init__
self.update()
File "/config/custom_components/tgtg/sensor.py", line 180, in update
self.tgtg_answer = tgtg_client.get_item(item_id=self.item_id)
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 244, in get_item
self.login()
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 121, in login
self._refresh_token()
File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 111, in _refresh_token
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMAVhFJaKj7JkABIAMA8v8p7wALcUZE2qeLnQ==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'6177e810c7ac55bdd21d8debfd47fb4b86161caf13e44a73112e4d839a8b6ccd\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
run the get tokens py
python3 tgtg_get_tokens.py
Type your email linked to your TGTG account: [email protected]
Using version 23.4.12
Traceback (most recent call last):
File "/root/tgtg_get_tokens.py", line 13, in <module>
tgtgClient.get_credentials()
File "/usr/local/lib/python3.10/dist-packages/tgtg/__init__.py", line 90, in get_credentials
self.login()
File "/usr/local/lib/python3.10/dist-packages/tgtg/__init__.py", line 181, in login
raise TgtgLoginError(response.status_code, response.content)
tgtg.exceptions.TgtgLoginError: (403, b'{"url":"https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAdRgF1adAg_gA2WmLtw==&cid=86PDjw6-EpSxHPjvbU43ToKotX~i8HHzU1h2qr4e-FnmR_iSetqOR-6lSkG2eLprcf~cI8nfz7tzYKidv-OTGGfKhYlmg7yQaRlfYwVm8bL-r56HapF5Z-c6uGd1336&referer=https%3A%2F%2Fapptoogoodtogo.com%2Fapi%2Fauth%2Fv3%2FauthByEmail&hash=1D42C2CA6131C526E09F294FE96F94&t=fe&s=35587&e=6b1d5728fb084e8d880c6e0c40adab58986febb54699b2c4d83229fa46fd6df9"}')
No response
Hello,
Is there any way to create a markdown card or something like that, that fills automaticly with all the tgtg sensors, and displays only the sensors, that are active. Ofcourse i would love to see this with the attributes showen as well.
Example:
(only showen when 'available (status > 0, and not sold-out)', otherwise hidden):
'Happy Snacks (attr friendly_name)'
'10 (attr status)' pcs 'magic snack boxes (attr item_url)'
From: '€20,- (attr original_value)', for: '€5,- (attr item_price)'
Pickup from: '20:00 (attr pickup_start)' - '23:00 (attr pickup_end)'
Maybe anybody can do something with auto-entities mod and/or markdown card?
I tried, but can't figure it out. I'm lacking skills for this.
Not have it showen on my dashboard... :-/
(only showen when 'available (status > 0, and not sold-out )', otherwise hidden):
'Happy Snacks (attr friendly_name)'
'10 (attr status)' pcs 'magic snack boxes (attr item_url)'
From: '€20,- (attr original_value)', for: '€5,- (attr item_price)'
Pickup from: '20:00 (attr pickup_start)' - '23:00 (attr pickup_end)'
Goal:
Unfortunately I lack skill or time to do it, so I would be glad if somebody can help me on that!
I've upgraded to the latest version and rerun the script for my config and pasted it in, but now my ha won't restart.
The system cannot restart because the configuration is not valid: Invalid config for [sensor.tgtg]: [email] is an invalid option for [sensor.tgtg]. Check: sensor.tgtg->email. (See ?, line ?).
tgtg
moduleIf anybody has ideas, I'm listening :)
I have updated this component via hacs, so I would assume it would be automatic.
But I now get this:
Traceback (most recent call last):
File "/home/skinkie/.local/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/skinkie/.homeassistant/custom_components/tgtg/sensor.py", line 65, in setup_platform
tgtg_client = TgtgClient(
TypeError: TgtgClient.__init__() got an unexpected keyword argument 'cookie'
Would be great if we could just run a docker command to fire this up.
I will probably try this for myself. If I get anywhere I can post the docker file.
You would need build scripts to create the image, copy the tgtg_get_tokens script and upload to docker hub (or github packages).
not relevant to HA
when running
docker build https://github.com/Chouffy/home_assistant_tgtg.git#main --tag "homeassistant_tgtg_tokens:latest"
on ubuntu 20
it fails with
_Collecting ruamel.yaml==0.15.72
Downloading ruamel.yaml-0.15.72.tar.gz (309 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 309.9/309.9 KB 5.0 MB/s eta 0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 211, in <module>
pkg_data = _package_data(__file__.replace('setup.py', '__init__.py'))
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 184, in _package_data
data = literal_eval("".join(lines))
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 156, in literal_eval
return _convert(node_or_string)
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 95, in _convert
if isinstance(node, Str):
NameError: name 'Str' is not defined
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c python -m pip install -r requirements.txt' returned a non-zero code: 1_
Collecting ruamel.yaml==0.15.72
Downloading ruamel.yaml-0.15.72.tar.gz (309 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 309.9/309.9 KB 5.0 MB/s eta 0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 211, in <module>
pkg_data = _package_data(__file__.replace('setup.py', '__init__.py'))
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 184, in _package_data
data = literal_eval("".join(lines))
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 156, in literal_eval
return _convert(node_or_string)
File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 95, in _convert
if isinstance(node, Str):
NameError: name 'Str' is not defined
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c python -m pip install -r requirements.txt' returned a non-zero code: 1
No response
version | core-2023.5.1 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.10.11 |
os_name | Linux |
os_version | 6.1.25 |
arch | x86_64 |
timezone | Europe/Amsterdam |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 5000 |
Installed Version | 1.32.1 |
Stage | running |
Available Repositories | 1350 |
Downloaded Repositories | 36 |
HACS Data | ok |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 10.1 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2023.04.1 |
agent_version | 1.5.1 |
docker_version | 23.0.3 |
disk_total | 62.3 GB |
disk_used | 21.6 GB |
healthy | true |
supported | true |
board | ova |
supervisor_api | ok |
version_api | ok |
installed_addons | Home Assistant Google Drive Backup (0.110.4), Samba share (10.0.1), File editor (5.6.0), Terminal & SSH (9.7.0), Portainer (2.0.0), Mosquitto broker (6.2.1), WireGuard (0.8.0), AdGuard Home (4.8.6), TimescaleDB (2.1.1), Duck DNS (1.15.0), NGINX Home Assistant SSL proxy (3.4.2), SQLite Web (3.7.1), Studio Code Server (5.5.7), pgAdmin4 (2.1.1), Zigbee2MQTT (1.30.4-1), ESPHome (2023.4.4), Advanced SSH & Web Terminal (14.1.0), Frigate NVR Proxy (1.3), chrony (2.5.0), DSMR Reader (1.10.1), Vaultwarden (Bitwarden) (0.19.3) |
dashboards | 4 |
---|---|
resources | 19 |
views | 21 |
mode | storage |
oldest_recorder_run | 27 april 2023 om 16:09 |
---|---|
current_recorder_run | 5 mei 2023 om 15:58 |
estimated_db_size | 1904.34 MiB |
database_engine | sqlite |
database_version | 3.40.1 |
api_endpoint_reachable | ok |
---|
From 2023.5 i have this error in my log.
Gladly I still get updates.
Working with HA in a VM in Proxmox
...
Deze fout is ontstaan door een aangepaste integratie.
Logger: urllib3.connectionpool
Source: custom_components/tgtg/sensor.py:189
Integration: tgtg (documentation, issues)
First occurred: 16:01:12 (80 occurrences)
Last logged: 16:22:12
Connection pool is full, discarding connection: apptoogoodtogo.com. Connection pool size: 10
No response
Hi, first of all thanks for the Integration. This is not really a Issue but unfortunately there is no discussion part in this github.
I made this automation to notify me whenever a store I like has new items. I am just curious if you have a better way of doing it instead of listing all entity_id's. If not I just wanted to share because I would have liked a template :).
alias: tgtg notify
trigger:
- platform: state
entity_id:
- sensor.long
- sensor.list
- sensor.of
- sensor.all
- sensor.tgtg
- sensor.stores
action:
#send notification if stock changes from 0 or unavailable to >=1
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.to_state.state | float >= 1 }}'
- condition: template
value_template: >-
{{ trigger.from_state.state | float == 0 or
trigger.from_state.state == "unavailable" }}
sequence:
#change notification method
- service: notify.mobile_app_iphone
data_template:
message: '''{{ trigger.from_state.attributes.friendly_name }}'''
#you don't need the tag if you don't use a Iphone and want to delete messages
data:
tag: '''{{ trigger.from_state.attributes.friendly_name }}'''
default: []
#this is only possible with Iphone I think
#delete notification if stock changes back to 0
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.to_state.state | float == 0 }}'
sequence:
- service: notify.mobile_app_iphone
data:
message: clear_notification
data:
tag: '''{{ trigger.from_state.attributes.friendly_name }}'''
default: []
mode: parallel
max: 10
Hello,
i just updated my HA from the last 2022 version directly to the 2023.1.2
since then, in the UI, all my TGTG are "not available" => it seems related to the new HA release (?)
i joined the logged error
Thanks in advance for your help :-)
Home Assistant 2023.1.2
Supervisor 2022.12.1
Operating System 9.4
Interface utilisateur : 20230104.0 - latest
Détails du journal (ERREUR)
Logger: homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:75
Integration: Capteur (documentation, issues)
First occurred: 06:19:55 (1 occurrences)
Last logged: 06:19:55
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 75, in setup_platform
tgtgReply = tgtg_client.get_items()
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 229, in get_items
self.login()
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 139, in login
self._refresh_token()
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 129, in _refresh_token
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (401, b'{"errors":[{"code":"UNAUTHORIZED","message":"Invalid token for: SoteriaRenewTokenRequest(clientIp=85.201.162.62, clientUserAgent=TGTG/22.12.1 Dalvik/2.1.0 (Linux; U; Android 10; SM-G935F Build/NRD90M), initiatedByUserId=null, permissions=0,5,12411195,0)"}]}')
version | core-2023.3.3 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.10.10 |
os_name | Linux |
os_version | 5.15.84-v8 |
arch | aarch64 |
timezone | Europe/Paris |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4865 |
Installed Version | 1.31.0 |
Stage | running |
Available Repositories | 1248 |
Downloaded Repositories | 21 |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 9.5 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2023.03.1 |
agent_version | 1.4.1 |
docker_version | 20.10.22 |
disk_total | 916.2 GB |
disk_used | 46.2 GB |
healthy | true |
supported | true |
board | rpi4-64 |
supervisor_api | ok |
version_api | ok |
installed_addons | Samba share (10.0.0), Duck DNS (1.15.0), Terminal & SSH (9.6.1), ESPHome (2023.2.4), Zigbee2MQTT (1.30.2-1), motionEye (0.18.0), File editor (5.5.0), Mosquitto broker (6.1.3), ADS-B Multi-Portal Feeder (1.20.0) |
dashboards | 2 |
---|---|
resources | 15 |
views | 13 |
mode | storage |
oldest_recorder_run | 12 mars 2023 à 10:37 |
---|---|
current_recorder_run | 15 mars 2023 à 19:38 |
estimated_db_size | 39.57 MiB |
database_engine | sqlite |
database_version | 3.38.5 |
Since a few days, all the entity are unavailable and I get an error in the log. I've tried to reconnect by uninstalling and install again but nothing change. I don't really understand the meaning of the log. M'y configuration in yaml is exactly the same that python file gave to me. Thanks!
...
Logger: homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:78
Integration: Capteur (documentation, issues)
First occurred: 19:38:37 (1 occurrences)
Last logged: 19:38:37
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 293, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 78, in setup_platform
tgtgReply = tgtg_client.get_items()
File "/usr/local/lib/python3.10/site-packages/tgtg/__init__.py", line 240, in get_items
self.login()
File "/usr/local/lib/python3.10/site-packages/tgtg/__init__.py", line 149, in login
self._refresh_token()
File "/usr/local/lib/python3.10/site-packages/tgtg/__init__.py", line 135, in _refresh_token
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'{"url":"https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMA1YnS04aHwZMA_5ewAw==&cid=1Jii7ZI_jXQxjr-XZRQ9OBcVRQxkH6ou81BsZMRZUEVTUWoJNfVuflue-oAzS-lbS2~Os5Y1~I91WQ-1gXmQ_zc2UaOAjwQsBTUp-2to8510PupRnRcj7c3OV-1mUOfy&referer=https%3A%2F%2Fapptoogoodtogo.com%2Fapi%2Fauth%2Fv3%2Ftoken%2Frefresh&hash=1D42C2CA6131C526E09F294FE96F94&t=fe&s=35558&e=4556d843f49a065b85ed7f6a8988a29c3c1e23d27bb436b5af7bcf65b71f8fec"}')
No response
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 |
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 |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
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 | 3 |
---|---|
resources | 26 |
views | 15 |
mode | storage |
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 |
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"}]}')
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
I think this might be related to a new version of Home Assistant, because the problem started occurring after updating to 2023.11
Too big to paste, 15MB of data.
No response
I don't see any reference to scan_interval
in the code, and also don't see my items updated.
What's going on here?
When running the tgtg_get_tokens to generate the new tokens, In addition to the new tokens, I also get the follwing error. Any ideas what I am doing wrong here?
Traceback (most recent call last):
File "C:\Users\xxxxx\Downloads\home_assistant_tgtg-5.0.0\tgtg_get_tokens.py", line 25, in <module>
print(" cookie: '" + tgtgClient.cookie + "'")
AttributeError: 'TgtgClient' object has no attribute 'cookie'
Tried to re-activate my (Dutch) TGTG integration, but ran into this issue:
Traceback (most recent call last): File "/home/esilverentand/tgtg_get_tokens.py", line 25, in <module> print(" cookie: '" + tgtgClient.cookie + "'") AttributeError: 'TgtgClient' object has no attribute 'cookie'
Downloaded the latest version of tgtg_get_tokens.py
Other data is found by the script
version | core-2023.12.4 |
---|---|
installation_type | Home Assistant Container |
dev | false |
hassio | false |
docker | true |
user | root |
virtualenv | false |
python_version | 3.11.6 |
os_name | Linux |
os_version | 5.4.0-169-generic |
arch | x86_64 |
timezone | Europe/Berlin |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4817 |
Installed Version | 1.33.0 |
Stage | running |
Available Repositories | 1367 |
Downloaded Repositories | 27 |
can_reach_server | ok |
---|---|
remaining_requests | 22 |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
dashboards | 5 |
---|---|
resources | 17 |
views | 25 |
mode | storage |
oldest_recorder_run | December 6, 2023 at 8:07 PM |
---|---|
current_recorder_run | January 5, 2024 at 2:16 PM |
estimated_db_size | 718.14 MiB |
database_engine | mysql |
database_version | 11.2.2 |
api_endpoint_reachable | ok |
---|
I am getting an error, that no item price is returned anymore (also see the following screenshot):
I have already genrated a new token and have restarted home assistant but the attribute is still missing.
-
No response
version | core-2024.1.3 |
---|---|
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.63-haos-raspi |
arch | aarch64 |
timezone | Europe/Amsterdam |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4848 |
Installed Version | 1.33.0 |
Stage | running |
Available Repositories | 1445 |
Downloaded Repositories | 42 |
logged_in | true |
---|---|
subscription_expiration | 31 mei 2024 02:00 |
relayer_connected | true |
relayer_region | eu-central-1 |
remote_enabled | true |
remote_connected | true |
alexa_enabled | false |
google_enabled | true |
remote_server | eu**.nabu.casa |
certificate_status | ready |
instance_id | |
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 11.4 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2023.12.1 |
agent_version | 1.6.0 |
docker_version | 24.0.7 |
disk_total | 228.5 GB |
disk_used | 18.6 GB |
healthy | true |
supported | true |
board | rpi4-64 |
supervisor_api | ok |
version_api | ok |
installed_addons | Samba share (12.2.0), Node-RED (17.0.3), Home Assistant Google Drive Backup (0.112.1), Spotify Connect (0.13.0), ESPHome (2023.12.7), Studio Code Server (5.15.0), Mosquitto broker (6.4.0), Zigbee2MQTT (1.35.1-1), Z-Wave JS (0.4.3), Dutch gas prices (2023.10.15.1), InfluxDB (5.0.0), SQLite Web (4.1.0) |
dashboards | 5 |
---|---|
resources | 24 |
views | 14 |
mode | storage |
oldest_recorder_run | 7 januari 2024 14:13 |
---|---|
current_recorder_run | 16 januari 2024 11:59 |
estimated_db_size | 1880.18 MiB |
database_engine | sqlite |
database_version | 3.41.2 |
api_endpoint_reachable | ok |
---|
sensor wil not update, see log for more details
i dit nothing different than whit other sensors witch do work.
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:898
First occurred: 16 januari 2024 12:04:51 (374 occurrences)
Last logged: 19:19:52
Update for sensor.tgtg_wim_blom_ambachtsbakker_hasselt_verrassingspakket fails
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 462, in _make_request
httplib_response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/http/client.py", line 1378, in getresponse
response.begin()
File "/usr/local/lib/python3.11/http/client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 799, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 462, in _make_request
httplib_response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/http/client.py", line 1378, in getresponse
response.begin()
File "/usr/local/lib/python3.11/http/client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 898, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1218, in async_device_update
await hass.async_add_executor_job(self.update)
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 211, 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 277, in get_item
response = self.session.post(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
No response
version | core-2024.1.3 |
---|---|
installation_type | Unknown |
dev | false |
hassio | false |
docker | false |
user | skinkie |
virtualenv | false |
python_version | 3.11.4 |
os_name | Linux |
os_version | 6.1.51-0-rpi |
arch | aarch64 |
timezone | Europe/Amsterdam |
config_dir | /home/skinkie/.homeassistant |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4915 |
Installed Version | 1.33.0 |
Stage | running |
Available Repositories | 1379 |
Downloaded Repositories | 5 |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
dashboards | 1 |
---|---|
resources | 1 |
views | 5 |
mode | storage |
oldest_recorder_run | January 11, 2024 at 9:17 AM |
---|---|
current_recorder_run | January 18, 2024 at 10:10 AM |
estimated_db_size | 580.99 MiB |
database_engine | sqlite |
database_version | 3.44.2 |
TGTG api returns 404
2024-01-18 10:10:44.864 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/home/skinkie/.local/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform
await asyncio.shield(task)
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/skinkie/.homeassistant/custom_components/tgtg/sensor.py", line 81, in setup_platform
add_entities([TGTGSensor(each_item_id)])
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/skinkie/.homeassistant/custom_components/tgtg/sensor.py", line 102, in __init__
self.update()
File "/home/skinkie/.homeassistant/custom_components/tgtg/sensor.py", line 212, in update
self.tgtg_orders = tgtg_client.get_active()["orders"]
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/skinkie/.homeassistant/deps/lib/python3.11/site-packages/tgtg/__init__.py", line 426, in get_active
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (404, b'')
I guess if it fails to start you cannot reach this point.
Logger: homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:186
Integration: Sensor (documentation, issues)
First occurred: 10:18:56 (1 occurrences)
Last logged: 10:18:56
Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 73, in setup_platform
add_entities([TGTGSensor(each_item_id)])
File "/config/custom_components/tgtg/sensor.py", line 93, in init
self.update()
File "/config/custom_components/tgtg/sensor.py", line 186, in update
self.tgtg_answer = tgtg_client.get_item(item_id=self.item_id)
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 262, in get_item
self.login()
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 139, in login
self._refresh_token()
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 129, in _refresh_token
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'<title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@Keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style>
Please enable JS and disable any ad blocker
<script data-cfasync="false">var dd={'rt':'c','cid':'AHrlqAAAAAMAO6flr6g6whAA9rTuBw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'bf9fe76e3a1cf80d26a431ff0ff9f1c744ae00fd1d9fe2db0516c82ca0f7e91f','host':'geo.captcha-delivery.com'}</script><script data-cfasync="false" src="https://ct.captcha-delivery.com/c.js"></script>\n')For me the whole configuration is not clearly described.
For instance I do not have a password for my account.
When I login with the TGTG iPhone app I use my email address.
Then I get an email with a login button and numeric code to login.
Is this numeric code (one-time-password?) the password that I should use?
Update:
I tried to use that numeric code with the "get items" script but it doesn't work, that gives an authentication failure.
But I got an email that I tried to logon from different device and that email also contained a link to reset password. After resetting and using that password it worked.
I also do not understand why my favourites are not used by default.
The upstream component seems to support that.
Instead I need to use a python script to get these. That is not user friendly at all (it only works for developers that are familiair with running python scripts). I would expect that I can just pick the items when I setup the configuration preferably in the Home Assistant UI.
How to get the api secrets as alternative for username and password is not well documented.
I am in the Netherlands BTW
TooGoodToGo change their authentication method.
We have to wait for upstream module to be corrected.
Also good to watch the progress on the node-js module
Please change version to 0.11.2
Log:
INFO:homeassistant.util.package:Attempting install of tgtg>=0.11.0
ERROR:homeassistant.util.package:Unable to install package tgtg>=0.11.0: warning: missing-index-doctype
× The package index page being used does not have a proper HTML doctype declaration.
╰─> Problematic URL: https://wheels.home-assistant.io/alpine-3.14/amd64/
note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
ERROR: Cannot install tgtg==0.11.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
INFO:homeassistant.util.package:Attempting install of tgtg>=0.11.0
ERROR:homeassistant.util.package:Unable to install package tgtg>=0.11.0: warning: missing-index-doctype
× The package index page being used does not have a proper HTML doctype declaration.
╰─> Problematic URL: https://wheels.home-assistant.io/alpine-3.14/amd64/
note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
ERROR: Cannot install tgtg==0.11.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
INFO:homeassistant.util.package:Attempting install of tgtg>=0.11.0
ERROR:homeassistant.util.package:Unable to install package tgtg>=0.11.0: warning: missing-index-doctype
× The package index page being used does not have a proper HTML doctype declaration.
╰─> Problematic URL: https://wheels.home-assistant.io/alpine-3.14/amd64/
note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
ERROR: Cannot install tgtg==0.11.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Failed config
General Errors:
- Platform error sensor.tgtg - Requirements for tgtg not found: ['tgtg>=0.11.0'].
Seems to be related, (and I quote, because it doesn't mean a lot lot to me) to hard pin on requests
here: https://github.com/ahivert/tgtg-python/blob/master/pyproject.toml#L11
Would be nice to have a (binary) sensor to track what you ordered and also the pick up window for your order(s). In this way you can automate HA to warn e.g. when it's time to pick up the order.
As the TGTG price and Original value in the sensor attributes are no clean numbers, I cannot add a 0 to it (e.g. when the price is 10,50 EUR, the result is 10.5 EUR). I would like to have the 2nd digit behind the comma added, or to make it a clean number so that I can do it myself in my automation.
Item ID: 523323
Item URL: https://share.toogoodtogo.com/item/523323
TGTG Price: 3.5 EUR
Original value: 10.5 EUR
Pickup start: 2023-02-02T19:00:00Z
Pickup stop: 2023-02-02T19:25:00Z
unit_of_measurement: pcs
icon: mdi:storefront-outline
after pasting in the config into a yaml file, HA doesnt finish checking the config before restart. The spinning icon never stops. Removing the config, it works as normal again.
Logging into terminal and forcing a reboot. fingers crossed.
EDIT: after forcing a reboot, the check config now works again. Maybe a full reboot was needed for the integration to settle?
-
Hi,
Thank you for this integration.
I am trying to find a way to manually trigger the checks. Does this integration provide this type of service/event?
With time, I came to know the best time to get an item. I would like to optimize the intervals of check for specific store.
Regards, AD.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.