Announcement

Collapse
No announcement yet.

Event triggered by MQTT topic

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

  • Event triggered by MQTT topic

    I have setup and event to trigger on MQTT topic; however, it never triggers
    I have tried restarting the plugin, but still doesn't work. this a bug or something i'm missing in setup?

    using v 4.1.2.2

    Thanks!

  • #2
    Please provide some details. If you show your specific event then I can try to replicate.

    Comment


    • #3
      Click image for larger version  Name:	Annotation 2019-08-22 081332.png Views:	0 Size:	23.8 KB ID:	1322195
      nothing happens [edit] when i send a topic "iot/tasmota/testtopic" to the mqtt broker. Works fine via NodeRed so the topic/subscription for other programs is working fine.

      Comment


      • #4
        I setup the following event

        Click image for larger version

Name:	Capture.PNG
Views:	34
Size:	11.8 KB
ID:	1322240

        Stimulated with a test message of this topic and my test utility showed both the trigger topic and action topic

        8:40:37 AM iot/tasmota/testtopic Payload=Something
        8:40:37 AM iot/tasmota/testtopic/action Payload=triggered

        I looked in the debug file that was created in \data\mcsMQTT\mcsMQTTDebug.txt because General tab has debug checkbox checked. In it I can see the trace of receiving the topic "ActOnMessageForTrigger", the event trigger fired "TriggerFire", and the action was taken "Handle Action".

        8/22/2019 8:40:37 AM 305202 | ActoOnMessageForTrigger Topic iot/tasmota/testtopic,Payload=Something
        8/22/2019 8:40:37 AM 305207 | Triggered1=True
        8/22/2019 8:40:37 AM 305216 | TriggerFire iot/tasmota/testtopic=Something, EventID=12
        8/22/2019 8:40:37 AM 305218 | ReceiveTriggerTrigFromInfo ID=3795, Topic=iot/tasmota/testtopic, Payload=
        8/22/2019 8:40:37 AM 305245 | ReceiveTriggerGeteTrig ID=3795, Topic=iot/tasmota/testtopic, Payload=
        8/22/2019 8:40:37 AM 305264 | HSEvent LOG| 2| 8/22/2019 8:40:37 AM| Event| Event Trigger "New Group MQTTtrigger"| | 0| | 0| 8/22/2019 8:40:37 AM
        8/22/2019 8:40:37 AM 305276 | Handle Action Entry
        8/22/2019 8:40:37 AM 305280 | Handle Action TANumber 1
        8/22/2019 8:40:59 AM 327850 | Handle Action Topic iot/tasmota/testtopic/action

        You can follow the same process, but I suspect the issue is with your action and not with the MQTT trigger. In your case you will see a similar trigger sequence in the debug but the Handle action sequence will not be yours because this was a mcsMQTT action and your action is for something else to handle.

        I was testing with 4.1.4.0, but I am not aware of anything related to triggers that has changed. You can get this version by extracting HSPI_MCSMQTT.exe from http://mcsSprinklers.com/mcsMQTT_4_1_4_0.zip.

        Comment


        • #5
          Thanks, i'll try upgrading and perhaps reboot the entire system, as there is definitely something strange going on with my system. The Log doesn't show the Event trigger at all, so has nothing to do with my action. If that doesn't work, I'll check the MQTT server to see what topics mcsMQTT has subscribed to.

          Comment


          • #6
            On General tab, inbound management, you have ability to subscribe to all messages or only messages that have been associated with devices. You may want to look at this setting to assure you have not restricted your subscriptions.

            Comment


            • #7
              Originally posted by Michael McSharry View Post
              On General tab, inbound management, you have ability to subscribe to all messages or only messages that have been associated with devices. You may want to look at this setting to assure you have not restricted your subscriptions.
              I have it set to "Listen for Only Associated Messages" isn't that the correct setting? its a very busy MQTT, I don't really want to bog down the system with unnecessary messages.

              Comment


              • #8
                It could easily be the correct setting for you, but it means that the broker only sends the associated messages so those which are event triggers and not associated will not be sent by broker.

                It is likely you will associate the topic and then hide the HS device if you prefer. It could also be the case that the event trigger becomes the device is updated rather than a MQTT topic is received.

                Comment


                • #9
                  I had not thought about it before, but I could likely include all the MQTT event triggers in the subscription list.

                  Comment


                  • #10
                    I made the update so MQTT event trigger topics are included in the list of subscriptions. It is at http://mcsSprinklers.com/mcsMQTT_4_1_5_0.zip. This should give you what you have been expecting.

                    Comment


                    • #11
                      Fantastic! Thanks so much...will update soon as i have some time!

                      Comment

                      Working...
                      X