I wrote a series of scripts to make a Switchboard for dynamically choosing which camera feed refreshing images are rotated in which control page (as I use separate pages for each room), and I am trying to figure out where to start making it a plugin.
Use case:
Jane is in kitchen, and wants to select the front door and back yard to rotate every 10 seconds.
Jack is in the office, monitoring two sleeping children, but he wants to see the backyard too.
It works, but it’s pretty Rube Goldberg.
-I use Indigo Variables for user-entered parameters for clients (e.g. the respective Control Pages for different rooms, “Clients”) and “Sources” (cameras). The Indigo Variables are of the schema addClient, addSource, addSourceToClient, delSourceFromClient
-Whenever a Client or Source is added (via an Action Group that runs a script), an Action Group script generates Indigo Variables for each potential connection (e.g. SOURCE_CLIENT: “backyard_den”, “baby_iphone”). These add up fast. The Indigo Variables Store booleans for whether Client is using Source as one of it’s sources that are rotated in a refreshing image.
-The plugin “Group Event Listener” monitors the Indigo Variables and tracks if a value changes. If there is a change, an Action Group script modifies the main data source (in json, also in an Indigo Variable) that determines who is subscribed to whom.
-A schedule that runs every 10 sec calls an Action Group that cycles through each Source for each Client.
So... I use Variables, Action Groups, Triggers, and a Schedule. I think this is begging to be done in a plug-in, but I’m not sure which sample plugin is a good start, ESPECIALLY for monitoring for changes. Below are some snapshots to give you an idea of the final implementation.
Sent from my iPhone using Tapatalk