5.02021-11-21T22:00:15ZTemplates1wire-temperature-probe1wire Temperature Probe## Description
Automatically finds all 1wire devices and assumes them to be temperature probes. Specifically made for DS18B20 sensor probes in combination with Raspberry Pis. Useful macros: You can assign a friendly name for the probes using the following syntax: {$PROBE:"1wire-ID"} 1wire-ID being the devices name, found under /sys/bus/w1/devices/. The set value will represent the friendly name. You also have the option to assign sensors to three different groups: 0, 1 and 2. This will modify the trigger behaviour for specific sensors. 0 is using a normal temperature range calculated for server rooms, 1 is using an extended range and 2 is disabling triggers completly. You can see the specific values in the trigger section. The macro syntax for this is similar to the friendly name: {$GROUP:"1wire-ID"}
## Overview
*Specifically made for DS18B20 sensor probes in combination with Raspberry Pis. Could & should work on other systems aswell (eventually with small modifications) however it has only been tested on RPIs and DS18B20s.*
---
This template will automatically find all 1wire devices and assume them to be temperature probes.
It'll create items for every 1wire device it found under "/sys/bus/w1/devices/", convert the output to Celsius (in the correct fashion for DS18B20 probes) and create six threshold triggers aswell as a "no data"-trigger for each one.
To better differentiate between the sensors you can assign a friendly name for probes using the following syntax: {$PROBE:"1wire-ID"}
1wire-ID being the devices name, found under /sys/bus/w1/devices/. The set value will represent the friendly name.
You also have the option to assign sensors to three different groups: 0, 1 and 2. This will modify the trigger behaviour for specific sensors.
0 is using a normal temperature range calculated for server rooms, 1 is using an extended range and 2 is disabling triggers completly. The macro syntax for this is similar to the friendly name: {$GROUP:"1wire-ID"}
The space limit unfortunatly doesn't allow me to tell you the thresholds here, however you can quickly see them in the trigger sections.
## Author
Leonard Winck
TemplatesTemperature Probe1wire devicessystem.run[find /sys/bus/w1/devices/28* -maxdepth 1 -type l -printf '%f\n' 2> /dev/null]15mTemperature reading of probe "{#DEVICE}" ({$PROBE:"{#DEVICE}"})system.run[cat /sys/bus/w1/devices/{#DEVICE}/w1_slave | tail -n +2 | cut -d= -f2-]15sFLOAT°CTemperature ProbeMULTIPLIER0.001{nodata(180)}=1No data received (>3m) from probe "{$PROBE:"{#DEVICE}"}"({avg(180)}>=30 and {avg(180)}<33 and {$GROUP:"{#DEVICE}"}=0) or ({avg(180)}>=35 and {avg(180)}<38 and {$GROUP:"{#DEVICE}"}=1)Temperature critically high on probe "{$PROBE:"{#DEVICE}"}"AVERAGE({avg(180)}>=14 and {avg(180)}<17 and {$GROUP:"{#DEVICE}"}=0) or ({avg(180)}>=6 and {avg(180)}<10 and {$GROUP:"{#DEVICE}"}=1)Temperature critically low on probe "{$PROBE:"{#DEVICE}"}"AVERAGE({last()}>=33 and {$GROUP:"{#DEVICE}"}=0) or ({last()}>=38 and {$GROUP:"{#DEVICE}"}=1)Temperature disastrously high on probe "{$PROBE:"{#DEVICE}"}"DISASTER({last()}<14 and {nodata(35)}=0 and {$GROUP:"{#DEVICE}"}=0) or ({last()}<6 and {nodata(35)}=0 and {$GROUP:"{#DEVICE}"}=1)Temperature disastrously low on probe "{$PROBE:"{#DEVICE}"}"DISASTERNo data received (>3m) from probe "{$PROBE:"{#DEVICE}"}"{1wire-temperature-probe:system.run[cat /sys/bus/w1/devices/{#DEVICE}/w1_slave | tail -n +2 | cut -d= -f2-].nodata(180)}=1({avg(180)}>=27 and {avg(180)}<30 and {$GROUP:"{#DEVICE}"}=0) or ({avg(180)}>=32 and {avg(180)}<35 and {$GROUP:"{#DEVICE}"}=1)Temperature high on probe "{$PROBE:"{#DEVICE}"}"WARNING({avg(180)}>=17 and {avg(180)}<20 and {$GROUP:"{#DEVICE}"}=0) or ({avg(180)}>=10 and {avg(180)}<14 and {$GROUP:"{#DEVICE}"}=1)Temperature low on probe "{$PROBE:"{#DEVICE}"}"WARNINGJAVASCRIPTvar lld = [];
var lines = value.split("\n");
var lines_num = lines.length;
for (i = 0; i < lines_num; i++)
{
var row = {};
row["{#DEVICE}"] = lines[i]
lld.push(row);
}
return JSON.stringify(lld);{$GROUP}0Default Group