linuxserver / docker-homeassistant

GNU General Public License v3.0
204 stars 32 forks source link

[BUG] Timezone setting not working #89

Closed koseduhemak closed 10 months ago

koseduhemak commented 10 months ago

Is there an existing issue for this?

Current Behavior

docker compose exec homeassistant date: Mon Nov 13 12:47:55 UTC 2023

Expected Behavior

docker compose exec homeassistant date: Mon Nov 13 13:47:55 CET 2023

existing configuration: image

Steps To Reproduce

Launching the docker container via docker compose up -d while supplying Timezone setting (see docker compose).

When looking at the docker logs, the time is wrong (and inside the container UTC is set instead of the provided timezone (Europe/Berlin)).

Environment

- OS: Ubuntu 22.04.3 LTS
- How docker service was installed: manual by docker.com

CPU architecture

x86-64

Docker creation

homeassistant:
    container_name: homeassistant
    image: lscr.io/linuxserver/homeassistant:latest
    volumes:
      - $VOLUMESDIR/homeassistant/config:/config
    #devices:
    #  - /dev/ttyUSB0:/dev/ttyUSB0
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Berlin/Europe
    restart: unless-stopped
    networks:
      - traefik
      - homeassistant
      - mariadb
    #network_mode: host
    depends_on:
       - mariadb
       - mosquitto
       - zigbee2mqtt
    healthcheck:
      test: curl -fSs 127.0.0.1:8123 || exit 1
      start_period: 10s
      interval: 30s
      timeout: 10s
      retries: 5
    labels:
      - "traefik.enable=true"

Container logs

❯ docker compose exec homeassistant date
Alias tip: dce homeassistant date
Mon Nov 13 12:55:16 UTC 2023

# from homeassistant itself:
2023-11-13 12:36:36.224 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'name': 'Pearl...

(log taken at 13:36 which just occured at that time but docker log shows the wrong time).

github-actions[bot] commented 10 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 10 months ago

Your TZ var is set incorrectly

koseduhemak commented 10 months ago

Oh gosh... I am really blind- didn't saw the mistake. Thanks for pointing it out.