BrainicHQ / tado-assistant

Enhance your Tado experience with this free, user-friendly auto-assist tool, now featuring multi-account support! Ideal for both tech-savvy and non-technical users, it offers advanced home state monitoring, smart adjustments, and open window detection. Independently developed and not affiliated with Tado GmbH.
GNU General Public License v3.0
21 stars 3 forks source link

Docker Compose #4

Closed array81 closed 8 months ago

array81 commented 8 months ago

Is there a way to use it with Docker Compose? Maybe passing the configuration via file.

array81 commented 8 months ago

I tried using Docker Compose with the following code:

tado-assistant:
    container_name: tado-assistant
    image: brainic/tado-assistant
    volumes:
      - /var/log:/var/log
    environment:
      - NUM_ACCOUNTS=1
      - TADO_USERNAME_1='myusername'
      - TADO_PASSWORD_1='mypaswword'
      - CHECKING_INTERVAL_1=15
      - ENABLE_LOG_1=true
      - LOG_FILE_1=''
      - MAX_OPEN_WINDOW_DURATION_1=

The code seems to work (even though the log is not created in the desired folder) all I get is a failure at login: "❌ Login error for account 1, check the username / password!"

The login data are right, I can use it with "tado_aa" script without problem.

s1lviu commented 8 months ago

Hi @array81,

Regarding your question about passing configuration via a file, you can indeed use an environment file with Docker Compose. This method is particularly useful for managing sensitive information like usernames and passwords. Here's how you can do it:

Create an Environment File:

Example tado.env:

# tado.env
NUM_ACCOUNTS=1
TADO_USERNAME_1=myusername
TADO_PASSWORD_1=mypassword
CHECKING_INTERVAL_1=15
ENABLE_LOG_1=true
LOG_FILE_1=/var/log/tado-assistant.log
MAX_OPEN_WINDOW_DURATION_1=

Update Your Docker Compose File:

version: '3.8'

services:
  tado-assistant:
    container_name: tado-assistant
    image: brainic/tado-assistant
    volumes:
      - tado_logs:/var/log
    env_file:
      - tado.env
    restart: unless-stopped

volumes:
  tado_logs:

Give this configuration a try and let me know how it works for you. If you find the project helpful, please consider giving it a star or sharing your feedback!

Thanks!