Set entities as unavailable in HA if state undefined
This commit is contained in:
@@ -347,6 +347,15 @@ void NukiNetworkOpener::publishKeyTurnerState(const NukiOpener::OpenerState& key
|
||||
publishState(keyTurnerState);
|
||||
}
|
||||
}
|
||||
|
||||
if(strcmp(str, "undefined") == 0)
|
||||
{
|
||||
_nukiPublisher->publishString(mqtt_topic_lock_availability, "offline", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_nukiPublisher->publishString(mqtt_topic_lock_availability, "online", true);
|
||||
}
|
||||
|
||||
json["lock_state"] = str;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user