Developer Support

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
kanetik
Posts: 6
Joined: 17 Sep 2014 01:48

Developer Support

Post by kanetik » 17 Sep 2014 02:37

Hello!

I develop plugins for Locale and Tasker, and just discovered Automagic - it looks intriguing, I'll be checking it out more in-depth soon!

I have a question for the dev(s) of Automagic - for the variable support, are you using Tasker's API? In other words, should I expect that variables that work for Tasker will work for Automagic as well?

And another question - I use Google Analytics to understand general trends for my apps, like that X percent of users of each app are on Tasker, Y percent on Locale. I've been able to determine that pretty easily because only Tasker supports Tasker's API (or so I thought). Is there a way I can know, from within my plugin, that the host app in Automagic, not Tasker?

Thanks!

User avatar
Martin
Posts: 4444
Joined: 09 Nov 2012 14:23

Re: Developer Support

Post by Martin » 17 Sep 2014 16:26

Hi,

Out of curiosity, what kind of plugins do you write?

Automagic uses the API specification originally written by Locale and supports the extensions provided by Tasker. Variable support should work the same in general, except that variables in Automagic work a little bit different when passed from Automagic to the plugin. The variables in Automagic are enclosed in curly braces like this: Variable "a" contains value {a} where a is the name of a local variable. This should not be of much concern to the plugin since the variable is replaced before the extras are passed to the plugin.
You can also return variables back to Automagic using the same mechanism that Tasker defined in the plugin protocol extension. Automagic removes the leading % of a variable name if there should be one and validates that the rest of the name is a valid variable name for Automagic. Variables that are not valid are ignored (I think that most variable names should work that also work in Tasker).

You could probably check the calling activty when the edit-activity of your plugin is started. I think there's no easy way to determine the caller when the plugin is executed with the broadcast.

Regards,
Martin

kanetik
Posts: 6
Joined: 17 Sep 2014 01:48

Re: Developer Support

Post by kanetik » 18 Sep 2014 00:02

I have various plugins, and it seems that you have linked to one or two from your app - I've seen a jump in sales in the past week or 2, so thank you for that! You can see my plugins at https://play.google.com/store/apps/developer?id=Kanetik

I'll be installing your app on my phone shortly - first I need to get an update for Bluetooth Detection out, but I like the idea behind it, if I'm understanding it correctly from the screenshots.

Thanks!
J

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Developer Support

Post by kintrupf » 18 Sep 2014 09:53

kanetik wrote:I'll be installing your app on my phone shortly - first I need to get an update for Bluetooth Detection out, but I like the idea behind it, if I'm understanding it correctly from the screenshots.
"Bluetooth Detection" sounds interesting. I installed your plugin and made a flow with it as trigger and configured your plugin ("Within range", "Any device").
As I understand it the plugin should fire the trigger when a bluetooth device comes within range. That is, if I switch on my Bluetooth headset (without connecting) the trigger should fire, right?

kanetik
Posts: 6
Joined: 17 Sep 2014 01:48

Re: Developer Support

Post by kanetik » 18 Sep 2014 12:26

It should, but with a couple caveats, I should point out: it polls BT every couple minutes to check if anything of interest is nearby, so that has 2 side-effects.

First, it means BT comes on every few minutes for a few seconds, even if you normally have it disabled. A future update (date not yet determined) will have a settings screen which will allow you to disable that, so that it only recognizes nearby devices when you have enabled BT.

Second, it means that devices won't be detected immediately, but within a couple of minutes of being nearby (assuming the BT device itself is on, of course!)

Please let me know if you have any questions, or find that something doesn't seem to be working right - "nearby" functionality is the newest piece of functionality, and so I expect I will have to do some tweaking to make it as good as it can be!

sambarlick
Posts: 96
Joined: 27 Jul 2014 10:40

Re: Developer Support

Post by sambarlick » 19 Sep 2014 13:55

Hi kanetik,

How well does your plugin Bluetooth Detection work with BLE devices?

I downloaded your trial and automagic detects it as a plugin and also detects the tasker supplied variable, and as Martin stated, with the automagic modification.

The plugin doesn't seem to detect my BLE device with any of the states...Within Range, Connected and not connected (although not sure what the difference is between not connected and within range), and with any device type.

The automagic triggers and conditions for bluetooth detect my device.

I am not sure if it's a compatibility issue with your plugin and automagic or your plugin and my device.

What do you think?

Thanks Sam

kanetik
Posts: 6
Joined: 17 Sep 2014 01:48

Re: Developer Support

Post by kanetik » 21 Sep 2014 00:48

To be completely honest, I don't know if it works with BLE devices. I have focused on regular BT devices, mostly because I don't own and BLE devices. I can't say that it DOESN'T work with BLE, just that I haven't tested it on any yet.

The difference between connected and nearby, BTW, is that nearby detects literally if you are near a device (any device, certain class of BT device, or specific device) whether you are connected to it or not. If you aren't worried about one specific device, but are ok with leaving it as a "class" or "any" selection, you don't even need to be paired with the device. Connected, on the other hand, doesn't detect until you are actually connected, which, obviously, means you must also be paired.

So, it's possible that the plug-in isn't fully compatible with Automagic, but more likely, my plug-in isn't working well with BLE devices at the moment. I hope to have my hands on a BLE device soon, so I can ensure compatibility with those as well.

sambarlick
Posts: 96
Joined: 27 Jul 2014 10:40

Re: Developer Support

Post by sambarlick » 21 Sep 2014 05:27

Thanks for your Response.

I havent tested if your plugin works with normal BT devices, but i agree with you, that it is more likely the plugin and my BLE device than the plugin and automagic.

Thanks, Sam

kelemenlajos
Posts: 2
Joined: 07 Oct 2014 13:30

Re: Developer Support

Post by kelemenlajos » 08 Oct 2014 06:01

Kanetik, i tried your plugin, but it doesn't finds my Yeelight Blue. I think your plugin only looks for pairable devices (it finds my tv, mw600, notebook, gear fit and gear fit asfaik gear fit uses BLE), but not the unpairable ones like my Yeelight. If you have some time to spare, can your look into the yeelight blue sdk what can be different?
http://www.yeelight.com/en_US/info/download

Martin, is it possible to send messages from automagic to a bluetooth device to specific address (called UUID-s in the yeelight blue bluetooth API doceument)? I think with a low level integration like this, any BLE device would be supportable. After creating a device specific flow inside automagic (like a driver), anyone could use them to access any BLE device. (I would be glad to create a flow like this for the Yeelight Blue, for proof of concept.)

Post Reply