Page 1 of 1

How can I use a MQTT payload as a trigger?

PostPosted: Mon Jul 06, 2020 2:08 pm
by ppespepe
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 2614 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 2614 times


But not sure how the matching options work.

Thanks!!!

PP

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

PostPosted: Mon Jul 06, 2020 4:28 pm
by FlyingDiver
Match on the exact topic that you're publishing. THEN set a condition on the trigger for the "last_payload" to match your value.

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

PostPosted: Mon Jul 06, 2020 7:05 pm
by ppespepe
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

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

PostPosted: Mon Jul 06, 2020 7:11 pm
by FlyingDiver
"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.

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

PostPosted: Mon Jul 06, 2020 7:17 pm
by ppespepe
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 2575 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 2575 times


Again thanks!!! :)

PP

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

PostPosted: Mon Jul 06, 2020 7:25 pm
by FlyingDiver
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:

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

PostPosted: Mon Jul 06, 2020 7:56 pm
by ppespepe
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