Hi there. This is a really simple one from me, but useful all the same, particularly if you’re a gamer!
I own an Elgato Stream Deck and I love it. I stream when playing computer games and it’s perfect for switching scenes, muting, changing music tracks etc. I don’t need to continue, there are plenty of reviews online. Where it really steps up for me is the ability for me to add Home-Assistant control to it. This not only allows me to assign a hard button to switching something on or off, but it enables me to mix the physical control of lighting with application control. For instance I have assigned a macro on my streamdeck that loads up OBS studio, opens the chat window (restream.io – I only have one monitor), opens Steam, stops playing music on my system (so as to not get a DCMA takedown) and now turns on my streamlights so I’m ready to go. I literally choose the game, hit stream and we’re online!
You could go one step further. If you’re into RGB lighting, you could also have it send commands to change to a certain colour when you hit the ‘scene’ transition button. If you have any of Elgato’s stream lights, you will find that these are already controllable via the Stream Deck. You could easily include external lighting now too. I’m sure I’m only scratching the surface here with this.
Now on to the set up side. It’s dead easy. I have a variety of tuya based smart plugs that I have reflashed to Tasmota (currently running 8.4.0 as I write). Will this work with ESPhome or one of the other other open firmwares? I’m not sure, but I don’t see why not. As long as they are open to HTTP control it should be fine. Someone else can verify that though.
For example here is one i use to toggle on and off a light in my office.
That is it. It’s all you need. This simple one liner allows me to toggle my tasmotized (is that even a verb?) Blitzwolf SHP5 on and off and control the light connected to it.
I chose the blitzwolf SHP5 because not only is it good for a simple wifi enabled power plug but it also has 2 USB ports that can can be controlled independently of the main power socket. To be clear USB1 and USB2 are either both on or both off, but it’s still cool to have additional control over them. You can read more about how I put these into Home-Assistant and set them up correctly to have the independent power control here. If you’re interested in getting some yourself, you can find them here (affiliate link).
If you’re interested to learn more about what you can do on the code side, see the full list of tasmota commands here:
So I’ve showed you the quick way how to control Tasmota devices directly. There’s also an additional way to be able to control Node-red entities and by extension home-assistant entities using a custom stream deck add-on and websockets.
Open up your streamdeck software and install the add-on Websocket Proxy.
Once installed you then need to configure a button to speak to the proxy. I configured a button using this code:
Then go to node-red and drag out an Websocket-in Node and configure the listening point. Be sure to make them the same (note in node-red it kept adding /endpoint/ to the string, so to make it match, i just added that in the streamdeck):
Add a debug node and then press the button on the streamdeck to see if it’s connected. If everything’s working as it should you should get a large amount of text in the debug and a little green connected icon in the UI.
So far so good? Next step is to convert the debut text into JSON, which we can do using the JSON parser node. I then choose to put the output directly into a switch. Now for the streamdeck, you have two essential events. keyDown and keyUP. These are basically button press and release, so in order to capture these accordingly, I use the switch and configure it accordingly from the output of the json parser.
So at this point, it’s just a matter of now configuring what you want to do on the button press and / or the button release. I chose to turn on a lamp that I have set up in Home-assistant via a service call.
At this point, when i press the button on the stream deck (keyDown) the light turns on. When I release the button on the streamdeck (keyUp) the light turns off. I’m sure there are ways to go from node-red back to the streamdeck, but I haven’t played with that yet, but it would help fit in with my gaming flow. If you’re interested in learning more about the project and the plugin author’s website, you can visit the github page here.
Hopefully for those of you who own a Stream Deck you will find this useful. If you don’t and would consider picking one up, you can find one here on amazon (affiliate link):
Drop a comment below if you manage to come up with some cool idea or flow that incorporates this. I am sure someone far brighter than me will be able to adapt this to trigger more things within the Home-Assistant universe. I’d love to know more! If any of you are gamers, hit me up on Discord or Twitch!
Feel free to check out some of my most recent blog posts here.