Change soil moisture to percent display ()

This commit is contained in:
Christian W. Zuckschwerdt 2021-01-13 08:15:24 +01:00 committed by GitHub
parent 9680e57d37
commit b9de8421df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View file

@ -72,6 +72,9 @@ Examples:
* **humidity** (double) (Optional)
* Humidity from a hygrometer sensor in % relative humidity
* **moisture** (double) (Optional)
* Moisture from a soil probe in % relative saturation
* **wind_dir_deg** (double) (Optional)
* Wind direction from wind sensor in compass direction degrees.

View file

@ -187,9 +187,9 @@ static int bresser_6in1_decode(r_device *decoder, bitbuffer_t *bitbuffer)
"channel", "", DATA_INT, chan,
"battery_ok", "Battery OK", DATA_INT, batt,
"temperature_C", "Temperature", DATA_COND, temp_ok, DATA_FORMAT, "%.1f C", DATA_DOUBLE, temp_c,
"humidity", "Humidity", DATA_COND, temp_ok, DATA_INT, humidity,
"humidity", "Humidity", DATA_COND, temp_ok && moisture < 0, DATA_INT, humidity,
"sensor_type", "Sensor type", DATA_INT, s_type,
"moisture", "Moisture", DATA_COND, moisture >= 0, DATA_INT, moisture,
"moisture", "Moisture", DATA_COND, moisture >= 0, DATA_FORMAT, "%d %%", DATA_INT, moisture,
"wind_max_m_s", "Wind Gust", DATA_COND, wind_ok, DATA_FORMAT, "%.1f m/s", DATA_DOUBLE, wind_gust,
"wind_avg_m_s", "Wind Speed", DATA_COND, wind_ok, DATA_FORMAT, "%.1f m/s", DATA_DOUBLE, wind_avg,
"wind_dir_deg", "Direction", DATA_COND, wind_ok, DATA_INT, wind_dir,

View file

@ -65,7 +65,7 @@ static int springfield_decode(r_device *decoder, bitbuffer_t *bitbuffer)
channel = ((b[1] >> 4) & 0x03) + 1;
temp = (int16_t)(((b[1] & 0x0f) << 12) | (b[2] << 4)); // sign extend
temp_c = (temp >> 4) * 0.1f;
moisture = b[3] >> 4;
moisture = (b[3] >> 4) * 10; // Moisture level is 0-10
//uk1 = b[4] >> 4; /* unknown. */
/* clang-format off */
@ -76,7 +76,7 @@ static int springfield_decode(r_device *decoder, bitbuffer_t *bitbuffer)
"battery", "Battery", DATA_STRING, battery ? "LOW" : "OK",
"transmit", "Transmit", DATA_STRING, button ? "MANUAL" : "AUTO", // TODO: delete this
"temperature_C", "Temperature", DATA_FORMAT, "%.01f C", DATA_DOUBLE, temp_c,
"moisture", "Moisture", DATA_INT, moisture,
"moisture", "Moisture", DATA_FORMAT, "%d %%", DATA_INT, moisture,
"button", "Button", DATA_INT, button,
// "uk1", "uk1", DATA_INT, uk1,
"mic", "Integrity", DATA_STRING, "CHECKSUM",