I have 2 published cloud functions running on my Photon - On() and Off(). I would like to install this firmware on 20 photons. Does an iOS app exist that would allow me to configure 2 buttons on the same screen - one for On() and one for Off() so that it calls all 20 Photon’s On() and Off() functions respectively? I tried the IFTTT DO app, but it only allows you to setup a “recipe” with one button on the screen which can only call one function on one photon. I don’t what to reinvent the wheel with a custom iOS app. Does an app already exist that could be configured to do this?
Instead of function calls, have the Do app publish a SSE to which all devices are subscribed? That should allow you to trigger them all at once.
If you can host a simple HTML page somewhere, this should be relatively easy to create as a webpage. Platform-independent, and since you don’t really require native device functionalities, it should suffice.
Thanks Jordy - would you be able to direct me to some complete HTML examples that I could play with that would publish an SSE and have my Photon’s react?
I don’t think there’s a complete example out there yet. But here’s an example of the relevant JS code, should you use the JS library: https://github.com/spark/sparkjs/blob/master/examples/node/publish-event.js With a bit of additional HTML/JS, you should be able to add some buttons to send pretty much anything you’d like. Private events are not yet implemented in the JS library, but an issue has been opened for that, so that should be added somewhere in the future.