Announcement

Collapse
No announcement yet.

mcsMQTT for Dummies?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    mcsMQTT for Dummies?

    I've recently started incorporating arduino/ESP32 based devices into my HomeSeer environment and can now see the appeal of MQTT. Unfortunately I'm finding it has a steep learning curve and would appreciate some advice on how best to get started so I don't set off with the wrong foundations.
    Presently I have HomeSeer running on an i7 fanless PC running Windows 10. I've various plugins in use including Z-Wave, RFXCom, Harmony, Wemo, etc. The latest addition is the Arduino plugin which I'm using to poll sensors from an ESP32 unit monitoring my hydroponic farm. I've set up a Node-RED server/dashboard running on a Raspberry Pi3 and have also installed Mosquitto MQTT broker on it but not enabled it (yet).

    First question is should I use Mosquitto on the RPi or the broker in the MCSMQTT plugin?

    Secondly, I started working through the 200 pages of the plugin manual (big respect, documentation seems to be going the way of the dodo these days) unfortunately I wasn't able to work out a recommended configuration as a start point. Specifically;
    • Which broker to use as the documentation seems to mention the mcsMQTT broker as almost a fall back
    • Recommended way to secure the environment SSL/username & password, etc. as a start point
    • Recommended workflow with Node-RED. I could see how I could use Node-RED just for use as a dashboard but I could also see how it could work
      • HS => MQTT <= Node-RED <= Arduino sensors
    • Any simple worked examples of getting HS devices outputting MQTT status and how to ingest that in Node-RED
    Any help would be appreciated as I can see how the likes of Tasmota can fit in for some of the devices which I can't natively interface to HomeSeer so MQTT needs to be part of my environment going forwards.

    Dave
    Last edited by Fatlab; September 13, 2020, 06:34 PM. Reason: incorrect capitalisation

    #2
    First question is should I use Mosquitto on the RPi or the broker in the MCSMQTT plugin?
    I use Mosquitto on a RPi that has it and a few other stable applications that never change. Consider the MQTT broker like a DNS or DHCP server. Something you just want to forget about once it is running. From a technical perspective the Retain feature of MQTT does not persist a mcsMQTT (or HomeAssistant) restart. While most do not use Retain, it is one technical distinction between a built-in broker vs. a dedicated one.

    Recommended way to secure the environment SSL/username & password, etc. as a start point
    This becomes a matter of personal paranoia. Using SSL and certificates is going overboard and will just get in your way. Using Broker usernames and passwords is pretty common but the security level provided is circa 2000 if you are concerned about somebody breaching your network and knowing what your temperature sensor is reporting. In my case I have an open MQTT environment.

    Recommended workflow with Node-RED. I could see how I could use Node-RED just for use as a dashboard but I could also see how it could work
    I am not a Noe-RED user, but that is likely because I have other alternatives at the source code level. My impression is that Node-RED should be used as an integration node where you combine information from multiple source and use logic that combines this information for some action or additional routing. Consider it a super HS Event engine. If you are dealing with only HS and Node-Red then it does not make much difference if you use the new HS contribution to Node-Red or you use MQTT. If you have other things, such as Arduino/ESP/Rpi communicating in your HA environment then you will likely find it easier to consolidate on MQTT as your common method of communication.

    Any simple worked examples of getting HS devices outputting MQTT status and how to ingest that in Node-RED
    Since I do not use Node-Red on a regular basis I cannot offer much in this area. There are other members that rely upon Node-Red. I think you will find many example on the web for the HomeAssistant community. It really does make any difference where the MQTT traffic is sourced and sinked. The Node-Red usage is the same

    Any help would be appreciated as I can see how the likes of Tasmota can fit in for some of the devices which I can't natively interface to HomeSeer so MQTT needs to be part of my environment going forwards.
    I think you will be very happy with a HA environment that takes advantage of MQTT protocol. It puts everything on the LAN/WAN so you are not dealing with specific interfaces to get information in and out of HS and other IOT devices. While the MQTT protocol was designed by IBM years before IOT has come in vogue, it really hits the mark on a robust environment where IOT devices may or may not be online 100% of the time. Battery operated device, devices on the fringe of the WiFi range and things that just restart at random intervals are well served with MQTT.

    I do like Tasmota for the ESP microcontrollers. It is clearly well supported, has a large user community, and moving in a positive direction. This is a good place to start with MQTT. I started with the Sonoff Basic R1 which is a WiFi relay. Virtually any ESP8266 can accept the Tasmota firmware and ITEAD made it easy by exposing the pins for easy flashing. Many devices sold today at low price points have Tuya firmware installed. These can be reflashed with Tasmota so you get the benefit of low cost mass market and the engineering prowess of Tasmota on a local LAN.

    I would start with a specific use case and then specific guidance can be easily provided.

    Comment


      #3
      Michael McSharry Thanks for the prompt and comprehensive response. That goes a long way to helping me work out what my environment could look like. You pointed me in the direction of the Tasmota firmware when I was asking about the arduino plugin. I got it up and working on one of the ESP8266 units I had but realised very quickly that I needed to use the ESP32 controllers as they have multiple analogue inputs. You've mentioned in another post that you have a working version of the tasmota firmware for ESP32 units. If I was to outline what I have connected to one could you give a view if the libraries are available yet?

      Comment


        #4
        I worked ESP32 with my BLE trilateration project about a year ago. It was based on the version of Tasmota current at that time. The source is at http://mcsSprinklers.com/BLEScannerSource.zip. The binary should be described in the MQTT manual as other capability should exists beyond my special BLE application. I know I have made updates since then so I an upload again if you want the source that I currently have.

        It is clear that Tasmota is moving in the ESP32 direction with the files that are available in the current distribution. So in time I am certain ESP32 support will be similar to the current ESP8266 support.

        Comment


          #5
          where do i sign up for class........lol

          Comment


            #6
            You are signed up. Stay tuned.

            Comment

            Working...
            X