Overview
The Philips Hue integration provides a set of ready-made functions you can call when building mappings. They handle common conversions for Philips Hue, such as building a flashing or custom alert light state and converting a color from RGB or hex into the XY coordinates Hue uses, so you don't have to write that logic yourself.
Where you can use these functions
These functions are available anywhere you write a formula for the Philips Hue integration:
Dynamic Formula mappings: where a destination field's value is produced by a formula rather than mapped directly from a source field.
Mapping collection filters: where a formula decides whether a record should be processed.
Error filters: a mapping collection's error filter, which sits alongside its collection filter. When the error filter's formula resolves to true, the transfer raises an error that is held in the Error Logs for review and is not retried automatically.
Translation collections: where a translation entry uses a formula as its source value.
How to use them
Call a function by name and pass the values it needs in parentheses, for example:
RGB(255, 0, 0).Each function's signature shows its name, the parameters it accepts (with their types), and the type of value it returns. Use it as the reference for exactly how to call the function.
Function names and formula syntax are case-sensitive, so type each name exactly as shown. Whether the values a function matches are treated as case-sensitive varies by function, and is called out in the relevant parameter's description.
These functions are synchronous, so you call them directly (no
awaitis required).Some functions provide more than one form (overloads): the same function name with different parameter combinations. Pick the form whose inputs you have; each function's Signatures list shows the available forms.
Each function runs at sync time, against the data in your connected Philips Hue account and your iPaaS.com subscription.
The functions are grouped below by the area of the integration they support.
Flashing Alerts
Use these to build the light state that a Philips Hue light should show as an alert.
Flash
What it does: Builds a Philips Hue light state that flashes at full brightness for a short duration.
Signature: LightState Flash()
How to call it: Flash()
Parameters: none.
Returns: LightState. A light state set to flash at full brightness.
Example: Flash() returns a flashing light state.
When to use it: When mapping a light to a plain flashing alert.
FlashRed
What it does: Builds a Philips Hue light state that flashes red.
Signature: LightState FlashRed()
How to call it: FlashRed()
Parameters: none.
Returns: LightState. A light state set to flash red.
Example: FlashRed() returns a red flashing light state.
When to use it: When mapping a light to a red flashing alert.
FlashGreen
What it does: Builds a Philips Hue light state that flashes green.
Signature: LightState FlashGreen()
How to call it: FlashGreen()
Parameters: none.
Returns: LightState. A light state set to flash green.
Example: FlashGreen() returns a green flashing light state.
When to use it: When mapping a light to a green flashing alert.
FlashBlue
What it does: Builds a Philips Hue light state that flashes blue.
Signature: LightState FlashBlue()
How to call it: FlashBlue()
Parameters: none.
Returns: LightState. A light state set to flash blue.
Example: FlashBlue() returns a blue flashing light state.
When to use it: When mapping a light to a blue flashing alert.
Alert
What it does: Builds a custom Philips Hue alert light state. The short form sets the brightness and duration; the full form also sets the color (as XY coordinates), saturation, and effect.
Signatures (pick the form with the inputs you need): - LightState Alert(int? brightness, int delayOffSeconds) - LightState Alert(int brightness, List<Double> xy, int saturation, string effect, int delayOffSeconds)
How to call it: Alert(brightness, delayOffSeconds)
Parameter | Type | Required | Default | Description |
brightness |
| Yes | N/A | The brightness value for the light. |
delayOffSeconds |
| Yes | N/A | How long, in seconds, before the light turns off. This is capped at 10 seconds. |
xy |
| No | N/A | The color as XY coordinates (use |
saturation |
| No | N/A | The color saturation. Part of the full form only. |
effect |
| No | N/A | The effect name, for example |
Returns: LightState. An alert light state set from the supplied values.
Example: Alert(230, 10) returns an alert light state at brightness 230 that turns off after 10 seconds.
When to use it: When mapping a light to a custom alert, optionally with a color and effect.
Color Conversion
Use these to convert a color into the XY coordinates Philips Hue uses (for example to pass to Alert).
RGB
What it does: Converts an RGB color to the XY color coordinates Philips Hue uses.
Signature: List<Double> RGB(float R, float G, float B)
How to call it: RGB(R, G, B)
Parameter | Type | Required | Default | Description |
R |
| Yes | N/A | The red component of the color. |
G |
| Yes | N/A | The green component of the color. |
B |
| Yes | N/A | The blue component of the color. |
Returns: List<Double>. The color as XY coordinates.
Example: RGB(255, 0, 0) returns the XY coordinates for red.
When to use it: When mapping a color to a Philips Hue light and you have RGB values (for example to pass to Alert).
Hex
What it does: Converts a hex color string to the XY color coordinates Philips Hue uses.
Signature: List<Double> Hex(string hexString)
How to call it: Hex(hexString)
Parameter | Type | Required | Default | Description |
hexString |
| Yes | N/A | The color as a hex string (for example |
Returns: List<Double>. The color as XY coordinates.
Example: Hex("#ff0000") returns the XY coordinates for red.
When to use it: When mapping a color to a Philips Hue light and you have a hex color (for example to pass to Alert).
