Unable to find libraries in LUA script

I have written a simple script to obtain the cpu temperature and send a message if it’s above 60deg.

local temp = sys.get_cpu_temp()
if temp then
send_message()

I receive the Error ‘nil’ on the first line. I have also tried fbos.get… but don’t know where to look for documentation on what libraries and functions are available out of the box.

Any help on this script and where to find relevant docs is appreciated.

Thanks
Stuart

Hi @stuartturner
FBOS LUA is sandboxed to occlude sys from Sequence statements. (Is that a standard library ?)

The functions made accessible are documented online . . for your CPU temp value you could use

local temp = read_status('informational_settings.soc_temp')

See Configuration | FarmBot Developer Documentation