You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for this guide. It was very helpful in helping me set up my wireless tag sensors. I made a few small and easy tweaks which I thought I'd share.
You've used the ethDownloadMultiStatsCSV method to download stats, which returns the entire sensor history. It can be pretty long, and all of it is discarded. Instead, it is possible to fetch just the latest temperature using the ethLogShared method. Here's an example from one of my sensors (openhab2 syntax, from conf/services/http.cfg):
Since it returns very little data, I reduced the update interval to one minute. I can use the following JS to extract the temperature from it:
(function(i) {
x = i.indexOf("<temp_degC>") + 11;
y = i.indexOf("</temp_degC>");
return i.substring(x, y);
})(input)
The same http resource can also be used to extract humidity using this JS:
(function(i) {
x = i.indexOf("") + 5;
y = i.indexOf("");
return i.substring(x, y);
})(input)
The item definitions are pretty much unchanged from yours:
Number Temperature_Outdoor "Outdoor Temperature [%.1f °C]" { http="<[wirelessTagOutdoor:60000:JS(wirelessTagTemp.js)]" }
Number Humidity_Outdoor "Outdoor Humidity [%.1f %%]" { http="<[wirelessTagOutdoor:60000:JS(wirelessTagHumidity.js)]" }
One other thing that tripped me up is that depending on when the sensors were bought, the API url can be different. There is an explanation here (or search for "New Cloud Architecture with Multiple Databases" in the API docs):
Hi,
Thanks a lot for this guide. It was very helpful in helping me set up my wireless tag sensors. I made a few small and easy tweaks which I thought I'd share.
You've used the ethDownloadMultiStatsCSV method to download stats, which returns the entire sensor history. It can be pretty long, and all of it is discarded. Instead, it is possible to fetch just the latest temperature using the ethLogShared method. Here's an example from one of my sensors (openhab2 syntax, from conf/services/http.cfg):
wirelessTagOutdoor.url=https://my.wirelesstag.net/ethLogShared.asmx/GetLatestTemperatureRawDataByUUID?uuid=
wirelessTagOutdoor.updateInterval=60000
Since it returns very little data, I reduced the update interval to one minute. I can use the following JS to extract the temperature from it:
(function(i) {
x = i.indexOf("<temp_degC>") + 11;
y = i.indexOf("</temp_degC>");
return i.substring(x, y);
})(input)
The same http resource can also be used to extract humidity using this JS:
(function(i) {
x = i.indexOf("") + 5;
y = i.indexOf("");
return i.substring(x, y);
})(input)
The item definitions are pretty much unchanged from yours:
Number Temperature_Outdoor "Outdoor Temperature [%.1f °C]" { http="<[wirelessTagOutdoor:60000:JS(wirelessTagTemp.js)]" }
Number Humidity_Outdoor "Outdoor Humidity [%.1f %%]" { http="<[wirelessTagOutdoor:60000:JS(wirelessTagHumidity.js)]" }
One other thing that tripped me up is that depending on when the sensors were bought, the API url can be different. There is an explanation here (or search for "New Cloud Architecture with Multiple Databases" in the API docs):
https://groups.google.com/d/msg/wireless-sensor-tags/cyGI5sauSmg/DMvpFWvpAQAJ
The text was updated successfully, but these errors were encountered: