Floorplan Script Functions

From XAP Automation
Revision as of 18:39, 2 March 2007 by Lehane (Talk | contribs)

Jump to: navigation, search

Available functions:




SetGlobal(Globalname, NewData) As Boolean

GetDBGlobal(Globalname) As Variant

GetDBGlobal returns a Variant, as you can have an array of DBGlobals. Most users are frequently only going to use a single item (the zero'th) as in this case.
if GetDBGlobal("HouseEmpty")(0) then
....some code
end if

The DBGlobal being used here is storing Boolean.

SetDBGlobal(Globalname, NewData, Overwrite As Boolean) As Boolean

The following will set the HouseEmpty global variable to TRUE, overwriting an existing value.
	SetDBGlobal "HouseEmpty", TRUE, TRUE


GetState(xAPName) As String

This returns the state of the device which can be referenced by the xAP full source string.
Or by the xAP Floorplan friendly name
y=GetState("Heating GO")

GetLevel(xAPName) As String

GetLevelMax(xAPName) As String

GetDisplayText(xAPName) As String

GetText(xAPName) As String

GetLastUpdate(xAPName) As Date

GetLastChange(xAPName) As Date

GetValue(xAPName) As String

GetDisplayValue(xAPName) As String

SetDisplayValue(xAPName, NewValue) As Boolean

SetDisplayText(xAPName, NewValue) As Boolean

Use this to change the displayed text on the map. For example to change the colour of the display which in this example is a Temperature

SetDisplayText ScriptExtras, DisplayString

Note the use of ScriptExtras which holds the xAPName of the device calling the script. This allows a single script or function to be used by many similar devices.

SetDisplayTooltip(xAPName, NewValue) As Boolean


SendxAP(xBody, xClass, Optional xTarget)

SendxPL(xBody, xClass, Optional xTarget)

SendBSCState(xTarget, NewState)

SendBSCLevel(xTarget, NewLevel)

SendBSCText(xTarget, NewText)

SendBSC(xTarget, NewState, NewLevel, NewText)


AddTimer(TimerName As String, TimerTime As Date, Script As String, Optional RawCode) As Boolean

DeleteTimer(TimerName As String) As Boolean

EditTimer(TimerName As String, TimerTime As Date, Script As String, Optional RawCode) As Boolean

CheckTimer(TimerName As String) As Variant



GetFromRaw(RawMessage, ItemToFind)


DawnTime() As String

DuskTime() As String

IsDay() As Boolean

IsNight() As Boolean



RunSQL(SQL) As Variant




GetRoomOccupancy(RoomName) As Boolean

SetRoomMode(RoomName, RoomMode As Integer) As Boolean

SetRoomOccupancy(RoomName) As Boolean

Custom Page specific

GetLastEvents() As Variant

TitleStripGreen(xTitle, xURL)

TitleStripBlue(xTitle, xURL)