diff --git a/main/ZgatewayRTL_433.ino b/main/ZgatewayRTL_433.ino index 8497547..8da77d2 100644 --- a/main/ZgatewayRTL_433.ino +++ b/main/ZgatewayRTL_433.ino @@ -129,7 +129,11 @@ void launchRTL_433Discovery(bool overrideDiscovery) { DISCOVERY_TRACE_LOG(F("idWoKey %s" CR), idWoKey.c_str()); String value_template = "{{ value_json." + String(parameters[i][0]) + " | is_defined }}"; if (strcmp(parameters[i][0], "battery_ok") == 0) { - value_template = "{{ float(value_json." + String(parameters[i][0]) + ") * 99 + 1 | is_defined }}"; // https://github.com/merbanan/rtl_433/blob/93f0f30c28cfb6b82b8cc3753415b01a85bee91d/examples/rtl_433_mqtt_hass.py#L187 + if (OpenHABDisc) { + value_template = "{{ value_json." + String(parameters[i][0]) + " * 99 + 1 }}"; // https://github.com/merbanan/rtl_433/blob/93f0f30c28cfb6b82b8cc3753415b01a85bee91d/examples/rtl_433_mqtt_hass.py#L187 + } else { + value_template = "{{ float(value_json." + String(parameters[i][0]) + ") * 99 + 1 | is_defined }}"; // https://github.com/merbanan/rtl_433/blob/93f0f30c28cfb6b82b8cc3753415b01a85bee91d/examples/rtl_433_mqtt_hass.py#L187 + } } String topic = subjectRTL_433toMQTT; # if valueAsATopic diff --git a/main/ZwebUI.ino b/main/ZwebUI.ino index 8268cbf..fe06912 100644 --- a/main/ZwebUI.ino +++ b/main/ZwebUI.ino @@ -1533,6 +1533,13 @@ void webUIPubPrint(const char* topicori, JsonObject& data) { } } + float moisture = data["moisture"]; + if (data.containsKey("moisture") && moisture <= 100 && moisture >= 0) { + char moist[5]; + dtostrf(moisture, 3, 1, moist); + line3 += "moist: " + (String)moist + "% "; + } + line3.toCharArray(message->line3, WEBUI_TEXT_WIDTH); // Line 4 diff --git a/main/config_RF.h b/main/config_RF.h index e89f696..c1668b0 100644 --- a/main/config_RF.h +++ b/main/config_RF.h @@ -90,7 +90,7 @@ const char parameters[40][4][24] = { {"temperature_2_C", "temperature", "°C", "temperature"}, {"temperature_F", "temperature", "°F", "temperature"}, {"time", "timestamp", "", "timestamp"}, - {"battery_ok", "battery", "", "battery"}, + {"battery_ok", "battery", "%", "battery"}, {"humidity", "humidity", "%", "humidity"}, {"moisture", "moisture", "%", "humidity"}, {"pressure_hPa", "pressure", "hPa", "pressure"}, diff --git a/platformio.ini b/platformio.ini index 655bb50..46dfa97 100644 --- a/platformio.ini +++ b/platformio.ini @@ -148,7 +148,7 @@ smartrc-cc1101-driver-lib = SmartRC-CC1101-Driver-Lib@2.5.7 stl = https://github.com/mike-matera/ArduinoSTL.git#7411816 shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library somfy_remote=Somfy_Remote_Lib@0.3.0 -rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP.git#v0.2.1 +rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP.git#v0.3.0 emodbus = miq19/eModbus@1.0.0 gfSunInverter = https://github.com/BlackSmith/GFSunInverter.git#v1.0.1 decoder = https://github.com/theengs/decoder.git