Turns on a real unit, group or a pseudo.
turn on “name of the unit”
turnon is OK too.
- in (integer: seconds) If specified an event is created to apply your new settings after this number of seconds.
- at (date) Instead of the in param you may specify a specific date at which to create the event.
- for (integer: seconds) returns the unit to it’s current state this many seconds after any in or at event has run.
- until (date) similar to for but pass the specific date at which you wish the unit to return to it’s current state
- rate (number: seconds) The number of seconds you wish the transition to take. You may specify a fractional seconds value such as 0.2 or 7.5. Not all devices support a rate param.
- with no script Stops the on or off script from running.
- with no transmit Updates the database but doesn't actually send the command.
Additional optional params are available for color capable devices:
- rgb color (text:html color “RRGGBB“) accepts a string the same as an html color definition but without the “#” at the front. “FF0000” would be full red, “00FF00” would be full green and “0000FF” would be full blue.
- color temperature (integer) The Mired color temperature you wish the bulb to display. The range of available values is dependent on the individual device but would be in the range of 2000 to 50000 with 2700 being a warm white, 3500 being a “bright” or halogen white and 5000 to 6000 being a “daylight” color. Not all devices can display a color temperature.
- color preset (integer: 1-8) go to a color preset by index that you have already saved for the unit in XTension.
- hue/saturation (numbers) An alternative way to specify the color for a device. You must specify both the hue and saturation params to use this. The value is taken from the current brightness level of the device.
- xvalue/yvalue (numbers) Another alternative way to specify the color for a device. You must specify both the xvalue and yvalue the z value or brightness is taken from the current brightness level of the device.
--just turn on the lamp right now turnon "Kitchen Overhead"
--create a scheduled event that will turn on the light immediately and then return it to it’s current state, which may or may not be Off, in 30 minutes. turnon "Kitchen Overhead" for (30 * minutes)
--to guarantee that a light turns back off after a specific time you need to verify the current state. The “for” switch -- returns a light to the state it was at when the command is executed. If the light can be turned on or off by other scripts or -- people use 2 commands to specifically generate the command you want. turnon “Kitchen Overhead” turnoff “Kitchen Overhead” in 30 * minutes
--create a scheduled event to turn on the light in 90 seconds --and another event in 20 minutes and 90 seconds that will return it to it’s current state. turnon "Kitchen Overhead" in 90 for (20 * minutes)
-- turn on the light at 8pm and off at 10pm that day -- note that the until switch is the same as the for switch above. The light will -- return to it’s current state which is not necessarily off. turnon “outside light” at date (“8:00pm”) until date (“10:00pm”)
-- turnon a hue lamp to bright green turnon “my hue bulb” rgb color “00FF00”
-- turnon a hue bulb moving to a color temperature saved as a preset turnon “my hue bulb” color preset 2
-- set the mired color temperature for a hue bulb to a warm white turnon “my hue bulb” color temperature 2700
-- do a short alert for a color capable device turnon “my color device” rgb color “FF0000” for 2
The behavior of the turn on command is dependent on the dimmable type setting of the unit.
- Simple a Simple unit assumes that when it is turned on that it goes to full on. A simple device when sent an on will go to 100%
- Simulated a Simulated device includes the last dim level as known by XTension. This is translated internally to a dim or set value command and will include the last dim level as well as the last color or color temperature the unit was at. This is the default for most modern device types such as ZWave and ZigBee.
- Smart a Smart device is assumed to be handling it’s own preset levels locally. XTension will send a simple On command and let the device decide what to do but will set it’s database level to the last known value. This is a special use case for “smart” X10 modules and may not apply in any sensible way to more modern devices.
The command will do nothing if the unit is Blocked.
When using the “for” or “until” parameters note that the current state of the lamp is saved as the return value. If the lamp is already on then the event that is created will be to return the lamp to on, not to turn it off. If you wish the light to turn on for a specific amount of time while not knowing the current state of the lamp use a separate specific turn off command for the off ie:
turn on “myLamp” turn off “myLamp” at date (“11:00pm”)
For more info on making a motion controlled lamp or for extending the time that a light is kept on based on motion or other input please see Motion Controlled Light