JohanLeirnes / WH5300-weatherstation-ESP8266-MQTT-json

A ESP8266 based sniffer for the WH5300 weather station
3 stars 2 forks source link

Rain and wind #2

Open JohanLeirnes opened 7 years ago

JohanLeirnes commented 7 years ago

I have noticed that the rain every 15min isnt working at all. Gonna check why on a rainy day

Also the m/s is a bit off. Atm the windspeed and windgust is calculated as /3.6 only. might need to refine this a bit.

patykolak commented 7 years ago

Hello Rain isnt working, to test i use drink water :) Windspeed isnt calculate properly - at LCD 6,5km/h in mqtt 1,67, at LCD 7,6km/h in mqt 1,94

JohanLeirnes commented 7 years ago

Windspeed is reported in m/s not in km/h and is not 100% accurate no. What you show on the display does not change what is reported.

patykolak commented 7 years ago

OK, tnx. How to read properly rain sensor?

JohanLeirnes commented 7 years ago

I do not have the time to troubleshoot atm. So have no idea whats wrong atm

patykolak commented 7 years ago

Why, when i add line root["deszcz"] = String(rAcum); mqtt not works?

void publishData(float temp,int hum,float rAcum,float wSpeed,float wGust,int dir,int status) { // create a JSON object // doc : https://github.com/bblanchon/ArduinoJson/wiki/API%20Reference StaticJsonBuffer<500> jsonBuffer; JsonObject& root = jsonBuffer.createObject(); // INFO: the data must be converted into a string; a problem occurs when using floats... root["temperature"] = String(temp); root["humidity"] = String(hum); root["deszcz"] = String(rAcum); root["wind"] = String(wSpeed); root["windgust"] = String(wGust); root["winddir"] = String(windDirections[dir]); root["status"] = String(status); debugln("Temperatura: " + String(temp) + " ºC"); debugln("Wilgotnosc: " + String(hum) + " %"); debugln("Deszcz: " + String(rAcum) + " mm"); debugln("Wiatr sr: " + String(wSpeed) + " m/s"); debugln("Wiatr: " + String(wGust) + "m/s"); debugln("Status bits: " + String(status)); debugln("Kierunek wiatru: " + String(windDirections[dir])); char data[500]; root.printTo(data, root.measureLength() + 1); client.publish(MQTT_SENSOR_TOPIC, data, true); datasent=1; debugln("Data sent, taking a pause"); intro=1; p=0; debugln("p:" + String(p)); }

JohanLeirnes commented 7 years ago

did you also change

publishData(temp, hum, wSpeed, wGust, dir, status);

to

publishData(temp, hum, rAcum, wSpeed, wGust, dir, status);

Laserlicht commented 4 years ago

Hello,

Anything new here?