diff --git a/FHEM/98_NTFY_CLIENT.pm b/FHEM/98_NTFY_CLIENT.pm index 5d257ba..94bc0e0 100644 --- a/FHEM/98_NTFY_CLIENT.pm +++ b/FHEM/98_NTFY_CLIENT.pm @@ -238,10 +238,13 @@ sub NTFY_WS_CB my $name = $hash->{NAME}; - readingsBeginUpdate($hash); - readingsBulkUpdate($hash, "state", "error"); - readingsBulkUpdate($hash, "error", $error); - readingsEndUpdate($hash,1); + if ($error) + { + readingsBeginUpdate($hash); + readingsBulkUpdate($hash, "state", "error"); + readingsBulkUpdate($hash, "error", $error); + readingsEndUpdate($hash,1); + } NTFY_LOG(LOG_ERROR, "error while connecting to websocket: $error ") if $error; NTFY_LOG(LOG_DEBUG, "websocket callback called");