Floorplan Scripts2

From XAP Automation
Jump to: navigation, search

Raw Devices and Floorplan displays

This example is linked to a "raw device". A raw device is one which xAPFloorplan doesn't automagically control so there needs (usually) for there to be some scripting which will make use of the values.

As with all things Floorplan, the AutoScripts can do some operations but usually for complex operations VBScript is needed. In this case the script is linked to the xAP_Weather raw device. To create the Raw Device, select the 'Raw' tab in the config setup. Click on the add new and fill in the Alias and the Source. In this example EGVP is the weather station being used - put in here the details for your setup. Weatherreport.jpg From the Scripts Update/Change drop down boxes (Note: You have to create the script before you can select it) link to the script

What the script does is get the current temperature and the time of the report using the xap.getfromraw function. It then checks the total time offset from UTC and calculates how old the report is. If it is a little over two hours old (140 minutes) then it changes what Floorplan displays to "Stale Report" using the SetDisplayValue function. Otherwise it displays the current value.

The values are stored in a GlobalVariable for use in other scripts, notably heating control.

Note also that the display values use the tag to change the colour of the text displayed.

The script is WeatherInfo.txt