Open dheckl opened 1 day ago
Hey there @noahhusby, mind taking a look at this issue as it has been labeled with an integration (cambridge_audio
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
cambridge_audio documentation cambridge_audio source (message by IssueLinks)
Do you have standby mode in the unit's settings set to Network standby?
Yes and the device responds to ping.
Can you please add the following to your configuration.yml, and restart HA?
logger:
default: info
logs:
aiostreammagic: debug
It looks like the StreamMagic library's task is getting cancelled which indicates an error was thrown.
I added the logger configuration and was able to reproduce the issue. However, the logs still only show "websockets.exceptions.ConnectionClosedError: sent 1011 (internal error) keepalive ping timeout; no close frame received.". Please see the logs: home-assistant_2024-10-04T05-50-36.742Z.log
I reproduced the issue by switching channels via HomeKit. After some switching, the Evo 150 displayed the "Network initialization" screen, which suggests that something crashed and restarted on the device due to the external commands. This issue does not occur when performing the same actions using the StreamMagic app.
The Evo 150 remained unresponsive to commands sent via Home Assistant. I reloaded the integration, but it didn’t help. I had to restart Home Assistant to make it work again, though restarting the Evo 150 was not necessary.
Okay, so just to confirm. The issue begins only when certain commands are issued through the HomeKit bridge and not directly from HA?
At the end of the day, looks like the websocket connection is closed when the unit resets, and the reconnect handler in the integration isn't functioning properly. I'll get the reconnect handler fixed.
The issue occurs when sending commands directly through Home Assistant as well. My earlier tests were only conducted using the HomeKit Bridge.
Your proposed fix makes sense, and I believe it should resolve the issue.
Few clarifications: 1) Do all commands crash the unit, or just specific ones? 2) What mode (source) are you in while testing? Does this occur in other sources as well? 3) Do you get Network initialization screen every time it looses connection? 4) Does the Evo 150 have the latest firmware? (What version is it currently on?)
There are two issues to this issue. The first is the reconnect handler which will I'm currently fixing. The other is tracking down why the unit is crashing in the first place.
While testing to identify a pattern, I was able to reproduce the "network initialization" screen appearing with the StreamMagic app. I could consistently reproduce the issue by waking the device from network standby and immediately switching from Aux to AirPlay, then back to Aux. This suggests the issue is related to the Evo 150's firmware and not related to HA integration. It only seems to occur when the device is freshly woken from network standby, as I was unable to replicate the issue during regular use. The Evo 150 is running the latest firmware (v134-b-008).
The Home Assistant integration hooks into the same API as the StreamMagic app, so that result makes sense. The linked pull request above is to fix the reconnect handler which will allow the integration to silently reconnect without the need to do a manual reload / restart.
The problem
I attempted to use the new Cambridge Audio Integration with my Evo 150, but after a short period, the device state is no longer updated. For example, it continues to show as 'on' even though I turned it off using the physical buttons on the device. Additionally, attempting to send commands to the device through Home Assistant or the HomeKit Bridge has no effect. The attached debug log contains the corresponding error messages. Previously, I was using custom component cambridge_cxn without any issues.
What version of Home Assistant Core has the issue?
2024.10.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Cambridge Audio
Link to integration documentation on our website
https://www.home-assistant.io/integrations/cambridge_audio/
Diagnostics information
config_entry-cambridge_audio-01J986B79X8504V0YZAPAM9BTN.json
Example YAML snippet
No response
Anything in the logs that might be useful for us?
home-assistant_cambridge_audio_2024-10-03T18-50-36.402Z.log
Additional information
No response