Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to map /var/run/dbus/:/var/run/dbus/:z in docker #90

Open
TomTorger opened this issue Jul 16, 2022 · 8 comments
Open

Need to map /var/run/dbus/:/var/run/dbus/:z in docker #90

TomTorger opened this issue Jul 16, 2022 · 8 comments

Comments

@TomTorger
Copy link
Contributor

Hello,

I was stuck for a while. I am running HA in docker on Ubuntu and had to map /var/run/dbus to get this to work. Not sure there is anything the repo can do to fix this issue, but perhaps include some text somewhere for those who get stuck? :-)

(...) volumes: - /var/run/dbus/:/var/run/dbus/:z

You can find the same issue here: devbis/ble2mqtt#5

@ismarslomic
Copy link

ismarslomic commented Jul 20, 2022

I get same issue as @mikeboiko in #86, after upgrading Airthings Wave custom component to v4.0.0 in HACS. I even tried redownloading and Updating the information in HACS, without any luck.

2022-07-20 22:44:46 ERROR (SyncWorker_2) [custom_components.airthings_wave.airthings] Not getting device info because failed to connect to device.

I'm running HA v2022.7.5 in Docker container on Ubuntu Server (22.04 LTS) running on Intel Nuc. I tried mounting dbus as volume, but without any luck.

docker-compose.yml for HA:

version: '3.8'
services:
  homeassistant:
    container_name: homeassistant
    image: homeassistant/intel-nuc-homeassistant:2022.7.5
    volumes:
      - ./config/ha:/config
      - /var/run/dbus:/var/run/dbus:z
    environment:
      - TZ=Europe/Oslo
    restart: unless-stopped
    network_mode: "host"
    depends_on:
      - zwavejs2mqtt

Custom sensor configuration for Airthings that is unchanged and worked previously:

- platform: airthings_wave
  mac: !secret airthings_wave_mac
  scan_interval: 600 # in seconds (10 minutes)

Edit: I have Airthings Wave Plus device

@ismarslomic
Copy link

@TomTorger since you run HA in docker and on Ubuntu, and you have managed to fix the issue similar to mine, could you please share your docker-compose.yml file for HA and the sensor configuration for Airthings Wave? I have tried removing the mac property of sensor configuration, but then I get the error below. So I think I need to explicitly set the mac address since mine Airthings Wave Plus device can't be auto detected.

ERROR (SyncWorker_4) [custom_components.airthings_wave.sensor] Failed intial setup.

@mikeboiko
Copy link

@TomTorger, thanks for the share. The dbus volume mount fixed my issue!

@ismarslomic
Copy link

@mikeboiko see my posts above. Could you please share your setup, since mounting dbus volume did not fix mine issue.

@mikeboiko
Copy link

@ismarslomic, sure. This is my compose snippet:

  home-assistant:
    container_name: home-assistant
    hostname: home-assistant
    image: ghcr.io/home-assistant/home-assistant:latest
    environment:
      TZ: 'America/Edmonton'
    volumes:
      - ./volumes/ha:/config
      - /etc/localtime:/etc/localtime:ro
      - /var/run/dbus/:/var/run/dbus/:z
    restart: always
    network_mode: host
    depends_on:
      - mqtt
      - db
      - assistant-relay
      - zwavejs2mqtt
    privileged: true

@ismarslomic
Copy link

@mikeboiko Excellent, it worked! Thanks mate! Issue where that I did not start the container in privileged mode.

@mikeboiko
Copy link

@ismarslomic good stuff!

@TomTorger
Copy link
Contributor Author

Guess I should have included the full docker config. Great to see you managed anyways :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants