Scripting: Introduction to Adding Automation to Telecom Sites
Scripting for the SiteBoss is a very powerful way to add features into the unit that are specific for a particular situation. It is being used more and more to add that one more thing that is needed to make a Siteboss just the right solution for a particular problem. Because scripting is so versatile, it is not limited to a specific industry or vertical market. It can be used in nearly every situation to make a SiteBoss just that much better. In this post, we’ll define what scripting is and show a few examples of how it is used today around the world. We will also cover some of the best practices we have found for using scripts. Later blog posts will look at a greater level of detail.
What is Scripting?
Scripting has various definitions around the net; one definition that fits well is “a script is a program or sequence of instructions that is interpreted or carried out by another program.” Scripting would then be the action of creating a script. Script is from the old french escript from Latin scriptum neuter past participle (used as a noun) of scribere ‘write’.
With Asentria products, scripting is the ability to write small or large programs that are added to the built-in programs on the Siteboss to do specific additional functions needed such as interfacing with other devices, keeping logs of certain values, complex alarm conditioning, building specific web pages for certain functions or many other functions.
Asentria uses an easy to learn language called Lua. “Lua” is from the Portuguese word for “Moon”. It was developed in Brazil and can be learned by anyone who can do basic programming.
Why is Scripting Important?
Scripting opens up a whole world of functionality on the SiteBoss that allows it to do things that could never have been planned for. Similar to how apps took the iPhone to a whole new level of functionality, scripting does the same for the SiteBoss. The SiteBoss is doing things now that had only been wished for before or not even thought of. This means that now the SiteBoss can do even more than it could without scripting. If you have a specific problem that you haven’t been able to solve, the SiteBoss with scripting might be just the right tool to do what you need.
Scripting at Telecom Sites
Scripting is often used to interface to other devices, and generators are one of the most common devices integrated into the SiteBoss. Many generators have a serial interface for providing data on the status of the generator such, as Generac, MTU, and Onan generators. Scripting provides a way to interrogate the generator and provide its status over the network. Important pieces of data such a fuel level, RPM, coolant level, oil pressure can all be provided through these tools. One interest side point to working with generators is that scripts are now being used to control when generators run. Many off-grid sites have two generator and scripts on the SiteBoss will switch which one runs so they both are getting used. They can also be used to decide when to start and stop generators.
Scripting can be used for building log files of particular pieces of data. Some of the most common data points being logged are temperature, generator RPM, fuel level, and power usage. These points can all be used to find areas where power usage can be optimized, thereby reducing the cost of using the system or used to predict when fuel tanks will need to be refilled.
Scripting can also be for complex alarming. For example, having the power go out might be an informational type of alarm at sites where there are back up generators, but having the power go out and having a generator failure alarm is a critical alarm because it means the site is going to go down shortly. Scripting easily creates the ability to create a critical alarm when both these conditions exist.
Asentria and Lua Scripting
Asentria provides a library of more than 60 calls for working with the SiteBoss. These calls can do things like connect to other devices, provide the current status of a sensor, open and close relays, or write records to log files so the user can track what is happening.
Scripts can be edited using almost any text editors available. There are even two basic text editors provided on the SiteBoss, including a web-based editor and a common Linux command-line editor. It is recommended that complex editing be done on a PC using a common text editor.
Scripting is a type of code writing. The language used is very easy and can be learned by any programmer with even a basic programming understanding in almost any common programming language. Asentria has documents with more details on the specifics of writing scripts that are available upon request that go into the basics of programming in Lua. There are also external documents available at lua.org.
There is a lot to learn about scripting, and this article is designed to give you a basic idea of what can be done with scripting. The options are basically unlimited. If you have a specific question about whether scripting can be used to tackle a specific problem you have, please contact us and we’d be happy to discuss it with you.