With this script you can control Philips Hue compatible lights directly from translations. This will require your lights to be connected to a Philips Hue bridge.
Once installed, the script will ask you to pair it with your Philips Hue bridge. Once that is done, your lights will immediately become available to be modified through translations.
If it should ever be necessary, you can unpair the script from your bridge by selecting the “Forget Pairing” option in the script configuration window, and closing it.
This script will add the following actions and parameters:
change_on:
This will change the on state of your light.
Parameters:
Light: Selects the light to modify. This will automatically show the names of your available lights.
State: The state to apply to the light. Options are: “On”, “Off”, and “Toggle”.
change_color:
This will change the colour of your light.
Parameters:
Light: Selects the light to modify.
Hue: The hue of the colour to apply to the light.
Saturation: The saturation of the colour to apply to the light.
Brightness: The brightness of the colour to apply to the light.
Transition Time: The duration of the transition when changing from the previous colour to the next, in seconds.
brightness_from_midi:
This will change the brightness of a light in relation to the MIDI value of the MIDI event that triggered the translation. For example, if the translation was triggered by a Control Change MIDI event, the brightness will be based on the Control Value of that MIDI event.
Parameters:
Light: Selects the light to modify.
This script also allows you to use it as an API for your own scripts. Once installed and paired, you can use the following runscript commands to modify your lights:
Get a map describing the light states of all lights on your bridge:
$lights = (runscript (hubscript 4026 filename) get_lights)
The returned data will be a complex map describing all properties of each light.
Modify the state of a light:
runscript (hubscript 4026 filename) change_light_state id:1,hue:5000,sat:255,bri:255,time:10,on:true
All properties are optional, except for the id of the light.