[RTL_433 Discovery] Add Govee water sensor Status entity (#1499)
* [RTL_433 Discovery] Add Govee water sensor Status entity Add Govee water status sensor auto discovery as a binary_sensor, the entity will detect Water Leak Event and go back to Off state after 60seconds * Format and comment
This commit is contained in:
1 parent
84f5029b14
commit
578f522356
2 files changed
+13
-2
No files matched your search
@@ -161,6 +161,16 @@ void launchRTL_433Discovery(bool overrideDiscovery) {
|
||||
(char*)idWoKey.c_str(), "", pdevice->modelName, (char*)idWoKey.c_str(), false, // device name, device manufacturer, device model, device ID, retain
|
||||
stateClassTotalIncreasing //State Class
|
||||
);
|
||||
} else if (strcmp(parameters[i][0], "event") == 0 && strcmp(pdevice->modelName, "Govee-Water") == 0) { //the entity will detect Water Leak Event and go back to Off state after 60seconds
|
||||
createDiscovery("binary_sensor", //set Type
|
||||
(char*)topic.c_str(), parameters[i][1], pdevice->uniqueId, //set state_topic,name,uniqueId
|
||||
"", parameters[i][3], (char*)value_template.c_str(), //set availability_topic,device_class,value_template,
|
||||
"Water Leak", "", parameters[i][2], //set,payload_on,payload_off,unit_of_meas,
|
||||
60, //set off_delay
|
||||
"", "", false, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
|
||||
(char*)idWoKey.c_str(), "Govee", pdevice->modelName, (char*)idWoKey.c_str(), false, // device name, device manufacturer, device model, device ID, retain
|
||||
stateClassMeasurement //State Class
|
||||
);
|
||||
} else {
|
||||
createDiscovery("sensor", //set Type
|
||||
(char*)topic.c_str(), parameters[i][1], pdevice->uniqueId, //set state_topic,name,uniqueId
|
||||
|
||||
+3
-2
@@ -82,7 +82,7 @@ struct RTL_433device {
|
||||
|
||||
extern std::vector<RTL_433device*> RTL_433devices;
|
||||
|
||||
const char parameters[39][4][24] = {
|
||||
const char parameters[40][4][24] = {
|
||||
// RTL_433 key, name, unit, device_class
|
||||
{"temperature_C", "temperature", "°C", "temperature"},
|
||||
{"temperature_1_C", "temperature", "°C", "temperature"},
|
||||
@@ -122,7 +122,8 @@ const char parameters[39][4][24] = {
|
||||
{"tamper", "tamper", "", ""},
|
||||
{"alarm", "alarm", "", ""},
|
||||
{"motion", "motion", "", "motion"},
|
||||
{"strike_count", "strike count", "", ""}}; // from rtl_433_mqtt_hass.py
|
||||
{"strike_count", "strike count", "", ""}, // from rtl_433_mqtt_hass.py
|
||||
{"event", "Status", "", "moisture"}};
|
||||
# endif
|
||||
#endif
|
||||
/*-------------------RF topics & parameters----------------------*/
|
||||
|
||||
Reference in new issue
Block a user