Use Voice Assistant Commands to Control your Lightform Device

You can control your Lightform device with other IoT devices. In this tutorial, we'll be using solutions that allow you to use Voice Assistant Commands to trigger OSC values to control playback and trigger effects in real-time. 

 

Note

This requires a bit of coding! But don't worry-- We've provided some sample code to help you get started.

Requirements:

Minimum requirements to use Lightform as defined here
IoT device with an IFFT service - e.g Amazon Alexa or Google Assistant 
Pushbullet Account - We use the API to send notifications
IFTT Account - to trigger pushbullet notifications from voice commands
SendOSC - Simple command-line tool for sending OSC commands

Sample code:

SendOSC.py Send OSC messages to your device
translations.csv

Define your commands and their OSC translations in CSV format. Commands must be in uppercase.

push2OSC.sh Master program to pull notification, transform the note content into OSC commands and send those commands to your Lightform devices

Step 1Add relevant IFFT services

Log in to your IFTT account and add the services for:

  1. your voice-controlled device i.e Amazon Alexa or Google Home
  2. your Pushbullet account

Screen_Shot_2019-08-08_at_3.02.15_PM.png 

Step 2 Create the IFFT Trigger

In the example below, we will create a Pushbullet note whenever we say "Google Next Effect" 

  1.  Under your profile picture in IFTT, select the Create option

    Screen_Shot_2019-08-14_at_7.54.05_AM.png

  2. Click on +This and search for Google Assistant (or Amazon Alexa)

    Screen_Shot_2019-08-14_at_7.56.48_AM.png

  3. Choose a trigger: "Say a Simple Phrase" Screen_Shot_2019-08-14_at_8.51.42_AM.png
  4. Type in your trigger phrase e.g "Next Effect", all the other fields are optional.

Screen_Shot_2019-08-14_at_8.52.45_AM.png

  • Click on "That" to choose your action service and search/select Pushbullet  Screen_Shot_2019-08-14_at_9.27.04_AM.png
  • Choose Action: "Push a note" 

    Screen_Shot_2019-08-14_at_11.01.33_AM.png
  • Type in the content of your message. This message will later be translated into an OSC command, so keep it short and unique to each action you want to trigger.

    Screen_Shot_2019-08-14_at_11.08.17_AM.png

Step 3 Pull notifications and send OSC messages

In this step, you will need to edit the sample code to retrieve the notes from your Pushbulet account and translate them into OSC messages.

      1. Get your access token from your PushBulltet account under Settings > Account > Access Tokens > Create Access Token and Paste it into the cURL command after Access-Token: in the push2OSC.sh file
      2. Change IP Address and Port to your Lightform device's IP Address

        To make sure that the OSC message is sent to your Lightform device, you need to configure the right IP address and port in the sendOSC.py file

        myCmd = 'sendosc 192.168.1.79 8000 '+ argv1]

        Reminder: You can locate the IP address of your Lightform device in the Control Page in Lightform Creator.

        ip.png

      3. Update the translations CSV file to translate your command into an OSC command supported by Lightform.
        NEXT,/playback/next 
        Reminder: You can see the list of OSC mappings for your device Under Control > Edit OSC Mappings.

        Screen_Shot_2019-08-14_at_3.25.33_PM.png

      4. Run the Push2OSC file and send voice commands to your Google Assistant - e.g "Google Next Effect" - or Amazon Alexa.

Conclusion

This tutorial just scratches the surface of how you can control your Lightform device with your IOT device using IFTT and OSC. We'll be adding more examples of this (e.g., change scene depending on wether...). If you have feedback or suggestions, please feel free to suggest them in the comments!

Attached Files

Was this article helpful?
1 out of 1 found this helpful

Make a suggestion to improve this article