You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WiiM devices return "Failed" or an empty body (HTTP 200) from the getMetaInfo endpoint when nothing is playing. Both trigger json.JSONDecodeError in session_call_api_json, which logs a WARNING before raising LinkPlayInvalidDataException. On a 5-second poll cycle this produces hundreds of warning lines per day in Home Assistant logs:
WARNING [linkplay] Unexpected json for https://192.168.1.222/httpapi.asp?command=getMetaInfo: Expecting value: line 1 column 1 (char 0)
PR #93 added the data field to the exception and a catch in bridge.py for data == "Failed", but the warning was already emitted by that point. Empty-string responses were not handled at all and re-raised.
Reported in #128 and in Home Assistant core issue #175775.
Fix
Two changes:
utils.py: Before logging, check whether the raw response is empty or "Failed". Log at DEBUG for those cases, keep WARNING for truly unexpected payloads.
bridge.py: Broaden the catch to also treat empty-string responses as a non-error (same as "Failed"). Uses an isinstance check so exceptions raised without an explicit data string still re-raise correctly.
Tests
Adds test_meta_info_empty_response_handling alongside the existing test_meta_info_failed_handling. All 291 tests pass.
WiiM devices return "Failed" or an empty body (HTTP 200) from the
getMetaInfo endpoint when nothing is playing. Both trigger a
JSONDecodeError, and session_call_api_json logs a WARNING for every
occurrence. On a 5-second poll cycle this produces hundreds of
warning lines per day in Home Assistant logs.
The exception handler in bridge.py already treats "Failed" as a
non-error, but it only ran after the warning was already logged.
Empty responses were not handled at all and re-raised.
Log at DEBUG instead of WARNING when the raw response is empty or
"Failed". Broaden the bridge.py catch so empty responses are also
treated as a silent non-error.
ClosesVelleman#128
Only suppress LinkPlayInvalidDataException when exc.data is an actual
string whose stripped value is empty or "Failed". Exceptions raised
without a data field (data=None) now re-raise instead of being
silently swallowed.
Scale on a single idle device: 537,992 warnings over ~8 weeks (Jul 4 – Aug 30), which was 74% of all log entries on that instance. It buried several genuine faults — a dead sensor battery and an offline camera each went unnoticed for weeks because the log was unreadable.
Worth emphasising that the device is entirely healthy: 15/15 requests answered in ~0.08 s across getPlayerStatusEx, getStatusEx, getMetaInfo and getNewAudioOutputHardwareMode, from two separate hosts. So this is purely the log-and-raise in session_call_api_json emitting a warning for a condition bridge.py already treats as expected.
The stripped in ("", "Failed") approach looks right to me. Handling the empty-body case as well as Failed matters — I only found the Failed variant when diagnosing this, and would have missed the empty case.
One note for anyone landing here from search: this cannot be resolved by updating Home Assistant. Both 2026.7.0 and 2026.8.3 pin python-linkplay==0.2.14, so until a release ships, the only mitigation is silencing the logger:
@Velleman Any chance you could take a look at this when you get a moment? We now have an independent reproduction from @firstofjuly on a different device model (WiiM Mini), logging over 500k warnings in 8 weeks from this single endpoint. The fix is minimal and scoped to the two known non-JSON responses ("" and "Failed").
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
WiiM devices return
"Failed"or an empty body (HTTP 200) from thegetMetaInfoendpoint when nothing is playing. Both triggerjson.JSONDecodeErrorinsession_call_api_json, which logs a WARNING before raisingLinkPlayInvalidDataException. On a 5-second poll cycle this produces hundreds of warning lines per day in Home Assistant logs:PR #93 added the
datafield to the exception and a catch inbridge.pyfordata == "Failed", but the warning was already emitted by that point. Empty-string responses were not handled at all and re-raised.Reported in #128 and in Home Assistant core issue #175775.
Fix
Two changes:
utils.py: Before logging, check whether the raw response is empty or
"Failed". Log at DEBUG for those cases, keep WARNING for truly unexpected payloads.bridge.py: Broaden the catch to also treat empty-string responses as a non-error (same as
"Failed"). Uses anisinstancecheck so exceptions raised without an explicitdatastring still re-raise correctly.Tests
Adds
test_meta_info_empty_response_handlingalongside the existingtest_meta_info_failed_handling. All 291 tests pass.Closes#128