Mosquitto (MQTT) in Docker for Home Assistant on Synology - #004

preview_player
Показать описание

NOTE: Command to download Docker image was updated and new version is in the description and a link to default MQTT configuration file.

In 4th episode of Home Assistant series we will install Mosquitto also called MQTT in Docker on Synology.

Terminal Emulator - PuTTY
--------------------
For connecting via SSH, you will need terminal application, and I use for this Putty. Download link is:

00:00 Intro
00:30 Connect visa SSH to terminal server
01:00 Create folders
01:34 Download, create and run MQTT container
05:16 Verify MQTT is running
06:30 Configure MQTT in Home Assistant
09:00 Restart Home Assistant to activate configuration
09:50 Check to see if integration is active

Command to download MQTT image:
--------------------
sudo docker run --name="mqtt" --restart=always --net=host -tid -p 1883:1883 -p 9001:9001 -v /volume1/docker/mqtt/config:/mosquitto/config:ro -v /volume1/docker/mqtt/log:/mosquitto/log -v /volume1/docker/mqtt/data/:/mosquitto/data/ eclipse-mosquitto

You may need to provide default doncifugration file for MQTT.
Download it from here:

This file needs to be copied to MQTT configuration folder:

/docker/mqtt/config

Also, fix permissions to with:

sudo chown 1883:1883 /volume1/docker/mqtt -R

mqtt:
broker: !secret mqtt_url
port: !secret mqtt_port
client_id: home-assistant
discovery: true
discovery_prefix: homeassistant

mqtt_port: 1883

Save everything, verify configuration and restart Home Assistant.

Please, give me a thumb up if you liked this video, subscribe if you still haven't and I'll see you next time!

Have fun!
BeardedTinker

🧡 If you would like to support me and this channel, you can JOIN and become channel member!

✅Twitter: @BeardedTinker
#HomeAssistant #docker #synology #mqtt
Рекомендации по теме
Комментарии
Автор

For others to save some time. After MQTT 2.0 they forced LOCAL only mode that means you can only use localhost as an IP address or it wont work. That means if you use sonoff with Tasmota with different IP addresses MQTT wont allow to join. As a quick workaround use MQTT 1.6.9 that works without issue for me.

Merwenus
Автор

Hi, Thank you for your very helpful videos. I am just starting in my journey on Home Assistant and find your content very useful.

I am currently trying to install MQTT on my Synology docker and have followed your steps (including the fix for version 2 in your subsequent video). My log file for MQTT shows that it is starting in local only mode. Thanks for all the great content!

Ysater
Автор

There are now only few remaining Dockers on the to-do list for Home Assistant on Synology: Zigbee2MQTT and ESPHome. After that I'll do testing of Hassio in Docker and Hassio in native Synology package.
If I've missed some Dockers or applications you want to try and install in Docker, leave me a comment please and I'll look into it.

BeardedTinker
Автор

New video on installing MQTT for Synology/Home Assistant will be out on Thursday. Although it has some negative sides, it should be much easier to install and configure then this version.

BeardedTinker
Автор

Once again I referred back to your videos. This time to reinstall the docker MQTT, and implement the fix from your latest mqtt video, Yesterday.

I strongly suppose membership of this Channel in order to support Bearded Tinker, and Secure that the videos keep coming.

perrose
Автор

I get an error. I have dowloaded the config file by typing wget {link}. The file is downloaded, but in the portainer i get following error:


, 2020-08-02T08:40:17.554493710Z 1596357617: Error found at
, 2020-08-02T08:40:17.553898853Z 1596357617: Error: Unknown configuration variable "<!DOCTYPE".

How can i solve this?

andrep
Автор

I installed HA according to your videos, but I don't see same tabs under Developper Tools menu section. I see only STATES, SERVICES, TEMPLATES and EVENTS. I don't see LOGS, MQTT and INFO tabs. Probably it is because in your video you have old version and in my version 0.117.5 logs and server info have been moved under Configuration menu section. But MQTT tab I cannot find anywhere. What is inside that tab?

ИльяПопов-тн
Автор

you saved my life. Kinda. THANK YOU bearded russian dude :)

AlienSKP
Автор

Hello BeardedTinker, is there any chance to publish updated version of this video with working mqtt username/password configuration options? I'm aware of you video about community version, but it's very old/insecure/outdated version without possibilities of new mqtt security features.

ivanmazan
Автор

Thanks for this tutorial.
When I restarted HA, i got the following error in log
"ERROR (MainThread) Failed to connect to MQTT server due to exception: [Errno 111] Connection refused

What would be the reason and solution?

TamimHajar
Автор

Dear BeardedTinker; there are some differences between what you type and what is on the description. When you do the folder mapping you should type mqtt/config, mqtt/log and mqtt/data instead of /mosquitto/config, /mosquitto/log and /mosquitto/data like in the video. Thank's for your hard work. You helped me a lot!

arex
Автор

in your previous video (#002), there is no "check config" button in Server Control page, how do you enable this ? (as your HA is HA core and not hass.io)

tanhongwai
Автор

Please update in your description to say the following :


sudo docker run --name="mqtt" --restart=always --net=host -tid -p 1883:1883 -p 9001:9001 -v -v -v eclipse-mosquitto

percywbell
Автор

I am getting this error in Portainer Error: Unable to open config file Any ideas, thanks for your work!

markdunlop
Автор

Thanks for the tutorials. When I map the config folders in docker I keep getting the error "unable to open config file" and there are no files appearing in data and log. Tried serveral 'solutions' like sudo chown -R 100:101 /volume1/docker/mqtt to change permissions but cannot get it to work. Any thoughts?

Virrr
Автор

@ BeardedTinker I was about to use eclipse-mosquitto with my java project any help related to this is appreciated please!

kotivellanki
Автор

We need a new video which allows us to install MQTT using docker (This is one is not working anymore) I did manage to install and have it run, with lots of problems first. Also hoping to expose config and password for MQTT too. I hope you will create a new one soon. Again your video is still one of the easiest to follow...

krdesigns
Автор

hey, thanks for the tutorial. I have sent accidently some retained flagged messages which I want to delete now. So how can I use things like
sudo systemctl stop mosquitto.service
?
I want to delete unwanted retained mqtt messages like in this example:
I don't know how to do that inside docker :(

tromtrom
Автор

First of all, thanks for the great tutorials. I was able to setup MQTT with home assistant and it works fine. However, the MQTT entities don't update their current state after home assistant restart, they always show up as off after restart.

rachidamine
Автор

Hey,
I follow your videos with great interest, I find very complete with codes, very nice especially for people like me who write without knowledge of codes.
I only have a problem with the 4th video, I tried to install it in both ways but I always get the same error
1580740301: Error: Unable to open config file
I have no idea what to do now
thanks

peternooij
join shbcf.ru