Control Your Home with a Stream Deck

Control Your Home with a Stream Deck

So following on from a previous post showing you how to utilise an Elgato Stream Deck in your home automation, I’ve recently been alerted to a new Stream Deck integration which has simplified everything.

In the past, I’ve showed you various ways of integrating the Stream Deck. We covered websocket calls connecting via Node-red, as well as http requests connecting to tasmota devices directly. Well I’ve found a new way. Using the plugin streamdeck-homeassistant we’re able to configure everything simply and easily. Not only can we use the buttons to fire events in Home-Assistant, but we can also use the buttons themselves to display various sensor readings. For example, temperature, battery levels, exchange rates. If you can measure it, you can display it!

This won’t take long at all, so let’s get started.

Installation

Obviously, you’re going to need a Stream Deck! You can pick up one here from Amazon (affiliate link, it will cost you nothing, but may help to support the blog if you purchase from here).

First ensure you running the latest version of the Elgato Stream Deck software. At the time of writing, I’m on 5.1.4.14753.

Streamdeck software
Streamdeck software

Next go and download the latest release of streamdeck-homeassistant from here, I’m using release 1.5.3.

Once downloaded, double click the file and install it. It should populate your streamdeck with a familiar looking icon!

Streamdeck Plugins
Streamdeck Plugins

Drag an ‘entity’ button on to the main pad to configure. Configuration is very easy. Firstly, you need to enter your Home-Assistant url. The app gives you an example, but i’ll put it here for ease.

ws://your.ha.ip.address:8123/api/websocket

Next scroll down to the Access-Token. Here we need to go into our Home-Assistant install and create a long-lived token. To do this, click on your user icon at the bottom of the sidebar in Home-Assistant. Then scroll down until you get to the “Long-Lived Access Tokens”

Long-Lived Token Creation
Long-Lived Token Creation

Create a token and copy it. Make sure you copy it correctly you’ll only get it displayed once. (Don’t worry if you mess it up, you can delete the token and re-create a new one as you need). Paste it into the Stream Deck configuration.

Entering your token
Entering your token

Hit Save and (re)connect.

Now if all has gone well, if you scroll down further you should be greeted with a familiar set of entity settings.
Domain, entity, service etc. Note that the options will change according to the entity you’re trying to configure, but rest assured you’ll have the full complement of options that you would normally have in any Home-Assistant service call.

Working Examples

In my office, I have a smart plug connected to a lamp. The smart plug is a blitzwolf SHP5 with independently controlled USB outlets. It’s been flashed with Tasmota, you can read about it here. It’s unimaginatively called “office” !

Domain = switch
Entity = office
Service = toggle
(save entity config).

Next, I have a SwitchBot that I am using to manually control a video light that I use as a higher end Streamlight. You can read about how I set that up here. The SwitchBot entity can be found either under the domain switch or homeassistant.

Domain = homeassistant
Entity = streamlight
Service = turn_on
(save entity config)

Note here that “toggle” didn’t work. Depending on how you have your SwitchBot configured, you can either have it as a momentary press (as I have here) or as an On/Off configuration. For the momentary press, you just need turn_on (it acts as a toggle anyway). Obviously, if you’re using turn on and turn off, then you’ll need to set that up accordingly in the services.

Now let’s look at the sensors. I’m a huge fan of the Xiaomi Aqara zigbee sensors. So much so I’ve written several posts on them, including a two year review here. In order to grab the bedroom temperature, I set up the following:

Domain = sensor
Entity = long…string_temperature
There’s no “Service” to configure here as it’s incoming sensor data.

And finally, let’s have a look at Bitcoin!

Domain = homeassistant
Entity = btc_exchange_rate
You’ll need this sensor set up in Home-Assistant if you’re looking to pull it in here. I go via the coinbase integration which you can configure here.

Streamdeck Layout
Streamdeck Layout

For those of you that prefer to work with everything in Node-red, as of now there are two ways to do this. Firstly you can continue using the websocket method I wrote about here or the other way is to use the entity node in the Home-Assistant palette for Node-red. You can essentially create a dummy switch, and expose it to HA which in turn will be picked up immediately by the Stream Deck. Just be sure to click the ‘output on state change’ button in the node.

The Entity Node in Node-red
The Entity Node in Node-red
The Entity Node in Node-red
The Entity Node in Node-red

For those of you looking to learn more, including animated icons then have a look here. It was this channel that initially alerted me to the plugin. There are lots of other interesting videos there, so I suggest you give them a follow (I’m unrelated).

Summary

So I’ve been playing with this new setup for a few days already, and it hasn’t skipped a beat yet. It’s extremely responsive and I love the fact it can display sensors as needed. When streaming, I use a mix of lighting, so having the ability to create a nested action where with one button I can effectively turn on my Elgato Keylight Air, as well as my home made (SwitchBot) Video light and launch OBS Studio, Restream etc, is really handy. The only issue I have with my Stream Deck, is that I only have 15 buttons!

 

If you have any good ideas for your Stream Deck, let me know in the commnents, or if you have anything cool that you’re working on, think about joining our facebook group to share your inspiration.

https://www.facebook.com/groups/386238285944105

If you’re considering a renovation and looking at the structured wiring side of things, or maybe you just want to support the blog, have a look below at my smarthome book, it’s available in all the usual places (including paperback)!

 

Considering a Renovation? Maybe this will save you money!
Considering a Renovation? Maybe this will save you money!

Leave a Reply