moving cambridge sensor to curl_json to align with domoticz collectors
This commit is contained in:
parent
c9b854a123
commit
6fbe1418c2
1 changed files with 6 additions and 3 deletions
|
@ -31,17 +31,20 @@ while true; do
|
||||||
#Summary: very humid, cold, light winds
|
#Summary: very humid, cold, light winds
|
||||||
|
|
||||||
|
|
||||||
prefix="sensors-weather"
|
#prefix="sensors-weather"
|
||||||
suffix="-cambridge"
|
plugin="curl_json"
|
||||||
|
instance="sensors"
|
||||||
|
key_instance="cambridge"
|
||||||
declare -A data
|
declare -A data
|
||||||
data[temperature]=$(grep "Temperature" <<< "${cbg}" | awk '{print $2}')
|
data[temperature]=$(grep "Temperature" <<< "${cbg}" | awk '{print $2}')
|
||||||
data[humidity]=$(echo "scale=0;$(grep "Humidity" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
data[humidity]=$(echo "scale=0;$(grep "Humidity" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
||||||
data[pressure]=$(echo "scale=2;$(grep "Pressure" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
data[pressure]=$(echo "scale=2;$(grep "Pressure" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
||||||
data[rain]=$(echo "scale=2;$(grep "Rainfall" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
data[rain]=$(echo "scale=2;$(grep "Rainfall" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
||||||
data[sunshine]=$(echo "scale=2;$(grep "Sunshine" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
data[sunshine]=$(echo "scale=2;$(grep "Sunshine" <<< "${cbg}" | awk '{print $2}')/1" | bc)
|
||||||
|
data[dewpoint]=$(grep "Dewpoint" <<< "${cbg}" | awk '{print $2}')
|
||||||
|
|
||||||
for key in "${!data[@]}"; do
|
for key in "${!data[@]}"; do
|
||||||
echo "PUTVAL $HOSTNAME/${prefix}/${key}${suffix} interval=$INTERVAL N:${data[$key]}"
|
echo "PUTVAL $HOSTNAME/${plugin}-${instance}/${key}-${key_instance} interval=$INTERVAL N:${data[$key]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
mymqtt_update "${ID}" "${TEM_ID}" "${V_TEMP}" "${data[temperature]}"
|
mymqtt_update "${ID}" "${TEM_ID}" "${V_TEMP}" "${data[temperature]}"
|
||||||
|
|
Loading…
Reference in a new issue