MQTT / Shims setup

Posted on
Tue May 31, 2022 3:35 am
c64 offline
User avatar
Posts: 53
Joined: Oct 28, 2012
Location: Germany

MQTT / Shims setup

Sorry! I've looked at all of the examples and I'm still stumped. I'm trying to get indigo to subscribe to an MQTT event.

Screen Shot 2022-05-31 at 11.17.56 AM.png
Here's what I am trying subscribe to
Screen Shot 2022-05-31 at 11.17.56 AM.png (47.76 KiB) Viewed 2617 times


Screenshot 2022-05-31 at 10.50.28 AM.jpg
Here's my subscription
Screenshot 2022-05-31 at 10.50.28 AM.jpg (148.92 KiB) Viewed 2617 times


Screenshot 2022-05-31 at 10.48.59 AM.jpg
Here is my Trigger - I suspect this is wrong as nothing happens in the Indigo logs with this. If I have it set to "Any Message Received" I start seeing triggers in the logs.
Screenshot 2022-05-31 at 10.48.59 AM.jpg (188.82 KiB) Viewed 2617 times


Screenshot 2022-05-31 at 10.50.56 AM.jpg
Here's my Device which is not working
Screenshot 2022-05-31 at 10.50.56 AM.jpg (249.13 KiB) Viewed 2617 times


Any clues very much appreciated. Thank you!

Posted on
Tue May 31, 2022 6:00 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

I recreated your setup based on the screenshots above, and it worked for me. Set both the Connector and Shims plugins to debug logging and try your test again. Your log should look like this:

Code: Select all
   MQTT Connector Debug            Cloud MQTT Broker: processReceivedMessage: mqtt/variables/setCoolingThresholdTemperature, payload: 24.5
   Trigger                         test trigger
   MQTT Shims Debug                message_handler: MQTT message ##HKtest## from Cloud MQTT Broker
   MQTT Shims Debug                HKtest: processMessages: '##HKtest##' mqtt/variables/setCoolingThresholdTemperature -> 24.5
   MQTT Shims Debug                HKtest: Raw payload = 24.5
   MQTT Shims Debug                HKtest: states_key=
   MQTT Shims Debug                HKtest: Updating state to 24.5
   MQTT Shims Debug                HKtest: processMessages: '##HKtest##' mqtt/variables/setCoolingThresholdTemperature -> 24.5
   MQTT Shims Debug                HKtest: Raw payload = 24.5
   MQTT Shims Debug                HKtest: states_key=
   MQTT Shims Debug                HKtest: Updating state to 24.5
   MQTT Shims Debug                HKtest: processMessages: '##HKtest##' mqtt/variables/setCoolingThresholdTemperature -> 24.5
   MQTT Shims Debug                HKtest: Raw payload = 24.5
   MQTT Shims Debug                HKtest: states_key=
   MQTT Shims Debug                HKtest: Updating state to 24.5


What do you get?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 6:42 am
c64 offline
User avatar
Posts: 53
Joined: Oct 28, 2012
Location: Germany

Re: MQTT / Shims setup

Hey thank you for doing that test. I'm not getting anything from the Shims debugging. I'm still on Indigo 7.3, Shims v0.5.6

Code: Select all
   MQTT Connector Debug            MQTT Plugin: processReceivedMessage: mqtt/variables/setCoolingThresholdTemperature, payload: 23.5
   MQTT Connector Debug            MQTT Plugin: processReceivedMessage: mqtt/variables/setTargetTemperature, payload: 22
   MQTT Connector Debug            MQTT Plugin: processReceivedMessage: mqtt/variables/setHeatingThresholdTemperature, payload: 20.5

Posted on
Tue May 31, 2022 7:23 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

Looks like the trigger is not firing. Make sure it's not disabled. If that's not the issue, then delete it and recreate it.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 12:31 pm
c64 offline
User avatar
Posts: 53
Joined: Oct 28, 2012
Location: Germany

Re: MQTT / Shims setup

This is baffling. I've tried deleting and rebuilding the Trigger. (yes it is Enabled). I've rebooted the machine. Still no joy with the Trigger firing. I'm curious - if I manually force the Trigger with the "Execute Actions Only" button, should the Shims Device update? Currently it doesn't.

Additionally, if I set the Trigger to "Any Message received", that triggers in the log.
Also, as a test if I delete all the rules to try and just match the wildcard (attached), it still doesn't fire.

Screen Shot 2022-05-31 at 8.38.14 PM.png
Screen Shot 2022-05-31 at 8.38.14 PM.png (429.8 KiB) Viewed 2580 times

Posted on
Tue May 31, 2022 12:57 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

Try setting the Broker to "Any", What MQTT Broker are you using?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 1:00 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

Hmm. It's also possible that there's a bug in that version of Shims. I know I fixed at least one string matching bug in the Indigo 2022.X version. But I don't think it was in the Topic Match code. It was in the UniqueID matching code.

Make sure there's no leading or trailing spaces in the match strings.

This is baffling. I've tried deleting and rebuilding the Trigger. (yes it is Enabled). I've rebooted the machine. Still no joy with the Trigger firing. I'm curious - if I manually force the Trigger with the "Execute Actions Only" button, should the Shims Device update? Currently it doesn't.


No, that won't work. Manually activating the trigger doesn't have a current message to queue.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 1:09 pm
c64 offline
User avatar
Posts: 53
Joined: Oct 28, 2012
Location: Germany

Re: MQTT / Shims setup

I'm using the MQTT Broker plugin available in Scrypted (https://github.com/koush/scrypted), simply because I'm already using Scrypted for camera feeds, and it was so easy to add the Broker. I believe it uses the Aedes MQTT Broker. I tried switching to "Any" - still no joy.

Posted on
Tue May 31, 2022 1:19 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

Yeah, that was a wild guess. The Connector is seeing the messages, so it's almost certainly not a broker issue.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 1:22 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

Do this - Use the Shims plugin menu command "Write Device Template to log" and select the Shim device you already created, that has the message-type that matches the trigger that's not working. Post what it write to the log.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 1:26 pm
c64 offline
User avatar
Posts: 53
Joined: Oct 28, 2012
Location: Germany

Re: MQTT / Shims setup

Code: Select all
 MQTT Shims                     
message_type: '##HKtest##'
props:
    SupportsSensorValue: true
    shimSensorPrecision: '2'
    shimSensorSubtype: Temperature-C
    state_location: payload
    state_location_payload_type: raw
    state_location_topic_field: '0'
    uid_location: topic
    uid_location_topic_field: '2'
trigger:
    match_list: '["Match: mqtt", "Match: variables", "Any: "]'
    queueMessage: true
type: shimValueSensor

Posted on
Tue May 31, 2022 1:36 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

Well, that trigger definition looks correct.

I'm running out of suggestions. Is there some reason you can't upgrade to the current Indigo and plugins?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 1:58 pm
c64 offline
User avatar
Posts: 53
Joined: Oct 28, 2012
Location: Germany

Re: MQTT / Shims setup

Really appreciate your support, thank you. I haven't updated as I have quite a few Applescripts that have been working ok, my Python skills suck, and I've been afraid of breaking everything!

Posted on
Tue May 31, 2022 2:04 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT / Shims setup

Last suggestion (for now). Try creating a new Indigo database with JUST the MQTT devices in it and see if the problem persists. If it does, send me the database. joe@ <handle>.com

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 2:31 pm
c64 offline
User avatar
Posts: 53
Joined: Oct 28, 2012
Location: Germany

Re: MQTT / Shims setup

Ahh! Tried a new database - that worked. Went back to old database, deleted all the mqtt & shims Devices & Triggers. Started again, and all works as expected now. Thanks so much for helping me though that (and for building such a valuable plugin!)

Who is online

Users browsing this forum: No registered users and 5 guests