can anybody help me designing a more complex virtual sensor with a bash-file?
The fare-away goal should be to get a 3h-trend from a sensor like thb0 into thb9, from temperature, humidity and barometric pressure.
I tried the following to get a 3h-trend value (first just) from the barometric pressure:
Code: Select all
#! /bin/sh
#
# runs at /home/meteohub/vsensor_delta3h.sh
wget -q -O /dev/stdout "http://meteo.horn.dom/meteograph.cgi?text=all" | grep -E "actual_thb0_press_hpa|seqhour1_thb0_press_hpa" | gawk 'BEGIN {FS="_"} {print $4,$6}' | tr -s '\n' ' ' | gawk 'BEGIN {FS=" "} {printf "%.1f\n", lround ($2 - $5) }'
#
NeueID Name Trigg Umrechnung
Data11 Trend thb0 /home/meteohub/vsensor_delta3h.sh
After saving this virtual sensor the data collecting process restarts. Then meteohub.log says:
Code: Select all
processing "/home/meteohub/vsensor_thb0_delta3h.sh" does not return a value string, reason is:
error while doing write on socket 5558: Broken pipe
Thx in advance