kovalev-sergey / homebridge-sony-audio

HomeKit integration for Sony Audio products
Apache License 2.0
15 stars 1 forks source link

Control sound with control center remote #2

Closed ojoaosemtil closed 3 years ago

ojoaosemtil commented 3 years ago

Hello, I’ve been using the plugin, but still it’s not possible to control the device through remote control from the control center. Are you working on it? If yo need some help testing, let me know!

Thank u!

kovalev-sergey commented 3 years ago

Hello, @ojoaosemtil I forgot about them, because I asked to open new issue for them. Sorry.

But i'm ready. Can you drop the Homebridge logs in debug mode when trying to change the volume?

ojoaosemtil commented 3 years ago

Hello! Yes, I forgot to create a new issue, sorry! Ahah So, here it is:

[17/03/2021, 22:22:10] [SonyAudio] Set Characteristic VolumeSelector -> 0 [17/03/2021, 22:22:10] [SonyAudio] Set Characteristic Active -> 1 [17/03/2021, 22:22:10] [SonyAudio] Device HT-ZF9: Device API got an error: {"error":[40000,"Request Retry"],"id":55} [17/03/2021, 22:22:10] [SonyAudio] Set Characteristic Active -> true [17/03/2021, 22:22:10] [SonyAudio] Set Characteristic Mute -> false [17/03/2021, 22:22:10] [SonyAudio] Set Characteristic ActiveIdentifier -> 2 [17/03/2021, 22:22:11] [SonyAudio] Set Characteristic VolumeSelector -> 1 [17/03/2021, 22:22:12] [SonyAudio] Set Characteristic VolumeSelector -> 0

[17/03/2021, 22:22:25] [SonyAudio] Set Characteristic RemoteKey -> 5 17/03/2021, 22:22:25] [homebridge-sony-audio] Characteristic 'Remote Key': SET handler returned write response value, though the characteristic doesn't support write response. See https://git.io/JtMGR for more info. [17/03/2021, 22:22:25] [homebridge-sony-audio] Error: at RemoteKey.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2032:105) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1661:22 at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:9:18 at SonyAudioAccessory.callbackWrapper (/usr/local/lib/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:280:5) at SonyAudioAccessory.setRemoteKey (/usr/local/lib/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:351:12) at RemoteKey.emit (events.js:315:20) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1630:16 at new Promise () at RemoteKey. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1628:14) at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27) at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57) at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75 at new Promise () at Object.__awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16) at RemoteKey.Characteristic.handleSetRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:791:24) at Accessory. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1741:29)

kovalev-sergey commented 3 years ago

Can't find the problem I added some more logging

Could you re-throw the logs in debug mode (starting with device initialization)?

You need to update the plugin before doing this.

ojoaosemtil commented 3 years ago

Ok here it is:

[20/03/2021, 12:00:19] [SonyAudio] Start registering a new device from the description: http://192.168.1.88:54380/MediaRenderer_HT-ZF9.xml [20/03/2021, 12:00:19] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"method\":\"getInterfaceInformation\",\"id\":33,\"params\":[],\"version\":\"1.0\"}" [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[{"interfaceVersion":"5.0.0","modelName":"HT-ZF9","productCategory":"homeTheaterSystem","productName":"SoundBar","serverName":""}],"id":33} [20/03/2021, 12:00:20] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"id\":5,\"method\":\"getSupportedApiInfo\",\"params\":[{\"services\":null}],\"version\":\"1.0\"}" [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[[{"apis":[{"versions":[{"version":"1.2"}],"name":"getApplicationList"},{"name":"switchNotifications","versions":[{"protocols":["websocket:jsonizer"],"version":"1.0"}]}],"service":"appControl","protocols":["xhrpost:jsonizer","websocket:jsonizer"]},{"apis":[{"versions":[{"version":"1.1"}],"name":"getSoundSettings"},{"versions":[{"version":"1.0"}],"name":"getSpeakerSettings"},{"versions":[{"version":"1.1"}],"name":"getVolumeInformation"},{"versions":[{"version":"1.1"}],"name":"setAudioMute"},{"versions":[{"version":"1.1"}],"name":"setAudioVolume"},{"versions":[{"version":"1.1"}],"name":"setSoundSettings"},{"versions":[{"authLevel":"generic","version":"1.0"}],"name":"setSpeakerSettings"},{"name":"switchNotifications","versions":[{"protocols":["websocket:jsonizer"],"version":"1.0"}]}],"service":"audio","protocols":["xhrpost:jsonizer","websocket:jsonizer"],"notifications":[{"versions":[{"version":"1.0"}],"name":"notifyVolumeInformation"}]},{"apis":[{"versions":[{"version":"1.0"}],"name":"getAvailablePlaybackFunction"},{"versions":[{"version":"1.0"}],"name":"getBluetoothSettings"},{"versions":[{"version":"1.0"}],"name":"getCurrentExternalTerminalsStatus"},{"versions":[{"version":"1.0"}],"name":"getPlaybackModeSettings"},{"versions":[{"version":"1.2"}],"name":"getPlayingContentInfo"},{"versions":[{"version":"1.0"}],"name":"getSchemeList"},{"versions":[{"version":"1.2"}],"name":"getSourceList"},{"versions":[{"version":"1.0"}],"name":"getSupportedPlaybackFunction"},{"versions":[{"version":"1.1"}],"name":"pausePlayingContent"},{"versions":[{"version":"1.0"}],"name":"scanPlayingContent"},{"versions":[{"authLevel":"generic","version":"1.0"}],"name":"setBluetoothSettings"},{"versions":[{"version":"1.1"}],"name":"setPlaybackModeSettings"},{"versions":[{"version":"1.2"}],"name":"setPlayContent"},{"versions":[{"version":"1.0"}],"name":"setPlayNextContent"},{"versions":[{"version":"1.0"}],"name":"setPlayPreviousContent"},{"versions":[{"version":"1.1"}],"name":"stopPlayingContent"},{"name":"switchNotifications","versions":[{"protocols":["websocket:jsonizer"],"version":"1.0"}]}],"service":"avContent","protocols":["xhrpost:jsonizer","websocket:jsonizer"],"notifications":[{"versions":[{"version":"1.0"}],"name":"notifyAvailablePlaybackFunction"},{"versions":[{"authLevel":"private","version":"1.0"}],"name":"notifyPlayingContentInfo"}]},{"apis":[{"versions":[{"version":"1.0"}],"name":"getSupportedApiInfo"}],"service":"guide","protocols":["websocket:jsonizer"]},{"apis":[{"versions":[{"authLevel":"generic","version":"1.0"}],"name":"actSWUpdate"},{"versions":[{"version":"1.0"}],"name":"connectBluetoothDevice"},{"versions":[{"version":"1.0"}],"name":"getAlexaDeviceInfo"},{"versions":[{"version":"1.0"}],"name":"getAlexaRegistrationStatus"},{"versions":[{"version":"1.0"}],"name":"getEciaDeviceInfo"},{"versions":[{"version":"1.0"}],"name":"getDeviceMiscSettings"},{"versions":[{"version":"1.0"}],"name":"getInterfaceInformation"},{"versions":[{"version":"1.0"}],"name":"getPowerSettings"},{"versions":[{"version":"1.1"}],"name":"getPowerStatus"},{"versions":[{"version":"1.1"}],"name":"getSettingsTree"},{"versions":[{"version":"1.2"}],"name":"getStorageList"},{"versions":[{"version":"1.0"}],"name":"getSupportedApplicationStatusList"},{"versions":[{"version":"1.0"}],"name":"getSWUpdateInfo"},{"versions":[{"version":"1.4"}],"name":"getSystemInformation"},{"versions":[{"version":"1.0"}],"name":"getSystemSupportedFeature"},{"versions":[{"version":"1.0"}],"name":"getWuTangInfo"},{"versions":[{"version":"1.0"}],"name":"setAlexaRegistrationInfo"},{"versions":[{"version":"1.0"}],"name":"setClientInfo"},{"versions":[{"version":"1.0"}],"name":"setDeviceMiscSettings"},{"versions":[{"version":"1.0"}],"name":"setPowerSettings"},{"versions":[{"version":"1.1"}],"name":"setPowerStatus"},{"versions":[{"authLevel":"generic","version":"1.0"}],"name":"setSleepTimerSettings"},{"versions":[{"authLevel":"generic","version":"1.0"}],"name":"setWuTangInfo"},{"versions":[{"version":"1.0"}],"name":"unregistAlexaDevice"},{"versions":[{"version":"1.0"}],"name":"getVoiceCommandGuide"},{"name":"switchNotifications","versions":[{"protocols":["websocket:jsonizer"],"version":"1.0"}]}],"service":"system","protocols":["xhrpost:jsonizer","websocket:jsonizer"],"notifications":[{"versions":[{"authLevel":"none","version":"1.0"}],"name":"notifyAlexaRegistrationStatus"},{"versions":[{"authLevel":"none","version":"1.0"}],"name":"notifyPowerStatus"},{"versions":[{"authLevel":"none","version":"1.1"}],"name":"notifySettingsUpdate"},{"versions":[{"authLevel":"generic","version":"1.1"}],"name":"notifyStorageStatus"},{"versions":[{"authLevel":"none","version":"1.0"}],"name":"notifySWUpdateInfo"}]}]],"id":5} [20/03/2021, 12:00:20] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"method\":\"getSystemInformation\",\"id\":65,\"params\":[],\"version\":\"1.4\"}" [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[{"bdAddr":"44:e4:ee:01:35:f8","generation":"","macAddr":"cc:98:8b:f2:61:29","serialNumber":"5525948","version":"002.315","wirelessMacAddr":"44:e4:ee:0f:3a:28"}],"id":65} [20/03/2021, 12:00:20] [SonyAudio] Adding new accessory: HT-ZF9 [20/03/2021, 12:00:20] [SonyAudio] Compatible device found, added: HT-ZF9 [20/03/2021, 12:00:20] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"method\":\"getCurrentExternalTerminalsStatus\",\"id\":66,\"params\":[],\"version\":\"1.0\"}" Preparing Advertiser for 'HT-ZF9 103E' using bonjour-hap backend! [20/03/2021, 12:00:20] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"id\":50,\"method\":\"getPowerStatus\",\"params\":[],\"version\":\"1.1\"}" Starting to advertise 'HT-ZF9 103E' using bonjour-hap backend! [20/03/2021, 12:00:20] HT-ZF9 103E is running on port 52101. [20/03/2021, 12:00:20] Please add [HT-ZF9 103E] manually in Home app. Setup Code: 031-45-154 [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 opened a socked ws://192.168.1.88:10000/sony/system [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 opened a socked ws://192.168.1.88:10000/sony/audio [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 opened a socked ws://192.168.1.88:10000/sony/avContent [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[[{"active":"active","connection":"connected","iconUrl":"","label":"","meta":"meta:tv","title":"TV","uri":"extInput:tv"},{"active":"active","connection":"connected","iconUrl":"","label":"","meta":"meta:hdmi","title":"HDMI1","uri":"extInput:hdmi?port=1"},{"active":"active","connection":"connected","iconUrl":"","label":"","meta":"meta:hdmi","title":"HDMI2","uri":"extInput:hdmi?port=2"},{"active":"active","connection":"connected","iconUrl":"","label":"","meta":"meta:linemini","title":"Analog","uri":"extInput:line"},{"active":"active","connection":"connected","iconUrl":"","label":"","meta":"meta:btaudio","title":"Bluetooth Audio","uri":"extInput:btAudio"}]],"id":66} [20/03/2021, 12:00:20] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"method\":\"getSchemeList\",\"id\":1,\"params\":[],\"version\":\"1.0\"}" [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[{"standbyDetail":"","status":"active"}],"id":50} [20/03/2021, 12:00:20] [SonyAudio] Set Speaker Characteristic Active -> true [20/03/2021, 12:00:20] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"method\":\"getVolumeInformation\",\"id\":33,\"params\":[{}],\"version\":\"1.1\"}" [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 received initial message {"result":[{"enabled":[],"disabled":[{"name":"notifyVolumeInformation","version":"1.0"}]}],"id":1} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 sent subscribe message {"method":"switchNotifications","id":2,"params":[{"disabled":[],"enabled":[{"name":"notifyVolumeInformation","version":"1.0"}]}],"version":"1.0"} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 received initial message {"result":[{"enabled":[],"disabled":[{"name":"notifyAlexaRegistrationStatus","version":"1.0"},{"name":"notifyPowerStatus","version":"1.0"},{"name":"notifySWUpdateInfo","version":"1.0"},{"name":"notifySettingsUpdate","version":"1.1"},{"name":"notifyStorageStatus","version":"1.1"}]}],"id":1} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 sent subscribe message {"method":"switchNotifications","id":2,"params":[{"disabled":[{"name":"notifyAlexaRegistrationStatus","version":"1.0"},{"name":"notifySWUpdateInfo","version":"1.0"},{"name":"notifySettingsUpdate","version":"1.1"},{"name":"notifyStorageStatus","version":"1.1"}],"enabled":[{"name":"notifyPowerStatus","version":"1.0"}]}],"version":"1.0"} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 received initial message {"result":[{"enabled":[],"disabled":[{"name":"notifyAvailablePlaybackFunction","version":"1.0"},{"name":"notifyPlayingContentInfo","version":"1.0"}]}],"id":1} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 hasn't a notifier notifyExternalTerminalStatus in disabled [{"name":"notifyAvailablePlaybackFunction","version":"1.0"},{"name":"notifyPlayingContentInfo","version":"1.0"}] [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 sent subscribe message {"method":"switchNotifications","id":2,"params":[{"disabled":[{"name":"notifyAvailablePlaybackFunction","version":"1.0"}],"enabled":[{"name":"notifyPlayingContentInfo","version":"1.0"}]}],"version":"1.0"} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 received subscription status {"result":[{"enabled":[{"name":"notifyPowerStatus","version":"1.0"}],"disabled":[{"name":"notifyAlexaRegistrationStatus","version":"1.0"},{"name":"notifySWUpdateInfo","version":"1.0"},{"name":"notifySettingsUpdate","version":"1.1"},{"name":"notifyStorageStatus","version":"1.1"}]}],"id":2} [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[[{"scheme":"extInput"},{"scheme":"storage"},{"scheme":"dlna"},{"scheme":"netservice"},{"scheme":"cast"}]],"id":1} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 received subscription status {"result":[{"enabled":[{"name":"notifyPlayingContentInfo","version":"1.0"}],"disabled":[{"name":"notifyAvailablePlaybackFunction","version":"1.0"}]}],"id":2} [20/03/2021, 12:00:20] [SonyAudio] Device HT-ZF9 received subscription status {"result":[{"enabled":[],"disabled":[{"name":"notifyVolumeInformation","version":"1.0"}]}],"id":2} [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[[{"maxVolume":50,"minVolume":0,"mute":"off","step":1,"volume":5}]],"id":33} [20/03/2021, 12:00:20] [SonyAudio] Set Characteristic Mute -> false [20/03/2021, 12:00:20] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"id\":37,\"method\":\"getPlayingContentInfo\",\"params\":[{}],\"version\":\"1.2\"}" [20/03/2021, 12:00:20] [SonyAudio] Response from device: {"result":[[{"contentKind":"music","mediaType":"music","parentUri":"extInput:hdmi?port=2","source":"extInput:hdmi?port=2","stateInfo":{"state":"STOPPED"},"uri":"extInput:hdmi?port=2"}]],"id":37} [20/03/2021, 12:00:20] [SonyAudio] Set Characteristic ActiveIdentifier -> 2 [20/03/2021, 12:00:22] [SonyAudio] Start registering a new device from the description: http://0.0.0.0:1901/index.html [20/03/2021, 12:00:25] [SonyAudio] Start registering a new device from the description: http://192.168.1.18:80/description.xml [20/03/2021, 12:00:25] [SonyAudio] Start registering a new device from the description: http://192.168.1.18:80/description.xml [20/03/2021, 12:00:25] [SonyAudio] Error response from device during discovery. Url or UDN is not found: Url:undefined, UDN:uuid:2f402f80-da50-11e1-9b23-001788a68c1e [20/03/2021, 12:00:26] [SonyAudio] Error response from device during discovery. Url or UDN is not found: Url:undefined, UDN:uuid:2f402f80-da50-11e1-9b23-001788a68c1e [20/03/2021, 12:00:27] [SonyAudio] Start registering a new device from the description: http://0.0.0.0:1901/index.html [20/03/2021, 12:00:32] [SonyAudio] Start registering a new device from the description: http://0.0.0.0:1901/index.html

When I try to change volume, this happens:

[20/03/2021, 12:07:18] [SonyAudio] Set Characteristic VolumeSelector -> 0 [20/03/2021, 12:07:18] [SonyAudio] Set Power Characteristic Active -> 1 [20/03/2021, 12:07:18] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"id\":55,\"method\":\"setPowerStatus\",\"params\":[{\"status\":\"active\"}],\"version\":\"1.1\"}" [20/03/2021, 12:07:18] [SonyAudio] Response from device: {"error":[40000,"Request Retry"],"id":55} [20/03/2021, 12:07:18] [SonyAudio] Device HT-ZF9: Device API got an error: {"error":[40000,"Request Retry"],"id":55} [20/03/2021, 12:07:18] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"id\":50,\"method\":\"getPowerStatus\",\"params\":[],\"version\":\"1.1\"}" [20/03/2021, 12:07:18] [SonyAudio] Response from device: {"result":[{"standbyDetail":"","status":"active"}],"id":50} [20/03/2021, 12:07:18] [SonyAudio] Set Speaker Characteristic Active -> true [20/03/2021, 12:07:18] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"method\":\"getVolumeInformation\",\"id\":33,\"params\":[{}],\"version\":\"1.1\"}" [20/03/2021, 12:07:18] [SonyAudio] Response from device: {"result":[[{"maxVolume":50,"minVolume":0,"mute":"off","step":1,"volume":5}]],"id":33} [20/03/2021, 12:07:18] [SonyAudio] Set Characteristic Mute -> false [20/03/2021, 12:07:18] [SonyAudio] Request to device http://192.168.1.88:10000/sony: "{\"id\":37,\"method\":\"getPlayingContentInfo\",\"params\":[{}],\"version\":\"1.2\"}" [20/03/2021, 12:07:18] [SonyAudio] Response from device: {"result":[[{"contentKind":"music","mediaType":"music","parentUri":"extInput:hdmi?port=2","source":"extInput:hdmi?port=2","stateInfo":{"state":"STOPPED"},"uri":"extInput:hdmi?port=2"}]],"id":37} [20/03/2021, 12:07:18] [SonyAudio] Set Characteristic ActiveIdentifier -> 2

kovalev-sergey commented 3 years ago

I think I found the problem please check in the new version

ojoaosemtil commented 3 years ago

Yap, it is working!

Another thing, the three buttons do nothing. is it possible to assign some action? It would be nice to turn on or off the vertical sound, the “i” button could show the same as the display button in the remote control so we can see wich audio type is playing, is it possible?

kovalev-sergey commented 3 years ago

Cool!

Unfortunately Sony does not provide the ability to control navigation on audio devices, unlike TVs. ¯_(ツ)_/¯ That is, it is not yet possible to make a full replacement of the remote. Maybe in the future Sony will make an update, and I will immediately implement it.

Can you explain about “to turn on or off the vertical sound”. What is mean?

kovalev-sergey commented 3 years ago

Ps. I found another error in your log, but it not critical and I fix it later

ojoaosemtil commented 3 years ago

Oh I see, I suspected it would be something like that ahah The vertical sound is a feature wich, virtually, turns the audio into a “virtual Atmos” even if it is only 2.0 or 5.1, and sometimes it is better to keep it off ahah

kovalev-sergey commented 3 years ago

I'll think about how this can be done. Each device has different capabilities and it is impossible to be rigidly tied to any specific settings, otherwise devices that do not support this may not work.

ojoaosemtil commented 3 years ago

I get it, it’s perfect this way, for me volume control is the most important feature and it is working! Thank you very much!

kovalev-sergey commented 3 years ago

I suspected it ))