Home Script Sensor
Post
Cancel

Script Sensor

Information

With a script sensor you can make your own script/program that does a measurement and give back the current value.

For temperature, it needs to return the value in Celsius degrees.

You can use decimal/float values. But make sure you have only a numeric value output. No ‘%’ of ‘C’ indicators.

Python scripts

In order to use the Python virtual environment with all its libraries, make sure you have the correct shebang line:

1
#!/usr/bin/env python

Docker

When using docker, you can place them in the scripts volume that you have defined in the docker-compose.yaml file. And then you can use the following address: /TerrariumPI/scripts/[name_of_script].[extension]

More information …

Setup

In order to use the Script Sensor use the following settings:

Mandatory

Hardware : Script Sensor

Types : altitude, co2, distance, fertility, humidity, light, moisture, ph, pressure, temperature, uva, uvb, uvi

Address : Enter the full path to the script.

Other settings can be found at the sensor setup information

This post is licensed under CC BY 4.0 by the author.