How to set Studio Lights (and more) with SoundFlow
Inspired by @Nacho_Sotelo 's wonderful tutorial about getting IFTTT Push Notifications via SoundfFlow (How to get push notifications from soundflow using IFTTT), I wanted to mention that you can also use a similar method to control Home Assistant (https://www.home-assistant.io/), and thus virtually most smart home devices, from a local server. Less Latency, more control, don't need internet after set-up, unlimited Webhooks.
- Install Home Assistant - https://www.home-assistant.io/installation/
I would recommend in Docker, or on a Raspi PI etc. - Set up a Scene (Like Bright lights, or Dark lights for Client Playbacks, or anything) - https://www.home-assistant.io/docs/scene/editor/
- Set up an Automation, but use Webhook as a trigger, and the Action is the Scene from step 2.. Copy the Webhook_ID, you'll need this later.
- Create a SoundFlow script with the following code:
sf.net.httpRequest({
url: 'http://homeassistantIP:port/api/webhook/Webhook_ID' ,
method: 'POST',
});
homeassistantIP = IP address of your HomeAssistant Instance, like 192.168.1.60, as a random example.
port = port number, usually 8123
Webhook_ID = the string you copied earlier when setting up your automation
An example might look like this:
sf.net.httpRequest({
url: 'http://192.168.1.60:8123/api/webhook/studio-lights-dark-gDfger5tg45hHf7h' ,
method: 'POST',
});
Execute the SF script, it will POST to Home Assistant which will get triggered and run your automation, which is to activate your scene, or whatever you want I to do (send notification, switch on security cameras etc).
Then you can assign a SF trigger or add it to your Deck.
More about Home Assistant Webhooks: https://www.youtube.com/watch?v=ZXTI286DwYQ&t=127s
(There are more hardware integrations for Home Assistant if you install HACS, for example, Tapo bulbs).