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

Independent Docker setup? #23

Open
xX-Nexus-Xx opened this issue Nov 28, 2021 · 10 comments
Open

Independent Docker setup? #23

xX-Nexus-Xx opened this issue Nov 28, 2021 · 10 comments

Comments

@xX-Nexus-Xx
Copy link

Hello,

I'm running my own docker environment in parallel to my HA-Setup.

Is it possible to run this image as independent docker (not as HA-AddOn) ??

If yes, what are the docker settings required?

thanks for considering

@MaxWinterstein
Copy link
Owner

Hi,

I think this is mentioned at the https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge#readme with all needed settings?

@xX-Nexus-Xx
Copy link
Author

xX-Nexus-Xx commented Nov 29, 2021

Yes, I used that one but i think the settings.local.json is not getting found ... additionally im getting the below error

File "main.py", line 21, in <module>, email=settings.tgtg.email,, File "/usr/local/lib/python3.7/site-packages/dynaconf/base.py", line 164, in __getattr__, value = getattr(self._wrapped, name), AttributeError: 'Settings' object has no attribute 'TGTG',

I could not find where or what attribute for TGTG to be set

thanks for yoyr help

Gruesse von DownUnder

@MaxWinterstein
Copy link
Owner

Oh, seems like it broke somehow with dynaconf-3.1.2. Just curious how this could have worked before? 🤔

Need to fix this.

@MaxWinterstein
Copy link
Owner

Oh, it seems like I never updated the latest tag of the image -.-

Can you please retry?

Either via a defined tag:

docker run --rm -ti -v $PWD/settings.local.json:/app/settings.local.json -v $PWD/data/:/data maxwinterstein/toogoodtogo-ha-mqtt-bridge:1.9.1

or via latest i just updated:

docker pull maxwinterstein/toogoodtogo-ha-mqtt-bridge
docker run --rm -ti -v $PWD/settings.local.json:/app/settings.local.json -v $PWD/data/:/data maxwinterstein/toogoodtogo-ha-mqtt-bridge

@poudenes
Copy link

Did you figure out to install this great tool as docker?

I also want move the addon to my Synology NAS and run this on the NAS... MQTT will do the rest

@MaxWinterstein
Copy link
Owner

Should work fine?

  • use some recent version maxwinterstein/toogoodtogo-ha-mqtt-bridge:2.3.0
  • mount a whole folder to /data
  • mount a settings file at /app/settings.local.json

there is no real need to use the add-on. this is why I split the thing into two repositories :)

@MaxWinterstein
Copy link
Owner

Still any questions?

@poudenes
Copy link

poudenes commented Jan 12, 2023

Im try to use the add-on also as singe docker. Get this error:

Traceback (most recent call last):
  File "main.py", line 252, in <module>
    start()
  File "main.py", line 233, in start
    timeout=settings.tgtg.every_n_minutes * 60 * 3 + 30,  # 3 pull intervals + 1 timeout
  File "/usr/local/lib/python3.7/site-packages/dynaconf/utils/boxing.py", line 16, in evaluate
    value = f(dynabox, item, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/dynaconf/utils/boxing.py", line 39, in __getattr__
    return super(DynaBox, self).__getattr__(n_item, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/dynaconf/vendor/box/box.py", line 177, in __getattr__
    raise BoxKeyError(str(E)) from _A
dynaconf.vendor.box.exceptions.BoxKeyError: "'DynaBox' object has no attribute 'EVERY_N_MINUTES'"

settings.local.json:

{
  "mqtt": {
    "host": "172.30.33.11",
    "port": 1883,
    "username": "hassiomqtt",
    "password": "abercrombie"
  },
  "tgtg": {
    "email": "[email protected]",
    "language": "nl_NL",
    "polling_schedule": "*/10 * * * *",
    "intense_fetch":
        {
          "interval": 30,
          "period_of_time": 5
        }
  },
  "timezone": "Europe/Amsterdam",
  "locale": "nl_NL"
}

@poudenes
Copy link

Done. Removed :1.9.1 from image and now its working

@MaxWinterstein
Copy link
Owner

/close

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

3 participants