Home assistant health check but for integrations also

  home-assistant:
    image: homeassistant/home-assistant
    container_name: home-assistant
    hostname: home-assistant
    restart: unless-stopped
    cap_add:
      - NET_RAW
      - NET_ADMIN
    user: "0"
    network_mode: host
    environment:
      TZ: ${TZ}
    volumes:
      - /run/dbus:/run/dbus:ro
      - ./config/home-assistant:/config
    depends_on:
      mariadb:
        condition: service_healthy
    extra_hosts:
      - "mariadb:172.20.0.101"
      - "frigate:172.20.0.102"
      - "mosquitto:172.20.0.103"

Is there a health check I can add to home assistant, that will not only make sure that home assistant has started, but also all the integrations have been started also?

The reason is that other containers, like node-red, depend on home assistant being fully started before they start, otherwise they produce errors, and some of the flows don’t activate unless home assistant is fully started.

If you just want to know when HA has fully started & loaded all integrations, you could use the homeassistant_started event as a trigger to let your other containers know it’s safe to start.

Not sure how you’d pass that info to your other containers because I know next to nothing about Docker, but hopefully it’s enough to get you started.

Ideally it should be done in docker. For example mariadb uses this for health checks. Note the healthcheck: section

  mariadb:
    image: mariadb
    container_name: mariadb
    hostname: mariadb
    restart: unless-stopped
    user: "0"
    environment:
      TZ: ${TZ}
      MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
    ports:
      - 3306:3306
    volumes:
      - ./config/mariadb/mysql:/var/lib/mysql
      - ./config/mariadb:/docker-entrypoint-initdb.d
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized"]
      interval: 10s
      timeout: 5s
      retries: 10
      start_period: 30s
    networks:
      network:
        ipv4_address: 172.20.0.101