Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Sonos binding: problem with mute channel #1900

Closed
lolodomo opened this issue Jul 23, 2016 · 5 comments
Closed

Sonos binding: problem with mute channel #1900

lolodomo opened this issue Jul 23, 2016 · 5 comments

Comments

@lolodomo
Copy link
Contributor

lolodomo commented Jul 23, 2016

Assuming your Sonos sound is not mutted, you use the switch associated to the "mute" channel in UI to mute it. That works but immediately after the switch state is restored to OFF state. Important, I am using a switch with autoupdate=false.

Tested with beta 3.

Just in case it could help: if I correctly remember, there is something weird with mute in the Sonos firmware: you have to ignore case because sometimes you get "mute" rather than "Mute" or the reverse.

@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 23, 2016

I investigated this issue and discovered what's wrong.
In methoid onValueReceived, the value is compared to "On" while the received value is either "0" or "1". As a result, "1" leads to set the channel to OFF state (instead of ON state).

                case "MuteMaster": {
                    logger.debug("onValueReceived MuteMaster {}", stateMap.get("MuteMaster"));
                    State newState = UnDefType.UNDEF;
                    if (stateMap.get("MuteMaster") != null) {
                        if (stateMap.get("MuteMaster").equals("On")) {
                            newState = OnOffType.ON;
                        } else {
                            newState = OnOffType.OFF;
                        }
                    }
                    updateState(new ChannelUID(getThing().getThingTypeUID(), getThing().getUID(), MUTE), newState);
                    break;
                }

Why checking "On" value ? Do I miss something ?
This comparison with "On" is done for several variables: CurrentLEDState, GroupCoordinatorIsLocal, MuteMaster, LineInConnected, AlarmRunning,

@kgoderis
Copy link
Contributor

This could very well be due to a change in the Sonos firmware. The binding was developed a number of firmware iterations ago and I do not test it fully against each firmware update. Any ways you found the issue and it only requires a quick fix

Sent from my iPhone

On 23 Jul 2016, at 20:42, lolodomo notifications@github.com wrote:

I investigated this issue and discovered what's wrong.
In methoid onValueReceived, the value is compared to "On" while the received value is either "0" or "1". As a result, "1" leads to set the channel to OFF state.

            case "MuteMaster": {
                logger.debug("onValueReceived MuteMaster {}", stateMap.get("MuteMaster"));
                State newState = UnDefType.UNDEF;
                if (stateMap.get("MuteMaster") != null) {
                    if (stateMap.get("MuteMaster").equals("On")) {
                        newState = OnOffType.ON;
                    } else {
                        newState = OnOffType.OFF;
                    }
                }
                updateState(new ChannelUID(getThing().getThingTypeUID(), getThing().getUID(), MUTE), newState);
                break;
            }

Why checking "On" value ? Do I miss something ?
This comparison with "On" is done for several variables: CurrentLEDState, GroupCoordinatorIsLocal, MuteMaster, LineInConnected, AlarmRunning,


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@lolodomo
Copy link
Contributor Author

I let you propose a fix ?
Please check all the channels where there is this comparison with "On".

@lolodomo
Copy link
Contributor Author

I will propose the fix.

kaikreuzer pushed a commit that referenced this issue Aug 2, 2016
Player UI actions are now working when applied to a slave member of a group.
Implement exception for missing zone player handler
Fix NPE when no thing is defined for the group coordinator
Change of state is fixed for GroupCoordinatorIsLocal, MuteMaster, LineInConnected and AlarmRunning.
saveAllPlayerState andrestoreAllPlayerState are now considering really all Sonos players.
Deprecated calls to updateState have been updated.
Fix: method onValueReceived: add a missing break in the java switch
Fix: method updateSleepTimerDuration: onValueRecived was called with service "DeviceProperties" rather than "AVTransport"
Enhancement: add a warning message if the handler for a zone player is not found (when searching the handler of the group coordinator)
Enhancement: quick refresh of the zone name without waiting for the polling job
Enhancement: quick refresh of the sleep timer when updated from the Sonos application (without waiting for the polling job)
Enhancement: quick refresh of the LED state when updated from Eclipse Smarthome / openHAB

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@kaikreuzer
Copy link
Contributor

fixed by #1905

cdjackson added a commit to cdjackson/smarthome that referenced this issue Aug 8, 2016
* master:
  Group item configuration (eclipse-archived#1968)
  added possibility to manage group functions through REST API (eclipse-archived#1963)
  eclipse-archived#1947: Create new method in DiscoveryServiceRegistry to expose discovery service timeout (eclipse-archived#1964)
  Fix scrollbar bug, add responsive images (eclipse-archived#1973)
  switched to composite update site for JmDNS (eclipse-archived#1966)
  Sonos binding: title channel for radio reset in a first time: (eclipse-archived#1965)
  Sonos binding: fix issues 1600 1942 1943 1944 1045 eclipse-archived#1954 (eclipse-archived#1957)
  Feature/eclipse-archived#1955 wemo discovery (eclipse-archived#1961)
  implemented the ThingTypeMigrator service (eclipse-archived#1958)
  Refactored core.persistence bundle (eclipse-archived#1962)
  Sonos binding: fix issues eclipse-archived#1900 and eclipse-archived#1902 (eclipse-archived#1905)
  don't register service if client has already gone (eclipse-archived#1949)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants