Simple App to call a particle function

Hi,
I created an simple app that exposes a button to call a particle function.

My motivation was to have a quick and simple way to open my garage door.

I published the code as open source and the app is available on Google Play as “Particle Buttons”.

You can create multiple buttons to call your particle functions. More info here.
Looking forward for your feedback :slight_smile:

p.s: if you are interested to have it on iOS, let’s chat (It’s ready to publish as it was written in Xamarin, but Apple charges a significant fee to publish).

2 Likes

As far as the Apple side:

I had the same need (and frustration - from Particle not releasing a generic “remote control” like app, or any Apple watch support back a few years ago), and then moved to SmartThings which was “ok”, but required extra steps. At the time, with a real “force touch”, you could force touch the SmartThings icon and call your shortcuts.

Eventually when Siri Automations (“Shortcuts”) came out, started using that and have not looked back. Mentioning this because for Apple you can create the “app” functionality for free in a matter of minutes with things like full REST/JSON calls and parsing, and automatically control it from an icon/“app” or voice action (very significant).

At this point I have 10+ automations that are all voice driven and they each drive anything from simple pin/toggle actions on Photons, to complicated 50+ step evaluations/decision trees.

Hope this is helpful.

2 Likes

@ventz,
I am very interested in what you have done. Any chance you can share details or point me to resources to replicate what you have done?

1 Like

What do you want to know. Very happy to share more details. Are you interested in knowing the App side or the device side that connects to the Garage door opener ?

@tiagonmas ,
Thank you Tiago, I have briefly looked at your GitHub repository and will dig in later to see what you have done. Looks awesome. Seems you have shared enough and I appreciate your sharing. :wink:
My request for more details was directed at Ventz as I am interested in his Siri integration as well.

1 Like

@Farkologist Here is the “simplest” example within “Shortcuts”
1.) Create a “new”
2.) Give it a name ABC (this becomes the “Hey Siri ABC”) - in this case “Garage” -> this becomes the “Hey Siri Garage” call
3.) Give it the API url (for a function call - use POST)
4.) Give it the Particle Device ID (1st red block)
5.) Give it the Function name (same one you would call from the particle CLI)
6.) Give it Particle API access token as “access_token” in the Request Body param, and make sure it’s “Form” (vs JSON)

You can add parameters to your function the same way. If you are using “GET”, you can do function?key=value (ex: /garage?name=front), or you can post as “POST” params.

More Advanced - get data back, parse it, do something:

  • If you need to retrieve any content, you will most likely want to switch to JSON, you can add a “Get dictionary from” and give it the “Contents of URL” parameter.
  • Along with "Get Value (for json fields) with the json root path from “Dictory”
    (full ex: "Get Value for “data.some.jason.path” in “Dictionary”)
  • You can set a variable with the above
  • You can Speak the value or do math on it (ex: round it down, etc)

Hope this helps.

3 Likes

Congrats on successful project!

There happens to be an existing Particle Photon based open-source garage door controller with free iOS and Android apps. Firmware and mobile apps source can be found here, binaries here. Home grown clones are welcome.

And yeah, you also get IFTTT, Alexa, Google Home, SmartThings, LAN MQTT and more.

[end of the shameless plug] :wink:

@ventz, I love this post! Like many others, I created a garage door opening and door status device and I created an app via Thunkable to allow me to easily control the doors. However, your Shortcuts post makes it even easier by being able to verbally ask for the door to open/close. Thanks!

I now want to create a shortcut so I can ask the status of the doors for those times I leave the house and can’t remember if I closed the door. That will be handy, too.

I this community forum is amazing!

@ctmorrison Awesome - I struggled with the same issues for quite a while, so I am glad people are finding this useful.

I don’t want to hijack @tiagonmas’s thread or Android work, so if others have questions/want examples, I can definitely create an “Apple Particle Automation” thread or something like that.

2 Likes

This might be old news, but on the Android side I use HTTP Request Shortcuts.
It can make GET and POST requests to get/push variables. I like the horizontal scroll tabs to organize different shortcut types.

1 Like

I’d say go for it, many people will be grateful if you do.
Cheers

1 Like

Love it. thanks for sharing.