User Tools

Site Tools


Sidebar

dictionary:unitinformation:incoming

Incoming

Returns true if the ON or OFF script of the unit is being executed in response to a received change in the status of the light, meaning that someone manually or otherwise controlled the switch. If the script is running because a command was executed in an XTension script or via one of the XTension interfaces then the value returned is false because it is not a local control of the switch but an outgoing command.

Usage:

incoming returns boolean

Examples:

in this case added to a 2 way switches ON or OFF script you can tell if the command was generated because someone pressed the switch and take other actions, or if it was triggered via a script and therefore not do the other things.

 if incoming then
    --someone physically turned on the light, turn on other room lights too
    turn on “some other room lights"
 else
    --the light is being turned off by a script or other direct control, don’t do anything else
 end if

Notes:

Valid only in a units ON or OFF script.

The incoming verb returns a boolean. If the unit script is running because of a local change at the device or a received command from the powerline or radio the return will be true.

If the unit scripts are running because the switch was controlled within XTension, from one of it’s web remote controls, another script or a scheduled event the return is false.

In my case I have a 2 way UPB switch in my kitchen. When I control it from the switch I want several other lights in the kitchen to go on and off along with the lights controlled locally at the switch. From within XTension I want to be able to control those lights separately from the others and not always have them linked together.

Availability:

This verb was added in XTension build 928 on 3/14/2016

dictionary/unitinformation/incoming.txt · Last modified: 2017/02/24 13:53 (external edit)