Run Your own LOCAL MQTT broker to control your IoT devices in Home Assistant

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ย. 2024

ความคิดเห็น • 104

  • @timffoster
    @timffoster 8 หลายเดือนก่อน +2

    SUBSCRIBED!!!
    This video is exactly what I needed. (and I especially appreciated that it was no-nonsense, yet chock full of solid explanations, clear speech, large screens and the whole 9 yards)

  • @Qosmio1955
    @Qosmio1955 4 หลายเดือนก่อน +1

    I started from scratch, installing docker in a Proxmox LXC and then portainer. I then installed mosquitto s per the description in the vid. I couldn't get past the point where I have to get into the container's console. Turns out that the latest release of docker won't play nice with the current release of portainer and no containers within portainer (including the portainer container itself) have working console access. I'm to old and too impatient to try and nut this out, so I'm going to have to find another way to run mosquitto in a LXC container....

    • @Qosmio1955
      @Qosmio1955 2 หลายเดือนก่อน

      Turns out the solution was really easy. I just installed a bog-standard Linux installation and installed mosquitto (broker and clients) on that. Nothing else. No Docker container, no Portainer. You just don't need them!

  • @wbtlevi
    @wbtlevi ปีที่แล้ว +1

    Fantastic! Thank you. I was able to move my MQTT from inside Home assistant to my portainer setup.

    • @mostlychris
      @mostlychris  ปีที่แล้ว +1

      Good job! Thanks for watching!

  • @jt_simon
    @jt_simon 9 หลายเดือนก่อน

    Hey @mostlychris, another VIM shortcut: If your cursor is at the top of the file in VIM, you can do "d G" (capital G) and it will delete from where the cursor is all the way to the bottom of the file. Conversely, if you're at the bottom of the file you can do "d gg" (2 lowercase g's) and it will delete from the cursor to the top of the file.

  • @stevecarlisle3323
    @stevecarlisle3323 ปีที่แล้ว

    Chris, thanks for your videos, this one helped me get MQTT up and running, where a few other vids did not, looking forward to learning from
    your other videos.

  • @florianf4818
    @florianf4818 ปีที่แล้ว

    You are my Hero, thank you! The first path, to select Volumes in Portainer was a great idea!

  • @SBinVancouver
    @SBinVancouver ปีที่แล้ว +1

    I'm good with the broker, I'd like more on interacting with device through HA - both acting on state changes in the MQTT topics, and controlling devices through MQTT.

    • @mostlychris
      @mostlychris  ปีที่แล้ว +2

      Noted. I'll add that to my video list.

  • @magnusgreel275
    @magnusgreel275 ปีที่แล้ว

    Your tutorial helped me finally install MQTT and integrate it with Home Assistant :D Subscribed!

  • @shaunwhiteley3544
    @shaunwhiteley3544 2 ปีที่แล้ว

    I have a pi setup with pihole and mqtt with battery backup. Makes it so much better standalone, no issues with rebooting pc's or dockers etc. Every couple of months (cough) when I remember pihole & pi get updated. Also really good if you want a couple of different home assistant builds etc production & test to connect to.Cheers

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      Thanks for the comments.

    • @RailyardProductions
      @RailyardProductions ปีที่แล้ว

      Hi Shaun, Are you running Portainer on that? How is it working out?

    • @shaunwhiteley3544
      @shaunwhiteley3544 ปีที่แล้ว

      @@RailyardProductions I have a main pc running unraid for docker,vm's etc and a separate pi running pihole and Mqtt server, works better for me that way

  • @techdad6135
    @techdad6135 2 ปีที่แล้ว +3

    Hi Chris! Great video! Any chance you could do a video on setting up mqtt to use tls?

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว +1

      Thanks. It's super easy but some devices don't support it. I'll add that to my list.

    • @techdad6135
      @techdad6135 2 ปีที่แล้ว

      @@mostlychris Awesome thank you! I want to eventually connect some sensors remotely (ideally without the use of a VPN) but want to make sure the information is sent securely since I do use a un/pw.

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      If those devices can do TLS, you can do this now by enabling TLS on the broker side. There are also cloud TLS capable mqtt providers that you *might* be able use as in intermediary but I haven't tried that. Hive is one I know of.

  • @camerontgore
    @camerontgore 2 ปีที่แล้ว +3

    Hi and great video! Did you ever do the follow up video to build the mqtt entries?

  • @isosahir
    @isosahir 4 หลายเดือนก่อน

    Awsome video, helped a lot. Thanks man!

  • @eric88798
    @eric88798 ปีที่แล้ว +1

    Thank you, the video helped me a lot, thumbs up.

  • @mineapple8612
    @mineapple8612 ปีที่แล้ว

    tysm for this very straight forward and thorough explainantion!

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      YW. Thanks for watching.

  • @lildarker4044
    @lildarker4044 ปีที่แล้ว

    absolute legend, you made me want to subscribe

  • @awardblvr
    @awardblvr 2 ปีที่แล้ว +1

    Hi Chris... I followed your steps almost exactly and everything works... BUT... You kinda promised to show HOW now to set up steps in Home Assistant to integrate with this LAN-based MQTT broker. I'm not seeing it.. What should I look for? (I can send MQTT topics successfully via HA MQTT interface.. But, now we need to take the next step. THANKS!)

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      You can add the MQTT integration from the integrations page and then specify the IP address of your MQTT server in the configuration. Then it should talk to the MQTT server you installed.

  • @TheBendixSA
    @TheBendixSA 10 หลายเดือนก่อน

    This was brilliant

  • @DanyKhalife
    @DanyKhalife 3 หลายเดือนก่อน

    +9000 to previous comments about clarity. Subscribed as well :)
    are there any special considerations for setting up the broker with only SSL? I used the openssl tag for the image, and am able to connect to the broker using MQTT explorer as well as things like frigate. For some reason though HA doesn't like it and I think I tried every combo of the advanced setting. Thoughts?

  • @wwolfram33
    @wwolfram33 2 ปีที่แล้ว +1

    I would like to see how to create a HA Lovelace button that sends a command to a device. Thanks for the video.

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      Do you have a specific example?

  • @sonoff2253
    @sonoff2253 2 ปีที่แล้ว

    Fantastic video, I expected the integration with Home Assistant at the end. How to activate the mqtt topics in Home Assistant. Can you make another video on this?

  • @scottb721
    @scottb721 2 หลายเดือนก่อน

    I've just done this Portainer process on my Synology NAS. For the MQTT settings in HA do I use my NAS' IP as the broker hostname/IP address ? Thanks

  • @revealingfacts4all
    @revealingfacts4all ปีที่แล้ว

    This tutorial was great! I know this video is about a year old as I watch it and am wondering about something. I have MQTT and Tasmota in home assistant and they both can see my new Tasmota/MQTT light switch. The home assistant forums seem to suggest that MQTT is "hard to maintain" and might be going away. Any truth to this? Which should I focus on to continue my integration journey?

  • @andymok7945
    @andymok7945 2 ปีที่แล้ว +4

    Hi Chris. You have lots of great videos. I am looking at revamping my Home automation setup. Currently running HA in a proxmox VM and will be moving it HA blue device soon. I am also looking at setting up a separate MQTT broker rather then the add-on as I have now. I have so many hobbies and so many projects that keep me quite busy. Is there any reason that I should run MQTT broker in a container rather than in just a VM? Not looking forward at another learning hurdle for portainer/docker stuff if I do not need to at this time. Thanks. Yes I would like to see you make a video in regards what you need to do in HA when using an external MQTT broker as you mentioned in this video.

  • @nigelholland24
    @nigelholland24 2 ปีที่แล้ว +1

    Great video thank you

  • @manologitech
    @manologitech ปีที่แล้ว

    Very helpful, thank You.

  • @kopparsulfat
    @kopparsulfat ปีที่แล้ว

    damn good video. explaines everyting i was looking for. 👌

  • @HobTechTV
    @HobTechTV 2 ปีที่แล้ว +2

    i have followed the video, the 1883 port is running as shown at 12:29, tried to connect with mqtt eplorer but unsuccessfull, could you please help ?

    • @MrDVTO
      @MrDVTO ปีที่แล้ว

      I'm in the same situation. MQTT Explorer is unable to connect to the box running the image. I doubt that it's network configuration for me because the box is also running HA which I'm able to access and is able to see multiple devices.

    • @kodigaraz7062
      @kodigaraz7062 ปีที่แล้ว

      before deploying the container, when choosing a network, you need to select the bridge and not the host, everything worked for me

    • @prattleon
      @prattleon 7 หลายเดือนก่อน

      I'm having the same problem. Switching to bridge i get error "request failed with status code 500"@@kodigaraz7062

  • @MiguelSosa-t3h
    @MiguelSosa-t3h ปีที่แล้ว

    Hi Chris, i want to know if in ignition from inductive automation, i can configure the mqtt server to enable remote connections, great video thank you!

  • @M4biz-g3d
    @M4biz-g3d ปีที่แล้ว

    Hi. Chris. Good video. Anyway I haven't well understood why you've installad Mosquitto on a docker container rather than directly on Home Assistant.

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      Thanks for watching. This is an example of another option for those that want to run it separately. Using the HA installed version is still an option if you want to go that route.

  • @hamadalmarri2141
    @hamadalmarri2141 2 ปีที่แล้ว

    Great video .
    I have one request for future videos , I cannot find any video about flowmeter integrated in Home Assistant , so would you please make a video about that

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      Can you give me an example of a flow meter that you are using?

  • @litsieww
    @litsieww 7 หลายเดือนก่อน

    Hi Chris! It's a great video and learnt a lot. But when I wanted to add a password to my MQTT broker, after keying in my password, docker shell just says "Killed". I had to revert the config file to allow non-password connection. I was also unable to find any good answers searching on the web. Many thanks!

  • @hynekdlouhy8121
    @hynekdlouhy8121 2 หลายเดือนก่อน

    Cant open the console through portainer. "Unable to retrieve image details"

  • @RailyardProductions
    @RailyardProductions ปีที่แล้ว

    This is awesome, one question though. I'm building an app in MIT App Inventor2 and there is an MQTT extension urspahomqttclient. Are you familiar with that? I have been trying to get the MQTT working and having no luck. I searched around and found an app in which they say you have options of connecting using HIVE/emqt or some other cloud brokers. My app only has to run while I'm at home and on my local network. Do you think this could be the solution?

  • @asopok
    @asopok 4 หลายเดือนก่อน

    After installing how can I connect to Zigbee2mqtt to run in Home Assistant?

  • @gundross
    @gundross 11 หลายเดือนก่อน

    Hi, I'm unable to save my config berceuse ESC button does nothing:/ 11:14

  • @antshurdley2914
    @antshurdley2914 ปีที่แล้ว +1

    Hi Chris - love your videos
    I have only had HA a week and am loving it, although I admit it is a bit of a steep learning curve. I have now got MQTT going and have also got an esp32 sending data to it in Json format. I can see the data coming in perfectly. Have you made a video on getting the data into home Automation from MQTT as that is the bit I am now struggling with. Any help with this would be much appreciated. (I have also added File Manager, MQTT Explorer, Studio Code Server, and Terminal) I gather i have to add the sensor info in a yaml file some where... Cheers Ants (New Zealand)

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      Glad you found HA. It's a great platform! Your MQTT devices should show up as entities. Once you have them as entities, you can act on them via automations. If they are not discovered automatically, you would create them as entities in yaml. www.home-assistant.io/integrations/sensor.mqtt/#new_format

  • @NicolaCaldo
    @NicolaCaldo ปีที่แล้ว

    Great video! You have set up the MQTT broker to use the host network but, what if I want to use the bridge network and assign it a static IP which is not the localhost of my host machine?

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      You can adjust your settings to fit your network environment.

  • @MrSupersidewinder
    @MrSupersidewinder 2 ปีที่แล้ว

    Thank you loads, I beat on mosquitto for two days in docker compose, gave up hashed it out and did it your way. My normal docker directory is /opt but portainer built this in /var/lib/docker... Can portainer be pointed to my /opt dir by default, I'm assuming it could see my other running volumes. Also the console won't log on... THANKS AGAIN!!!

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      I'm not sure if portainer can be changed. However, I ran into that same volume issue and had to back out the first time. I would think you could created the mosquitto volumes wherever you wanted them, such as in opt. As an example, I installed Frigate using the docker compose method from the CLI and portainer just picked it up, with all volumes.

  • @TheDoppelPoint
    @TheDoppelPoint ปีที่แล้ว

    where do i get the config file, in your video for my MQTT?

  • @markusr.4628
    @markusr.4628 11 หลายเดือนก่อน

    I messed up the config file. But deleting the container and adding it again won't let me connect to the console. I get the message that I have to wait till the container is running. I still get the same error message in the log as if deleting the container doesn't remove the corrupted config file. Can you help me out?

    • @markusr.4628
      @markusr.4628 11 หลายเดือนก่อน

      Answer to myself: Delete the config volume also, then the mosquitto.config file is gone

  • @bburcuymn
    @bburcuymn 7 หลายเดือนก่อน

    Is there any limit on the number of devices to be connected in fiware 3.7.0? Can we connect as many devices as we want?
    I searched through the documentation and in many sources, but I couldn't find any information on this subject

    • @mostlychris
      @mostlychris  7 หลายเดือนก่อน

      Probably limited to network throughput and processor capability.

    • @bburcuymn
      @bburcuymn 7 หลายเดือนก่อน

      Thanks @@mostlychris

  • @ronnydidit
    @ronnydidit 2 ปีที่แล้ว

    Could you figure out how to install a MQTT broker on a RP pi Pico W and make a tutorial of it? I'm tired of burned SSD cards.
    It should be possible since some guys installed it even on a ESP32.

    • @mostlychris
      @mostlychris  ปีที่แล้ว +1

      I'll look into it. Thanks for the suggestion.

  • @zyghom
    @zyghom 2 ปีที่แล้ว

    and I thought I have many MQTT devices - until you opened your zwave ;-)
    However I am using autodiscovery for all my devices - all sensors, switches etc. are created automatically and Home Assistant sees them automatically - you can use all advantages of HA and 2 way communication between device and HA.
    I tried first manually in yaml file but it was too much of manual work - autodiscovery is the answer to MQTT and Home Assistant

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      Autodiscovery is awesome for sure. Many of the devices that feed into the broker can be autodiscovered by HA if they are supported and the MQTT integration is installed on the HA device.

  • @yourpalfranc
    @yourpalfranc 2 ปีที่แล้ว

    Hi, Chris. Good video! I'm curious about your Zwave/MQTT setup. What's the advantage to running Zwave devices that way? I went with zwaveJS2MQTT when I made the switch away from the original zwave integration recently, but I have the broker turned off as I haven't implemented anything MQTT just yet. I do have a Sonoff S31 that I haven't setup yet, so maybe MQTT is a good way to go for that? Is the zwaveJS2mqtt broker sufficient for running a few simple devices?? Thanks. ~Frank

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว +2

      It really depends on preference. One of the things I can do is have other devices interact with my zwave devices, such as my test raspberry pi. This gives additional flexibility but isn't required if you are doing everything on one machine. You would just disable the mqtt part of zwaveJS2mqtt. I like it also for the interface so I'll use it regardless.

  • @Dvalin21
    @Dvalin21 2 ปีที่แล้ว

    I've been trying to install this, but I keep getting the error that the address is in use. That's what I get from the logs. Any advice?

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      The address or the port? Are you running something else on your server that uses that same port?

  • @Melsrobloxxx
    @Melsrobloxxx ปีที่แล้ว

    Hi Thanks for the videos. May I ask how can I get the ip address of the host? I tried a lot of ip address, all didn't work

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      Which host? The MQTT host? The way I set it up, it is the same IP as the host device.

  • @2fastduck72
    @2fastduck72 2 ปีที่แล้ว

    hi, followed the instructions but after the :wg it stuck and get the message 'mosquitto/config' is a directory :-( Any idea how to fix?

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      You are trying to save a directory rather than a file.

    • @2fastduck72
      @2fastduck72 ปีที่แล้ว

      @@mostlychris hi Chris, thanks for reply! What should I to do there you’re instructions are ok till the :wg

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      @@2fastduck72 Can you point on the min:sec in the video which you are getting stuck?

  • @KennethLavrsen
    @KennethLavrsen 2 ปีที่แล้ว +3

    If you have a Linux box which is not the one that runs Home Assistant I fail to see any advantage of installing Mosquitto in Docker. It is a standard package in major distributions. Raspberry Pi OS, any Ubuntu flavoir, Debian all have it as a standard thing in their repos. It is mainly written in C with only standard dependencies. Docker only complicates the installation, any updating, and configs. In any of the apt based distros simply 'apt install mosquitto'. And the configs needed is simple. And when you do the normal apt update and apt upgrade mosquitto gets updates with security fixes as well. People have gone Docker crazy and forgotten the simple and much more resource friendly way through the good old package management systems. And it is started and stopped as a normal systemd daemon like everything else on a modern Linux box. Docker makes sense for software that depends on a lot of python or nodejs stuff of specific versions. It is overhead and added complexity for nothing for a simple c/c++ program without graphics UI like Mosquitto

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว +1

      Noted. There is a lot of containerization these days. It's an option for those who like to play in that world. Thanks for the thoughts.

  • @omkardumbre3421
    @omkardumbre3421 2 ปีที่แล้ว

    How much client mosquitto broker can handle at a single time by default?

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      I think that is based on the hardware you use. I won't be maxing it out anytime soon with what I have running.

  • @jeffrowe6004
    @jeffrowe6004 4 หลายเดือนก่อน

    sure wish you had showed how to install nano instead of using that POS VI. Btw, your tip about deleting the lines is wrong, you have to put in a number

  • @l0gic23
    @l0gic23 2 ปีที่แล้ว

    Hey you! yeah you! How dare you beat me to the first thumbs up!

  • @George-bb9yi
    @George-bb9yi ปีที่แล้ว

    You lost me at the less command (not hard as I am an utter noob) - it looks like you typed 'mos' but that does not get me into the file. I was able to open the config in vi, but I want to understand what you did.

    • @mostlychris
      @mostlychris  ปีที่แล้ว

      Hey George. What was the timestamp where I did that in the video?

    • @George-bb9yi
      @George-bb9yi ปีที่แล้ว

      @@mostlychris ~9:15...

  • @Tntdruid
    @Tntdruid 2 ปีที่แล้ว

    When i hit deploy i get:
    invalid volume specification: 'mqtt_config:mosquitto/config': invalid mount config for type "volume": invalid mount path: 'mosquitto/config' mount path must be absolute
    I made the volume like you did.

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      What are you running Docker on?

    • @Tntdruid
      @Tntdruid 2 ปีที่แล้ว

      @@mostlychris raspberry pi 4 8 GB ram.

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว

      @@Tntdruid It's hard to tell without seeing your exact config. You should have 3 volumes and three mappings under the container's volumes tab.

    • @Tntdruid
      @Tntdruid 2 ปีที่แล้ว

      @@mostlychris I'm going to reinstall Portainer, looks like I did something wrong.

    • @mostlychris
      @mostlychris  2 ปีที่แล้ว +1

      @@Tntdruid Good luck!

  • @LesterLanders-i1i
    @LesterLanders-i1i 3 วันที่ผ่านมา

    Miller Angela Wilson Patricia Walker Daniel

  • @benwilkinson7849
    @benwilkinson7849 2 ปีที่แล้ว

    one t for mosquito in real life :)

  • @NenadNaukovic
    @NenadNaukovic ปีที่แล้ว

    Hi Chris. Thank you for this video.
    I am running an local MQTT broker and switching from Openhab to Home Assitant. MQTT Broker and HA are separate Docker containers on a Synology NAS (no Supervisor / no Add-Ons). Through the YAML config, I was able to add some sensors values to HA. Through their corresponding state_topic that values are updated within HA which is fine, but I only have the values as entities, and the sensors are not listed as devices.
    So I am looking into MQTT device discovery with Home Assistant and using the devices with their topics.
    Have you every dug into MQTT device discovery/publishing discovery messages or similar topics? Would be interesting to see how you got along with it.
    Adding my request anlong with @froman2461 and @SBinVancouver :) A follow up would be very appreciate.
    Thank you lots!