Announcement

Collapse
No announcement yet.

newb to mcsMQTT

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

    newb to mcsMQTT

    I have quite a few Arduinos (nodeMCU wifi) running a custom sketch using the Arduino plugin to communicate with HS3. Works well but it is non-standard. I've been seeing MQTT getting a lot of traction with IOT devices. A good example is running Tasmota on the nodeMCU. Looks a lot easier than what I had to do to get a variety of sensor support. I want to explore whether I should make the move or not.

    I just installed the mcsMQTT plugin ver 1.5.0.0, mosquitto broker, MQTTlens plugin for Chrome so I can test. All local on same machine running Win 10 Home . Generally it seems to be working. In Lens I can publish and subscribe. In HS3 I can see the new value reflected in the topic device.
    In looking thru the quite extensive documentation that Michael has provided, I see references to things that I am not able to locate. Examples are the 'Association Tab' and the 'Statistics Tab'. Actually I see no tabs. The only thing I see are four options on the plugins/mqtt dropdown menu. Config, Subscriptions, Publish, and Control.

    But I can't seem to figure out how to use an event to publish or to use a MQTT message as a trigger. In the event editor, I see no MQTT triggers. In actions I can see where I can 'Publish device value' but there are no MQTT devices in the device list.

    I'm fearful I have either missed something on the install or I'm missing something obvious in the UI.

    Any help would be appreciated.

    Robert

    #2
    But I can't seem to figure out how to use an event to publish or to use a MQTT message as a trigger. In the event editor, I see no MQTT triggers. In actions I can see where I can 'Publish device value' but there are no MQTT devices in the device list.

    First accept the mosquitto device. Once accepted then you insert the Mosquitto command to trigger. Once this is done the Homeseer created variable will show the options.

    Here is an example of my kitchen LED lamps using a Sonoff SV with an ESP easy firmware added with Mosquitto on it.

    Click image for larger version  Name:	ttrigger.jpg Views:	1 Size:	39.9 KB ID:	1254123
    The KitchenLEDs/Relay/0/set is the trigger command which I put in looking at the console on the device in use. The ESPurna and Tasmota console are similiar.

    [627041] [MQTT] Sending KitchenLEDs/data => {"relay/0":"0","time":"2018-10-19 14:18:12","mac":"","host":"Sonoff-SV","ip":"","id":40107} (PID 1770)
    [627061] [MQTT] Publish ACK for PID 1770
    [627944] [RELAY] Saving mask: 0
    [628149] [WEBSOCKET] Requested action: relay
    [628152] [RELAY] #0 scheduled ON in 0 ms
    [628157] [RELAY] #0 set to ON

    Toggling the variable turns the LED lamps on or off.

    If I click on the reference number #2320 then I get more granular details and mechanisms to change the variable.

    Here is what the HS3 variable looks like. Note it is just a toggle button there. The slider only turns on and off the LED. No dimming with this device.

    Click image for larger version  Name:	Vvariable.jpg Views:	1 Size:	11.5 KB ID:	1254124

    My first tinkering was duplicating devices that Michael made and showed examples of in his documentation which used the Sonoff devices.

    The Sonoff devices already include all of the pieces you need. You just need to solder on some wires and modify the board for low voltage use.

    The above utilize Sonoff SV was purchased as a bare bones board and I installed it in a small case for use.

    xxx
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      Pete,

      Must be me being dense again. Where do I accept the mosquitto device? In the doc I can see where there is a checkbox on the Associations Tab but I can't find an Associations Tab.

      Robert

      Comment


        #4
        mcsMQTT plugin ver 1.5.0.0
        mcsMQTT is at version 3.4.11.0. You are likely running a different MQTT plugin.

        Comment


          #5
          Michael,


          Well I surely meant to install your plugin, but..... on well. No wonder your doc looked much more robust than what I was seeing.

          Just installed yours and it says ver 3.4.11.0.

          Thanks a bunch.

          Comment


            #6
            I see TABS!!!!!!!!!!!

            Comment


              #7
              Much better! I see the triggers and actions in events and I see the tabs. Working fine with MQTTlens and mosquitto.

              In testing an event, I learned that if your trigger is for a received message, in your action, don't publish to the same topic. Loop time

              Comment


                #8
                If you want to do this then take a look at Echo setting on General Tab. It may (or may not) allow what you are trying to do. I think it only applies for the wraparound and not from an externally sourced duplicate topic.

                Comment


                  #9
                  Nah, no particular use case. I was just trying to get something to work via events. It worked too well.

                  So all is well with mcsMQTT plugin, MQTTlens and mosquitto. I've made further progress by getting Tasmota to load on a generic nodeMCU which is my prefered arduino (gotta have wifi). I had to add some libraries to my Arduino IDE and then load the base sonoff sketch but then it compiled and loaded. I had previously modified the user_config.h file so it came online to my wifi network and I was able to access it via IP. Went in to configure MQTT user/passwd and indicated the topic to use. The console shows it trying to connect to the MQTT broker but it gets a rc of -2. Keeps trying every 10 secs. I'm running mosquitto in verbose mode in cmd.

                  Any ideas of what might be wrong with connecting?

                  Comment


                    #10
                    THe MQTT spec indicates that a return code of 2 means "Connection refused, identifier rejected"
                    Tasmota MQTT setup has provisions for ClientID. This may be the identifier that Mosquitto is complaining about.

                    Comment


                      #11
                      Lately here playing with Home Assistant. It'll run on anything these days.

                      There is a plugin to monitor all of the Tasmota devices (and upgrading them). I have it running in Docker. Still getting a handle on using it.

                      - Pete

                      Auto mator
                      Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                      Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                      HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                      HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                      HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                      X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                      Comment

                      Working...
                      X