TooGoodToGo MQTT Bridge

Thanks for the code, it seems to be working well for me using the stores around work.

I’ve noticed I’m getting an email saying ‘login from new device’ every time it checks the api.

Is there any way to stop that?

Never seen this before… Do you have some special Stores in your favorites? Weird names, identical items, something like that?

This should only happen on startup. Does the addon restart for you? do the logs show something weird?

Hi All,

Im afraid that the last update brick my HA. When TooGoodToGo is running lots of connections to the internet are broken, times out etc… HA system become slow.

When i stop the Add-on and reboot the HA everything work normal again.
I tried to do debug things, but HA doesn’t show errors… only error that It can’t connect to the world.

I had ‘restart if crashed’ enabled so I’ve disabled that and will see if it’s constantly restarting itself. The only issue I see in the add-on log is this:

Ah yeah, it crashed out. Here’s the log:

Weird thing, the store is missing some property. Could have various reasons why they did this.

Never occured for me before, maybe this is something that happens to some early adopter stores. Storeid is pretty low (1098) compared to some store that i know only a few months about (310644).

Fix should be only a few lines of code, maybe tonight.

Never seen before here.

Is there anything special? Slow internet, low powered hardware, extrem fast polling interval?

Do you have some portainer available?

There are stats available that show the network/cpu/memory consumption of the docker container:

can you provide such an image?

I don’t see the add-on at container section. Only in image section.
And don’t see any stats options… (Have portainer inside HA)

As an experiment I’ve unfavourited that store and restarted the app with crash-restart on. I’ll give it a while then take a look at the logs.

Edit: it was fine once I killed the two stores with 1000ish numbers. Seems like the early stores are an issue as they don’t have certain data like the logo.

Access to these containers can be gained by going into Portainer → Settings → Hidden containers. Then delete the listed hidden labels (io.hass.type labels). Only do this if you know what you’re doing!

Thanks. Removed the io.hass for addons and now have all containers.
This is something security that you don’t remove a container?

Get mails from Toogoodtogo on different days with: login from a new device.

Device: TGTG/20.12.3 Dalvik/2.1.0 (Linux; U; Android 6.0.1; Nexus 5 Build/M4B30Z)
Device: TGTG/20.10.2 Dalvik/2.1.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K)
Device: TGTG/20.10.2 Dalvik/2.1.0 (Linux; U; Android 7.0; SM-G935F Build/NRD90M)

Is this normal? And does this email come e.g. after every update of the addon?
I didnt own one of these devices

It seems that problems are gone. I don’t know what it was.
I changed 2 things:

cleanup: true

to

cleanup: false

Also reboot my router, a cold boot of HA.

Now running again for 2 hours without any issues.

I can’t reproduce the problem…

Mostly to prevent users from messing things up there. So, yes, also to prevent someone from stopping containers they should not stop :wink:

Weird, but stuff like this happens. Glad everything is back fine.

1 Like

Yes. On every update a new login is created. The Device identifier is hardcoded here: https://github.com/ahivert/tgtg-python/blob/ed509b390030d0cad87496e2f9ee4916ba186862/tgtg/init.py#L17 and picket at random.

Maybe someday I will try to store the credentials/token after some sucessfull login. But somehow i like it, every time i get some mail like this i know something happend :wink:

I updated the addon to v1.6.0 that contains some quick fix for that issue. Have a try :slight_smile:

‘Okay, I give up, use TGTG logo’

Ha! I like your code notes.

I’ll pull the code once my add-on recognises there’s an update and then try the low-number store IDs again.

Thanks for the quick turnaround!

1 Like

ok, then let’s hope that tgtg doesn’t block me/us because of too many logins with different devices :wink:

and of course also not because of the request every 5 minutes

don’t think so. Been using this for more than two years now, no issues. Also, I use it to buy things which makes them earn money. It is more like a win-win for all :wink:

1 Like

Hie Dielee, how do you know the name of your sensor please ?
My Toogoodtogo’s mqtt log give me that but I don’t know how to convert it in sensors ?

Could you help me please ? Cheers :wink: :+1:t2: