dc297 / mqttclpro

MQTT Client for android with tasker support
MIT License
97 stars 30 forks source link

Subscribe - trigger Tasker #79

Closed svenove closed 6 months ago

svenove commented 5 years ago

I’ve struggled a bit to get your app to work with Tasker. Might be my inexperience with Android, Tasker and MQTT in general...

I wanted to subscribe to a “tablet/kitchen/command/#”-topic and trigger different profiles based on MQTT-“commands” like “cam”, “nighton”, etc.

I finally solved it by making a variable %MQTTCOMMAND and using a profile “MQTT trigger” which simply triggers on the “command” topic and assigned “vartopic” to %MQTTCOMMAND. Then, I have other profiles that triggers on “var set” for %MQTTCOMMAND.

Is this the correct/easiest way to do it?

I originally thought I could use a different “trigger profile” for each of the commands and just enter like “nighton” as “vartopic”, but that caused all of them to trigger regardless of what command I issued. When I finally understood how it worked, it became clear why that happened...

dc297 commented 5 years ago

Hey, you may take a look at https://youtu.be/9NKtuO9T-pE

It's for an old version of the application but should help you out.

If you still have any questions, please let me know.

One quick comment, you should not have to use % as prefix for variable names and your variable names should be lowercase.

Thanks