nugget / python-anthemav

Python asyncio module to interface with Anthem AVM and MRX receivers
MIT License
15 stars 26 forks source link

Didn't turn on in the Hass UI #13

Closed luxus closed 3 years ago

luxus commented 4 years ago

i have a MRX 520 FW_14095_2018_10_23 Home Assistant 0.108.5

The Problem is that i can see the the receiver and i can turn it off. if i turn it on the AV goes on but the mediaplayer in hass didnt see it and still show it as OFF when i restart Hass it will see the AV again (shown as on)

i dont know if it is related i got a warning in the log:

Logger: anthemav.protocol
Source: __main__.py:342
First occurred: 2:08:46 AM (2 occurrences)
Last logged: 2:08:47 AM

ICN update received
Cannot execute recognized command: Z1DYN?

Originally posted by @luxus in https://github.com/nugget/python-anthemav/issues/12#issuecomment-614547387

carlkesselman commented 4 years ago

I am perhaps seeing a related issue which is that if I use the HA command to turn the anthem on, that the state doesn't get updated and shows off. This can be seen via the devlopers interface.

carlkesselman commented 4 years ago

I have been poking around, and I see something suspect:

@power.setter
def power(self, value):
    self.log.debug('Setting power  from {} to {}', self._Z1POW, value)
    self._set_boolean('Z1POW', value)
    self._set_boolean('Z1POW', value)

Based on my reading of the Anthem documents, the second to Z1POW is not required using the IP protocol. On the other hand, if I"m reading the code correctly, once the Z1POW command is sent to the reciver, as it stands, the attribute value in AVR is never updated, and refresh_all never called.

The following version seems to work:

@power.setter
def power(self, value):
    self.log.debug('Setting power  from {} to {}', self._Z1POW, value)
    self._set_boolean('Z1POW', value)
    self.query('Z1POW')
luxus commented 4 years ago

@carlkesselman thanks i made a pullrequest.. (did it on my phone.. sorry for the lack of documentation ):D

Hyralex commented 3 years ago

Hi,

I don't think this solution would cover the scenario where you directly turn on the AVR from the remote or power button. The problem is the AVR doesn't send Z1POW1; command when it turns on (at least on my MRX 520 model).

I have another implementation that force querying Z1POW? command when the current state is off and we receive any commands from the AVR. I have some work in progress to fix all of that and bring more functionality to home assistant (UI integration, added Sound Mode selection and fix this bug)