Search code examples
home-assistant

Home assistent in docker can't find configyration.yaml


I am new to home assistant, but have some experience with docker. I have intel NUC and wanna install thermostatic valves with zigbee. But I somehow fail at first step, that is making home assistant work in docker and being able to install integrations.

I started with this tutorial I believe. I might have taken inspiration from multiple tutorials along the way.

So my problem is I don't see integrations and docker command for checking configuration reports error:

$ sudo docker exec homeassistant python -m homeassistant --script check_config --files

Testing configuration at /root/.homeassistant
yaml files (used / not used)
Failed config
  General Errors:
    - File configuration.yaml not found.

Successful config (partial)

I can see the configuration file on home assistant container and check in UI also don't raise any issues.

$ sudo docker exec -it homeassistant bash
bash-5.1# pwd
/config
bash-5.1# ls -la | grep configuration.yaml
-rwxrwxrwx    1 1000     1000           418 Nov 11 18:42 configuration.yaml

It seems similar issue was here, but answer is already deleted.

This is my compose.yaml

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /home/mali/project/homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

  #Mosquitto
  mosquitto:
    container_name: mqtt
    image: eclipse-mosquitto
    ports:
      - 1883:1883
      # This port is for Webhooks
      - 9001:9001
    volumes:
      - /home/mali/project/homeassistant/mosquitto/config:/mosquitto/config
      - /home/mali/project/homeassistant/mosquitto/data:/mosquitto/data
      - /home/mali/project/homeassistant/mosquitto/log:/mosquitto/log

  #Zigbee2MQTT
  zigbee2mqtt:
    container_name: zigbee2mqtt
    depends_on:
      - mosquitto
    image: koenkk/zigbee2mqtt
    volumes:
      - /home/mali/project/homeassistant/zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      # Frontend port
      - 8080:8080
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    restart: always
    privileged: true

and this is my configuration.yaml file:

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

no_ip:
  domain: {redacted}.no-ip.org
  username: [email protected]
  password: {redacted}

What am I doing wrong please?


Solution

  • I can't read :facepalm:

    Testing configuration at /root/.homeassistant

    There is written it looks for config in different directory. So I believe this is command I should have used:

    docker exec homeassistant python -m homeassistant --script check_config --config /config