From 6fbe1418c28d91c69908e9837ff628521d2b0342 Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Mon, 3 Dec 2018 10:22:41 +0000 Subject: [PATCH] moving cambridge sensor to curl_json to align with domoticz collectors --- cambridge.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cambridge.sh b/cambridge.sh index b7e5e74..1f40112 100755 --- a/cambridge.sh +++ b/cambridge.sh @@ -31,17 +31,20 @@ while true; do #Summary: very humid, cold, light winds - prefix="sensors-weather" - suffix="-cambridge" + #prefix="sensors-weather" + plugin="curl_json" + instance="sensors" + key_instance="cambridge" declare -A data data[temperature]=$(grep "Temperature" <<< "${cbg}" | awk '{print $2}') 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[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[dewpoint]=$(grep "Dewpoint" <<< "${cbg}" | awk '{print $2}') 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 mymqtt_update "${ID}" "${TEM_ID}" "${V_TEMP}" "${data[temperature]}"