matthias-bs / BresserWeatherSensorReceiver

Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver for Arduino based on CC1101, SX1276/RFM95W or SX1262
MIT License
100 stars 21 forks source link

rain implementation -> renew examples #144

Closed tonbor closed 2 months ago

tonbor commented 3 months ago

the domoticz example is not correct (any more) because of new implementation of rain calculation String(weatherSensor.sensor[i].w.rain_mm 100, 1); should be rain mm per hour domo2_payload = String("{"idx":") + String(DOMO_RAIN_IDX) + String(","nvalue":0,"svalue":"") + String(rainGauge.pastHour() 100, 1);

if (weatherSensor.sensor[i].w.rain_ok) { domo2_payload = String("{"idx":") + String(DOMO_RAIN_IDX) + String(","nvalue":0,"svalue":"") + String(weatherSensor.sensor[i].w.rain_mm * 100, 1); domo2_payload += String(";") + String(weatherSensor.sensor[i].w.rain_mm, 1); domo2_payload += String(""}"); Serial.printf("%s: %s\n", MQTT_PUB_DOMO, domo2_payload.c_str()); client.publish(MQTT_PUB_DOMO, domo2_payload.c_str(), false, 0); }

matthias-bs commented 3 months ago

Do you have an example of how the MQTT payload is supposed to look like - or even better - a link to the Domoticz specification? I don't use this myself, I just implemented this upon a user's request.

tonbor commented 3 months ago

https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s#Rain

Op di 19 mrt. 2024 18:00 schreef Matthias Prinke @.***>:

Do you have an example of how the MQTT payload is supposed to look like - or even better - a link to the Domoticz specification? I don't use this myself, I just implemented this upon a user's request.

— Reply to this email directly, view it on GitHub https://github.com/matthias-bs/BresserWeatherSensorReceiver/issues/144#issuecomment-2007690857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKD7IIRSS3E6EZUCHDEM7MDYZBVJRAVCNFSM6AAAAABE3BDHOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBXGY4TAOBVG4 . You are receiving this because you authored the thread.Message ID: @.*** com>

matthias-bs commented 3 months ago

Can you please test it? https://github.com/matthias-bs/BresserWeatherSensorReceiver/blob/fix-domoticz-rain/examples/BresserWeatherSensorDomoticz/BresserWeatherSensorDomoticz.ino

matthias-bs commented 2 months ago

Added in https://github.com/matthias-bs/BresserWeatherSensorReceiver/pull/152