Thoughts on a StreamDeck plugin

Posted on
Tue Apr 28, 2020 8:25 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Thoughts on a StreamDeck plugin

I got my StreamDeck today, and have been playing around with it. And looking at the documentation on creating a plugin for the StreamDeck controller software.

I think effective use of this device is going to require two way communication between the Indigo and the StreamDeck controller (software). Which will require an Indigo plugin (written in Python) and an SD plugin, which are written in JavaScript (with HTML UI elements). Plus something like PIL to create the button images on the fly.

I'm looking at home some of the example SD plugins work now.

I need to decide on what protocol I'm going to use to communicate between the two plugins.

I'm thinking of providing SD buttons actions for sending commands to indigo devices, executing Indigo action groups, and setting Indigo variables. In the other direction, some basic device control (brightness level, etc) and setting the image for a button. Probably creating some buttons on the fly as well, but that'll be phase 2 at least.

Suggestions welcome.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Apr 28, 2020 8:40 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Thoughts on a StreamDeck plugin

I'm looking forward to what you are able to come up with!

One thing that has come to mind for a communication method is websockets. That would be good for bi-directional communication and would require only one plugin to be a "server" and the other to be a "client". There is only a single connection to maintain, but it supports bi-directional communication.

You would still need to create your own messaging protocol over the websocket connection, but you could something simple such as sending a JSON object with a key to indicate an action to take or event to respond to and a key for some payload data.

Posted on
Tue Apr 28, 2020 8:43 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Thoughts on a StreamDeck plugin

Yeah, websockets with JSON payloads is where I'm leaning. I'm pretty sure that's what I have to do in the SD plugin to communicate with it's server (the StreamDeck application).

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Apr 29, 2020 12:16 pm
Hap offline
User avatar
Posts: 53
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Thoughts on a StreamDeck plugin

This is a little over my head, but my current implementation is one way using the RESTful API for Indigo Server. Could you not simply pull status the same way directly in the Stream Deck plug-in? It also supports Objective-C and C I believe. In fact, the way I read it was as long as the code was executable, you could use any language you want as long as it can communicate via web sockets back to the Stream Deck API.

At least that's the way I read it. I haven't done code in a VERY long time.

Posted on
Wed Apr 29, 2020 12:20 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Thoughts on a StreamDeck plugin

The RESTful API is very limited, so there would be a lot more functionality if I actually had a plugin on the Indigo side.

Since this is an Indigo-centric solution, I think the best way to approach it is to implement the minimum possible on the StreamDeck side, and put as much of the smarts as possible in Indigo.

But you're right, from what I can tell you can write the SD plugin in anything that can communicate with the SD controller via websockets. I'm going to take a crack at doing it with Javascript, since that's what their "native" language is, and what all the examples are in.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Apr 30, 2020 8:40 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Thoughts on a StreamDeck plugin

Progress.

I now having a minimal working StreamDeck plugin, and a minimal working Indigo plugin. They don't do much of anything, but they do talk to each other. Getting a working websocket server running in an Indigo plugin was more trouble than I thought it would be. Turns out the most capable websocket library is Python 3 only. :(

Goal for this weekend is to have button presses on the StreamDeck trigger events in Indigo. That'll enable actions/actiongroups to do just about anything. The major hurdle to that is figuring out which StreamDeck is sending the events, since I really need to account for multiple StreamDecks. Either multiples on the same computer, or multiple computers each with a StreamDeck.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat May 02, 2020 5:49 pm
Hap offline
User avatar
Posts: 53
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Thoughts on a StreamDeck plugin

FlyingDiver wrote:
Progress.

I now having a minimal working StreamDeck plugin, and a minimal working Indigo plugin. They don't do much of anything, but they do talk to each other. Getting a working websocket server running in an Indigo plugin was more trouble than I thought it would be. Turns out the most capable websocket library is Python 3 only. :(

Goal for this weekend is to have button presses on the StreamDeck trigger events in Indigo. That'll enable actions/actiongroups to do just about anything. The major hurdle to that is figuring out which StreamDeck is sending the events, since I really need to account for multiple StreamDecks. Either multiples on the same computer, or multiple computers each with a StreamDeck.


I have two Stream Decks on my MacPro and 3 on my Gaming PC (readily identifiable keys are boon with complex games), so my StreamDeck -> Indigo is remote. However, if there is anything you need me to test, I'll be happy to.

I'm curious how you're doing this, if you're sending a specific Indigo Command (as setup in the StreamDeck editor), then does it matter which Stream Deck sent it?

Posted on
Sat May 02, 2020 6:11 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Thoughts on a StreamDeck plugin

Hap wrote:
I'm curious how you're doing this, if you're sending a specific Indigo Command (as setup in the StreamDeck editor), then does it matter which Stream Deck sent it?


No, I'm not sending Indigo commands. I'm representing the StreamDeck buttons as devices in Indigo. So (for now) you set up a trigger in Indigo that fires when the device activates. And do anything you want in the trigger.

I have that part working now. A simple button is an on/off sensor in Indigo. When the sensor state changes to True, the button is down. When the button is released, it changes back to False.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat May 02, 2020 6:48 pm
Hap offline
User avatar
Posts: 53
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Thoughts on a StreamDeck plugin

FlyingDiver wrote:
Hap wrote:
I'm curious how you're doing this, if you're sending a specific Indigo Command (as setup in the StreamDeck editor), then does it matter which Stream Deck sent it?


No, I'm not sending Indigo commands. I'm representing the StreamDeck buttons as devices in Indigo. So (for now) you set up a trigger in Indigo that fires when the device activates. And do anything you want in the trigger.

I have that part working now. A simple button is an on/off sensor in Indigo. When the sensor state changes to True, the button is down. When the button is released, it changes back to False.


Hmm, ok. So all you're doing in Stream Deck plugin is setting up a unique device? How large would your device pool be? I mean give the number of profiles/folders/buttons supported by StreamDeck you could have a virtually unlimited set of buttons. I wonder if you could have a trigger in Indigo change the loaded Profile in Stream Deck? Stream Deck does have a built in action for that and it works across Stream Decks.

Posted on
Sat May 02, 2020 7:16 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Thoughts on a StreamDeck plugin

Hap wrote:
Hmm, ok. So all you're doing in Stream Deck plugin is setting up a unique device? How large would your device pool be? I mean give the number of profiles/folders/buttons supported by StreamDeck you could have a virtually unlimited set of buttons. I wonder if you could have a trigger in Indigo change the loaded Profile in Stream Deck? Stream Deck does have a built in action for that and it works across Stream Decks.


That's all I'm doing so far. It's only been a couple days.

Yes, I could create an Indigo action that changes the current profile. But it's by name, and there's no way using the API to get a list of available profiles, so the user would have to enter the profile name manually.

The action I've currently got working is not suitable for many Indigo buttons across multiple profiles/folders. The problem is that there's no good way to identify the different buttons to Indigo. You could set up a couple dozen buttons in different folders, but then there's no way to tell which is which when you go to create the Indigo device for each button. Neither folder names nor button titles are provided to the API. All we get in the API is the coordinates of the button ("0,0" for the top left button, for example) and an opaque context identifier that's unique for each button.

What I've got now is more proof of concept than anything else. But I think it's probably OK for people to play with. I'll probably post an "Alpha" release tomorrow.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 03, 2020 6:10 am
Hap offline
User avatar
Posts: 53
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Thoughts on a StreamDeck plugin

FlyingDiver wrote:
That's all I'm doing so far. It's only been a couple days.


Sorry, I feel like I've implied you should be doing more. I didn't mean it that way. Obviously I'm highly interested in this project so it's in my exuberance to imply something I did not intend. Apologies if I can across that way.

Posted on
Sun May 10, 2020 3:05 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Thoughts on a StreamDeck plugin


joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron