Skip to content

Latest commit

 

History

History
84 lines (65 loc) · 3.17 KB

File metadata and controls

84 lines (65 loc) · 3.17 KB

smarthome.homeassistant

Installs the lscr.io/linuxserver/homeassistant image. Modifies the Dockerfile to enable avahi-tools.

Why to modify the Dockerfile?

Role Variables

  • homeassistant_port
    • Default: 8123
    • Description: The port on which HomeAssistant will be accessible.
    • Type: int
    • Required: no
  • homeassistant_network
    • Default: homeassistant
    • Description: The name of the Docker network.
    • Type: str
    • Required: no
  • homeassistant_install_dir
    • Default: /opt/docker/homeassistant
    • Description: The directory where HomeAssistant will be installed.
    • Type: str
    • Required: no
  • homeassistant_env
  • homeassistant_config
  • homeassistant_homekit_config
  • homeassistant_mdns_host_network_interface
    • Default: eth0
    • Description: The host network interface from which mDNS requests are sent to the HomeAssistant container.
    • Type: str
    • Required: no

Dependencies

Example Playbook

- hosts: localhost

  roles:
    - artyorsh.smarthome.homeassistant

Only include specific HomeAssistant entries

- hosts: localhost

  vars:
    homeassistant_homekit_config:
      filter:
        include_entity_globs: ["light.*"]

  roles:
    - artyorsh.smarthome.homeassistant

Why to modify the Dockerfile?

Running HomeAssistant in a Docker bridge network causes issues with the discoverability of the HomeKit integration by Apple Home. This is because HomeKit relies on mDNS for device discovery, which doesn't work out of the box across Docker's bridge network due to the way Docker handles networking. By enabling Avahi tools, which provide mDNS services, the HomeAssistant container can broadcast its presence on the network, making it discoverable by Apple Home. For more details, please refer to this community thread.

Why to run in a bridge network?

Running in a bridge network provides isolation between the Docker containers and the host machine, which enhances the security of IoT infrastructure. It allows containers to communicate with each other while keeping them isolated from the host's network.

Is it still possible to run it in the host network?

Yes, it is. In this case, mDNS replication and customization of HomeAssistant image are not required.