Hello again,
PellMon is slowly becoming closer to complete, the main two additions lately are:
The RaspberryGPIO plugin now makes it easy to set up and use all 17 I/O of the raspberry pi as inputs / outputs or counters. There is also a 'tachometer' mode that can be used for instance to measure blower rpm, and a latched_input mode that makes sure that short input activations are not missed.
And to be able to use the abundance of I/O, the 'Calculate' has also been improved. Now it has an if..then..[else]..end clause, local and global variables, lots of new operators, descriptive error messages to help in writing the scripts and most importantly cyclic execution. This means that almost any functionality can be added by adding a 'Calculate' script. The scripts are written using reverse polish notation (RPN), so anyone who has used an HP pocket calculator should feel right at home.
Examples:
Flash an alarm light connected to pin 16 at 1Hz when the boiler temperature is above 90 degrees, by adding this to the configuration file
https://github.com/motoz/PellMon/blob/master/src/pellmon.conf.in:
[plugin_RaspberryGPIO]
gpio23_function = output
gpio23_item = out
gpio23_pin = 16
[plugin_Calculate]
blink_prog = if boiler_temp get 90 > then out get 0 1 ? out set end
blink_taskcycle = 0.5
and by adding:
blink_progtype = R/W
the 'blink_prog' item holding the script becomes a read/write item, meaning that it can be edited in the parameters view of the webinterface.
Ex 2: add 3 onewire temperature sensors and read the average temperature from an item named 'average_temp' and maximum temperature from 'max_temp'
[plugin_OWFS]
owfs1_item = temp1
owfs1_path = 10.67C6697351FF/temperature
owfs1_item = temp2
owfs1_path = 10.57C669E352FF/temperature
owfs1_item = temp3
owfs1_path = 10.66A6237321FF/temperature
[plugin_Calculate]
aver_prog = temp1 get temp2 get temp3 get + + 3 /
aver_readitem = average_temp
max_prog = temp1 get temp2 get max temp3 get max
max_readitem = max_temp