I just received my logger and installed it tonight and it works great! I'm very interested in using MQTT to publish data to Home Assistant however I noticed the temperatures are all sent in F instead of C. Is there any way to change the MQTT settings to send in C? I noticed that in the FTP settings it can be changed.
Thanks this is an awesome product and I'm happy to support it!
My other post on the Home Assistant forum, maybe we can get some more people from there!
https://community.home-assistant.io/t/wifi-logger-for-davis-weather-stations/88966/3
When I was preparing CSV(text) file for archive export, I wanted to make something similar to WeatherLink standard, but now I know that was bad idea.
When you have original TXT file from WeatherLink PC you don't know what units are in it. I have add units columns to my file.
JSON file is in native console units and has to be like this. It's universal. You have to recalculated units before showing on screen like WU, or PWS make it.
Please visit my website
http://wifilogger.net/station/php/wflexp.jsonand template to show data from this JSON
http://wifilogger.net/station/php/ When you click on unit lik C or mph, units will change and settings will be stored by cookies in your web browser. So when you visit this site again it will have your (local)preferences.
It's quite convenient. In same time when you want to store data in data base from multiple people, then data will always be the same F, mph, inch, no mismatch possible.
My next move is to export archive data via JSON format. It will also be in native units from console.
Check how looks recalculating in JavaScript(maybe not very clean code):
Changing from F to C is only return Math.round(((unit-32)/1.8 )*10) / 10;
function Ubar(bar){
var b=0;
switch(UNITS[0]) {
case "mm": b = bar * 25.4 ;break;
case "hPa": b = bar * 33.8639;break;
case "mb": b = bar * 33.8637526; break;
default: return Math.round((bar)*1000) /1000;
}
return Math.round((b)*10) /10;
}
function Uwind(wind){
if(wind == "---") return "---";
var w=0;
switch(UNITS[4]) {
case "mph": w = wind;break;
case "m/s": w = wind * 0.447; break;
case "km/h": w = wind * 1.6093;break;
case "knots": w = wind * 0.869;break;
default:w = wind;
}
return Math.round((w)*10) /10;
}
function Urain(rain){
var r=0;
switch(UNITS[3]) {
case "mm": r = Math.round((rain*25.4)*10) /10; return r.toFixed(1);break;
default: r = Math.round((rain)*100) /100; return r.toFixed(2);
}
}
function Utemp(unit){
if(UNITS[1] == "F") return unit;
else{
return Math.round(((unit-32)/1.8)*10) / 10;
}
}
I am adding JSON structire in XLS