ha discvovery, handle unset values

This commit is contained in:
Daniel Ekman 2022-03-22 11:24:38 +01:00
parent fb60127cf7
commit 2125945728
2 changed files with 2 additions and 2 deletions

View File

@ -220,7 +220,7 @@ bool HomeAssistantMqttHandler::publishSystem(HwTools* hw) {
haUID.c_str(), FPSTR(HA_PARAMS[i]),
haUID.c_str(), FPSTR(HA_PARAMS[i]),
FPSTR(HA_UOM[i]),
FPSTR(HA_PARAMS[i]), FPSTR(HA_PARAMS[i]), haUID.c_str(), FPSTR(HA_PARAMS[i]),
FPSTR(HA_PARAMS[i]),
FPSTR(HA_DEVCL[i]),
haUID.c_str(),
haName.c_str(),

View File

@ -4,7 +4,7 @@
"uniq_id" : "%s_%s",
"obj_id" : "%s_%s",
"unit_of_meas" : "%s",
"val_tpl" : "{%% if value_json.%s is defined %%} {{ value_json.%s }} {%% else %%} {{(states.sensor.%s_%s|float)}} {%% endif %%}",
"val_tpl" : "{{ value_json.%s | is_defined }}",
"dev_cla" : "%s",
"dev" : {
"ids" : [ "%s" ],