Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

3.3. example for Home Assistant

roobbb edited this page Oct 5, 2021 · 1 revision

example when Home Assistant runs in a container with a user-defined-network

  • add a new user-defined-network

    docker network create testnet
    
  • edit owfs.example and change server ip-address from 127.0.0.1 to the name of the docker container which we want to start (owserver) or its network-alias (myowserver), even the server's port should be the same as what we want to map

  • start owserver-container with new network and alias and map ports as required

    docker run -d \
       --rm \
       --name=owserver \
       --net=testnet \
       --network-alias myowserver \
       -p 2121:2121 \
       -v /etc/localtime:/etc/localtime:ro \
       -v ~/docker/owserver:/root/.local/share \
       -e CUSTOM_CONFIG_ENABLED=1 \
       -e CUSTOM_CONFIG_FILE=/root/.local/share/owfs.example \
    roobbb/owserver:latest
    
  • only port 2121 will be exposed here, just for easy testing if it is reachable

  • check if the web-interface is reachable via http://yourHostIP:2121/ or via http://localhost:2121/

  • the other ports like 4303 for data connection will be available inside the user-defined-network (testnet) only


  • create a local folder on your host for easier testing and accessing files in any location you want and point to actual path inside the docker call

  • the following docker call is just for demonstrating, please take a look into the official docs found here https://www.home-assistant.io/installation/linux#install-home-assistant-container

    docker run -d \
      --rm \
      --name homeassistant \
      --net=testnet \
      --network-alias myhass \
      -p 8123:8123 \
      -v /etc/localtime:/etc/localtime:ro \
      -v /etc/timezone:/etc/timezone:ro \
      -v mylocalpath/:/config \
      ghcr.io/home-assistant/home-assistant:stable
    
  • Home Assistant should now be reachable via http://yourHostIP:8123

  • inside Home Assistant's WebUI go to "Configuration" and open "Integrations"

  • click "+ ADD INTEGRATION"

  • look for "1-Wire" in the list and open it

  • choose Connection Type "OWServer" and click SUBMIT

  • enter your owserver alias in the field Host as defined above (e.g. myowserver) and change the port if you defined an other than 4304

  • click submit

  • you should get a Success! message box where the found sensors are presented (faked sensors for testing or the real one if already attached to bus); change area for each of them and click finish

  • the integrations page should show all the found devices and entities and in the overview page you should see your sensor values