Plugin for own Sensor Data with user-defined station
Posted: Fri Feb 13, 2026 9:49 pm
I wrote a plugin to use a separate temperature sensor as an alternative indoor sensor instead of the Davis console sensor. The sensor outputs its data as JSON and I created the plugin through trial and error and based on information from the forum. I used the Meteobridge bash to test the commands for extracting the correctly values from the JSON with this sample code:
root@MeteoBridge:~# data=$(wget --timeout=2 -qO- http://192.168.178.34/cm?cmnd=status%2010) && temp=$(echo $data | tr '{'
'\n' | grep Temperature | awk -F '"' '{print substr($3,2,length($3)-2)}') && echo "$temp"
22.2
JSON-Code from sensor:
{"StatusSNS":{"Time":"2026-02-13T20:29:25","SHT4X":{"Temperature":22.2,"Humidity":36.3,"DewPoint":6.5},"TempUnit":"C"}}
plugin Code:
#!/bin/sh
#
#read Temperature, Humidity and Dewpoint data from url file at json format (Tasmota SHT40 Sensor)
#download file from url
#
i=0
while true;
do
data=$(wget --timeout=2 -qO- http://192.168.178.34/cm?cmnd=status%2010)
temp=$(echo $data | tr '{' '\n' | grep Temperature | awk -F '"' '{print substr($3,2,length($3)-2)}')
echo "t0 $temp"
sleep 2
hum=$(echo $data | tr '{' '\n' | grep Temperature | awk -F '"' '{print substr($5,2,length($5)-2)}')
echo "hum0 $hum"
sleep 2
dew=$(echo $data | tr '{' '\n' | grep Temperature | awk -F '"' '{print substr($7,2,length($7)-3)}')
echo "dew0 $dew"
sleep 180
done
For the temperature, Meteobridge displays 2.2 degrees instead of 22.2, even though I am passing 22.2 as a variable, why?
I have integrated the plugin and am getting an error message for the dew point and humidity values.
I'm probably using the wrong variables for dew point and humidity, since the MB Log is showing errors?
Strangely also, even if I delete my userstation I have recorded, the sensor continues to be read. Only restarting the MB helps here!
Who can help me here?
root@MeteoBridge:~# data=$(wget --timeout=2 -qO- http://192.168.178.34/cm?cmnd=status%2010) && temp=$(echo $data | tr '{'
'\n' | grep Temperature | awk -F '"' '{print substr($3,2,length($3)-2)}') && echo "$temp"
22.2
JSON-Code from sensor:
{"StatusSNS":{"Time":"2026-02-13T20:29:25","SHT4X":{"Temperature":22.2,"Humidity":36.3,"DewPoint":6.5},"TempUnit":"C"}}
plugin Code:
#!/bin/sh
#
#read Temperature, Humidity and Dewpoint data from url file at json format (Tasmota SHT40 Sensor)
#download file from url
#
i=0
while true;
do
data=$(wget --timeout=2 -qO- http://192.168.178.34/cm?cmnd=status%2010)
temp=$(echo $data | tr '{' '\n' | grep Temperature | awk -F '"' '{print substr($3,2,length($3)-2)}')
echo "t0 $temp"
sleep 2
hum=$(echo $data | tr '{' '\n' | grep Temperature | awk -F '"' '{print substr($5,2,length($5)-2)}')
echo "hum0 $hum"
sleep 2
dew=$(echo $data | tr '{' '\n' | grep Temperature | awk -F '"' '{print substr($7,2,length($7)-3)}')
echo "dew0 $dew"
sleep 180
done
For the temperature, Meteobridge displays 2.2 degrees instead of 22.2, even though I am passing 22.2 as a variable, why?
I have integrated the plugin and am getting an error message for the dew point and humidity values.
I'm probably using the wrong variables for dew point and humidity, since the MB Log is showing errors?
Strangely also, even if I delete my userstation I have recorded, the sensor continues to be read. Only restarting the MB helps here!
Who can help me here?