Add battery JSON
This commit is contained in:
@@ -806,14 +806,15 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
|
||||
"Battery low",
|
||||
name,
|
||||
baseTopic,
|
||||
String("~") + mqtt_topic_battery_critical,
|
||||
String("~") + mqtt_topic_battery_basic_json,
|
||||
deviceType,
|
||||
"battery",
|
||||
"",
|
||||
"diagnostic",
|
||||
"",
|
||||
{{(char*)"pl_on", (char*)"1"},
|
||||
{(char*)"pl_off", (char*)"0"}});
|
||||
{(char*)"pl_off", (char*)"0"},
|
||||
{(char*)"val_tpl", (char*)"{{value_json.critical}}" }});
|
||||
|
||||
// Battery voltage
|
||||
publishHassTopic("sensor",
|
||||
@@ -823,13 +824,14 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
|
||||
"Battery voltage",
|
||||
name,
|
||||
baseTopic,
|
||||
String("~") + mqtt_topic_battery_voltage,
|
||||
String("~") + mqtt_topic_battery_advanced_json,
|
||||
deviceType,
|
||||
"voltage",
|
||||
"measurement",
|
||||
"diagnostic",
|
||||
"",
|
||||
{ {(char*)"unit_of_meas", (char*)"V"} });
|
||||
{ {(char*)"unit_of_meas", (char*)"V"},
|
||||
{(char*)"val_tpl", (char*)"{{value_json.level}}" }});
|
||||
|
||||
// Trigger
|
||||
publishHassTopic("sensor",
|
||||
@@ -1333,13 +1335,14 @@ void Network::publishHASSConfigAdditionalLockEntities(char *deviceType, const ch
|
||||
"Battery level",
|
||||
name,
|
||||
baseTopic,
|
||||
String("~") + mqtt_topic_battery_level,
|
||||
String("~") + mqtt_topic_battery_basic_json,
|
||||
deviceType,
|
||||
"battery",
|
||||
"measurement",
|
||||
"diagnostic",
|
||||
"",
|
||||
{ {(char*)"unit_of_meas", (char*)"%"} });
|
||||
{ {(char*)"unit_of_meas", (char*)"%"},
|
||||
{(char*)"val_tpl", (char*)"{{value_json.level}}" }});
|
||||
|
||||
if((int)basicLockConfigAclPrefs[7] == 1)
|
||||
{
|
||||
@@ -3032,14 +3035,15 @@ void Network::publishHASSConfigKeypad(char *deviceType, const char *baseTopic, c
|
||||
"Keypad battery low",
|
||||
name,
|
||||
baseTopic,
|
||||
String("~") + mqtt_topic_battery_keypad_critical,
|
||||
String("~") + mqtt_topic_battery_basic_json,
|
||||
deviceType,
|
||||
"battery",
|
||||
"",
|
||||
"diagnostic",
|
||||
"",
|
||||
{{(char*)"pl_on", (char*)"1"},
|
||||
{(char*)"pl_off", (char*)"0"}});
|
||||
{(char*)"pl_off", (char*)"0"},
|
||||
{(char*)"val_tpl", (char*)"{{value_json.keypadCritical}}" }});
|
||||
|
||||
// Query Keypad
|
||||
publishHassTopic("button",
|
||||
|
||||
Reference in New Issue
Block a user