peteS-UK / sonyavr

Home Assistant Media Player for older Sony AVRs
MIT License
1 stars 0 forks source link

AVR turns off and integration doesn't update after #1

Closed Hans-Solo-Dolo closed 4 months ago

Hans-Solo-Dolo commented 4 months ago

While yesterday it worked, I went back to it today and it was not working anymore. It sets it up initially and immediately turns the AVR off. When I go to turn it back on, it never registers that its on in HA. I reload the integration and just turns the AVR off and never works again.

Here are a couple logs. home-assistant_sonyavr_2024-04-30T21-47-16.071Z.log home-assistant_sonyavr_2024-04-30T21-44-25.492Z.log

peteS-UK commented 4 months ago

Thanks. The turning off when you load is as expected actually... The AVR doesn't allow you to poll any state unless it's on, so the only way to know the power state, current source, mute, volume etc., is to turn it on during that initial load and then make it respond by turning the volume up and down, turn the mute on and off etc., and then I turn it off again. I figure that (once it's working) that only happens when you load the integration (e.g. when you reboot HA), so it's OK.

The logs are strange. Mostly it looks like the HA server can't connect to you AVR at all - it's just timing out when it tries to open the connection, and setting up the listener (which is listening for feedback and changes the states etc.) is timing out.

You've got OSError: [Errno 113] Connect call failed ('192.168.1.60', 33335) right close to the start, which is "no route to host".

However, in the first log there's a bunch of debug responses - these are the feedback coming back from the avr in response to commands - so then it's connected.

So, at 14:44:54.255, it managed to add the device. Then

Command : 0x2, 0x4, 0xa0, 0x60, 0x0, 0x1, 0x0

is turn on, and it responds with

02:07:a8:82:00:1b:1b:21:00:78

02:07:a8:82:00:1b:1b says the current source is bd, and then 21:00:78 says it's powered on, with mute off.

But, then you get "Setup of media_player platform sonyavr is taking over 10 seconds.". That doesn't make any sense as it's already loaded and running at this point. Then at 14:45:05.849, it turns off which I'd expect at the end of the setup. Then I guess you're trying to turn it on manually (that's 0x2, 0x4, 0xa0, 0x60, 0x0, 0x1, 0x0 )

By this stage though, it's difficult to work out what's happening in the log as there's 4 different instances of the entities created, which I guess is you loaded and unloaded it.

Bottom line is the early 113 error seems to just says there's something intermittent in the network connection - whcih would also fit with why it worked yesterday. You've also got "[homeassistant.components.braviatv.coordinator] Error fetching braviatv data: Error communicating with device " in there, which is a different component also having network problems I think.

Could you maybe look at the network comms side, and reboot your HA so that we're starting clean. Please don't just reload the integration as that might not be shutting everything down cleanly - I haven't really tested that TBH.

Buried in the log, there's an "unknown data packet", which is a feedback pattern that's not recognised. ...

02:06:a8:92:00:01:f1:80:4e

This is very similar to what I expect for volume feedback - which is 0x02, 0x06, 0xA8, 0x92, 0x00, 0x03, 0x00. So, I think that's your volume string with the 01:f1 instead of 03:00 and then the 80:4e is the volume probably. That's likely easiest enough to work out by just looking at the feedback string as an unknown packet when changing the volume for know volume values. Anyhow, none of that does anything unless we can sort out this comms problem...

peteS-UK commented 4 months ago

There's 4 different pairs of mediaplayer&remote in there and some of the timed out setup from earlier ones is still runnign when the next one starts, so it's difficult to decipher what's really going on in there. A clean boot and single load will help understnd things if you can make any headway with the 113 error - that's a low level network problem unable to find a route to the avr.

Hans-Solo-Dolo commented 4 months ago

This is after reboot and I rebooted again while enabled. At the end, the AVR is on but integration isn't reflecting it. Not sure what communication issue it could have. Neither of these are in VLANs and HA can talk to everything else on my network just fine. home-assistant_sonyavr_2024-05-01T00-02-19.938Z.log

Hans-Solo-Dolo commented 4 months ago

So far I got it working by turning on network standby in the AVR settings. Duh!

peteS-UK commented 4 months ago

Oh, yes, that'll do it... If you'd like to open a new issue for the volume, I'll take a look. Post the logs for specific volumes set on by the knob and we can see if we can work it out. Does changing the volume in HA do anything on the AVR - i.e. is it just the feedback that's not working, or the command to change the volume as well?

I'll add a comment to the readme on the network standby. and do a bit of error capture at some point.