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

3. SmartHome access

roobbb edited this page Jul 1, 2021 · 8 revisions

example definition in FHEM (when FHEM is installed locally and running on your host directly)

define myOWServer OWServer 127.0.0.1:4304
attr myOWServer room OneWire

example when FHEM even runs in a container

add a new user-defined-network docker network create mynet

  • 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 (myserver), 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=mynet \
      --network-alias myserver \
      -p 2121:2121 \
      -v /etc/localtime:/etc/localtime:ro \
      -v /mypath/to_my_config:/root/.local/share \
      --device=/dev/ttyUSB0 \
      -e CUSTOM_CONFIG_ENABLED=1 \
      -e CUSTOM_CONFIG_FILE=/root/.local/share/owfs.example \
    roobbb/owserver:dev
    
  • check if the web-interface is reachable via http://yourHost:2121/

  • start the official FHEM container as it matches your requirements (for more details please check Readme on Github https://github.com/fhem/fhem-docker or FHEM board https://forum.fhem.de/index.php?topic=89745.0)

  • please make sure FHEM is member of at least one network where owserver is connected to (mynet in this example)

example for this testing here:

  docker run -d --rm --net=mynet -p 8083:8083 --name fhem  fhem/fhem
  • please check if you can reach FHEM's web-if via http://yourHost:8083/fhem
  • define a device for owserver in FHEM - let's assume you wrote "myserver:4304" into your owfs.example as owserver's adress

define myLocalOWServer OWServer myserver:4304
attr myLocalOWServer room OWDevice
attr myLocalOWServer nonblocking 1

  • you should see lots of readings right after entering the define-command - if not, please check server adress+port as defined in owfs.example and start-command of owserver-container

  • of course you can start owserver and FHEM with the option "--net=host" and both of them can be member of further networks as long as both share at least one network

  • if you use "--net=host" you have to set owserver to 127.0.0.1:4304 again - just like you should, when FHEM would run as a local service