How can I use a MQTT payload as a trigger?

Posted on
Mon Jul 06, 2020 2:08 pm
ppespepe offline
Posts: 21
Joined: May 27, 2020

How can I use a MQTT payload as a trigger?

Hello people!

Hope you are all safe and sound!

Quick question if I may: I'm trying to create a rule being triggered by a payload of 1 or 0 on a topic.

I try this:

Screen Shot 2020-07-06 at 15.05.01.png
Screen Shot 2020-07-06 at 15.05.01.png (273.96 KiB) Viewed 228 times


To no avail... what is the correct format to match a payload being received in a particular topic?

Because publishing, that I can do doing this:

Screen Shot 2020-07-06 at 15.06.49.png
Screen Shot 2020-07-06 at 15.06.49.png (264.42 KiB) Viewed 228 times


But not sure how the matching options work.

Thanks!!!

PP

Posted on
Mon Jul 06, 2020 4:28 pm
FlyingDiver offline
User avatar
Posts: 4307
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: How can I use a MQTT payload as a trigger?

Match on the exact topic that you're publishing. THEN set a condition on the trigger for the "last_payload" to match your value.

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

Posted on
Mon Jul 06, 2020 7:05 pm
ppespepe offline
Posts: 21
Joined: May 27, 2020

Re: How can I use a MQTT payload as a trigger?

I'm really sorry for such a basic question :D

I guess the "last_payload" thing is a python script because I just can't find it anywhere else...

Is asking for an example too much?

I think it would obviously include something of the sort of if last_payload = 1 or 0 or whatever but of course that won't work alone... I was searching the forum for examples but apparently I'm worst at searching than I'm at programming :P

Thanks!

PP

Posted on
Mon Jul 06, 2020 7:11 pm
FlyingDiver offline
User avatar
Posts: 4307
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: How can I use a MQTT payload as a trigger?

"last_payload" is a state of the connector device. It should be showing up in the conditions list for that device. I think. But it's not, and I'm not sure what's the issue. Let me look into this.

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

Posted on
Mon Jul 06, 2020 7:17 pm
ppespepe offline
Posts: 21
Joined: May 27, 2020

Re: How can I use a MQTT payload as a trigger?

Thank you so much for your kind help!

I guess you mean it was supposed to appear here right?

Screen Shot 2020-07-06 at 20.14.35.png
Screen Shot 2020-07-06 at 20.14.35.png (378.96 KiB) Viewed 189 times


Screen Shot 2020-07-06 at 20.16.12.png
Screen Shot 2020-07-06 at 20.16.12.png (254.76 KiB) Viewed 189 times


Again thanks!!! :)

PP

Posted on
Mon Jul 06, 2020 7:25 pm
FlyingDiver offline
User avatar
Posts: 4307
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: How can I use a MQTT payload as a trigger?

Fixed in 0.4.7: https://github.com/FlyingDiver/Indigo-M ... /tag/0.4.7

I'll update the store asap.

Here's what you should see:
Attachments
Screen Shot 2020-07-06 at 9.20.40 PM.png
Screen Shot 2020-07-06 at 9.20.40 PM.png (244.2 KiB) Viewed 183 times

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

Posted on
Mon Jul 06, 2020 7:56 pm
ppespepe offline
Posts: 21
Joined: May 27, 2020

Re: How can I use a MQTT payload as a trigger?

I didn't realized I was talking with the developer of the plugin!

Thanks for the help and thanks for sharing!

Yep, I updated the plugin and it worked beautifully!!!

Warm regards,

PP

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests