Problems with HA after moving from RPi to NUC PC with Docker/Traefik

In my old setup I have a Rpi2 with Pihole + mqtt + HomeAssistant + Let’s encrypt + bluetooth + Alexa + Telegram webooks integrated and working properly.

Now I’ve moved everything to a new installation on Debian with Portainer + Docker Compose + Traefik.
I’ve backed up all the config and DB and copied on new installation, and made proper updates to new situation.

HA is working properly, I can access through Traefik with SSL to my domain with https.

But this things stop working / or I don’t know how to make it work:
1.- Alexa Integration stop working is the same old domain… so integration should be the same, no?
2.- I don’t know how to integrate the host Bluetooth dongle with docker (without network host, because of traefik)
3.- HA sends Telegram message when starts and arrives to my phone… but when I try to use Interactive menu from telegram, HA seems not to receive anything from the webhook.

Any help should be appreciated.

1 Like

As far as the Alexa integration:
Often times things that are integrations get a slightly different entity ID when you change systems or major version updates (happens every few updates with my alarm system). Since all your commands and scripts are built off of the original entity ID then it does not work. You can just go to Configuration, Entities, and then edit the name of that entity

For bluetooth:
Since you dont want to use network host, you need to mount the usb dongle to the docker contianer:

No experience/insight on telgram issue.

Are you using Home Assistant or Hassio?

Home Assistant, thank you for your interest.

Ok I’ll try this BT solution and let you know.

Well… in my host I run:

sudo apt-get install bluetooth bluez bluez-tools rfkill
sudo rfkill list
sudo rfkill unblock bluetooth
sudo service bluetooth start

I’ve added /dev/bus/usb:/dev/bus/usb in volumes section of my docker-compose, as suggested in your solution.

When I run rfkill list in host or docker it shows:

0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

So, it seems to work… but when I try with: hciconfig scan
In my host I get:

hci0:   Type: Primary  Bus: USB
        BD Address: 00:1B:DC:0F:90:F6  ACL MTU: 310:10  SCO MTU: 64:8
        UP RUNNING
        RX bytes:1020 acl:0 sco:0 events:46 errors:0
        TX bytes:943 acl:0 sco:0 commands:46 errors:0

And in docker:
Can't open HCI socket.: Address family not supported by protocol

What i’m missing? Thanks!

1 Like

I’ve noticed that in my Home Assistant docker container log appears:

2020-04-18 09:19:04 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X```

Where X.X.X.X is the internal IP of the Traefik container… I’ve added it to the trusted networks… and still the same.

Here’s the result when I filter by “telegram” on the Home Assistant container log at startup.

2020-04-18 10:00:46 INFO (SyncWorker_6) [homeassistant.loader] Loaded telegram from homeassistant.components.telegram
2020-04-18 10:00:46 INFO (MainThread) [homeassistant.setup] Setting up telegram_bot
2020-04-18 10:00:46 INFO (MainThread) [homeassistant.components.telegram_bot] Setting up telegram_bot.webhooks
2020-04-18 10:00:47 INFO (MainThread) [homeassistant.components.telegram_bot.webhooks] Set new telegram webhook https://<MYDOMAIN>/api/telegram_webhooks
2020-04-18 10:00:47 INFO (MainThread) [homeassistant.setup] Setup of domain telegram_bot took 0.6 seconds.
2020-04-18 10:00:47 INFO (MainThread) [homeassistant.components.notify] Setting up notify.telegram
2020-04-18 10:01:17 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:17 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:18 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:19 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:21 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:23 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:25 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:27 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:29 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:31 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:33 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:35 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:37 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:39 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X
2020-04-18 10:01:41 WARNING (MainThread) [homeassistant.components.telegram_bot.webhooks] Access denied from X.X.X.X

New situation about telegram: SOLVED

This is my http section on my configuration.yaml:

http:
  base_url: !secret base_url
  use_x_forwarded_for: true
  trusted_proxies:
    - !secret ip_Host_Traefik #Traefik container IP

After adding the Ip of traefik container, I could receive messages and when I called interactive menu, Home Assistants didn’t give me an answer. The problem was this:

So I replaced all unicode emojis whith the new \UXXXXXXXX format and Telegram works as in my rpi.

I’m still trying to find a solution for Bluetooth on container without -net: host.
And also for Alexa (I hope repeating the integration configuration from scratch will solve the problem)

Well… new situation: Alexa: SOLVED!

As I suspected the problem with alexa was that I don’t know why but the lifetime token from Home Assistant has been removed, so I created a new one and then:
Update only the long time token:

login to:
https://eu-west-1.console.aws.amazon.com/lambda/home?region=eu-west-1#/functions/haaskav2?tab=configuration
Edit config.json and change token.
Save
Link skill to account.

And now is working again.

Still searching for bluetooth solution.

Thank you for your detailed info and suggestions, but I have all the stuff working (traefik, portainer, hass on docker without host, mqtt)… but the bluetooth tracking. I can’t make it work on docker… so I moved to nmap tracker and solved the problem.

For me the traefik and hass configuration is almost “auto” I don’t need any .toml file. And I have also included som macvlan for pihole (as dhcp).

For SSL I’ve configured traefik to use my OVH domain and works pretty well.

Final solutions:

Thank you all.