nicoduj / homebridge-harmony

Harmony websocket plugin for homebridge
The Unlicense
215 stars 23 forks source link

[BUG]PLAY and PAUSE commands not working #363

Closed maisun closed 3 years ago

maisun commented 3 years ago

Describe the bug Not 100% sure if it's a bug but I have overriding PLAY/PAUSE commands in a few of activities, today I found them not working anymore. There was no recent change to configuration file, and I use function not very often so not sure if it was brought by one of recent update, it used to work without issue.

To Reproduce Define configuration to override PLAY and PAUSE commands, use the remote in iOS press the Play/Pause button nothing happens. I also experienced this issue with my other activities.

Expected behavior When press Play/Pause button, the defined command is triggered

Screenshots If applicable, add screenshots to help explain your problem.

IOS (please complete the following information):

Logs When play/pause is pressed 5/8/2021, 10:45:06 AM] [Logitech Harmony] (Logitech Harmony)INFO - SET Characteristic.RemoteKey : 11 with currentActivity 45280979 [5/8/2021, 10:45:06 AM] [Logitech Harmony] (Logitech Harmony)INFO - current play status is : undefined with playPause option set to :true [5/8/2021, 10:45:06 AM] [Logitech Harmony] (Logitech Harmony)INFO - pauseCommand defined for : 45280979 is undefined [5/8/2021, 10:45:06 AM] [Logitech Harmony] (Logitech Harmony)INFO - sending PlayCommand for PLAY_PAUSE [5/8/2021, 10:45:06 AM] [homebridge-harmony] This plugin threw an error from the characteristic 'Remote Key': Unhandled error thrown inside write handler for characteristic: incommingCommandToSend.split is not a function. See https://git.io/JtMGR for more info. [5/8/2021, 10:45:06 AM] [homebridge-harmony] TypeError: incommingCommandToSend.split is not a function at HarmonyBase.sendCommand (/homebridge/node_modules/homebridge-harmony/harmonyBase.js:1767:53) at HarmonySubPlatform.handlePlayPause (/homebridge/node_modules/homebridge-harmony/harmonySubPlatform.js:685:24) at HarmonySubPlatform. (/homebridge/node_modules/homebridge-harmony/harmonySubPlatform.js:858:18) at RemoteKey.emit (events.js:315:20) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1632:16 at new Promise () at RemoteKey. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1630: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 [5/8/2021, 10:45:06 AM] [Logitech Harmony] (Logitech Harmony)INFO - SET Characteristic.Active 1 [5/8/2021, 10:45:06 AM] [Logitech Harmony] (Logitech Harmony)INFO - value of Characteristic.ActiveIdentifier 45280979 [5/8/2021, 10:45:07 AM] [Logitech Harmony] (Logitech Harmony)INFO - not launching, there is a current Activity defined -45280979

I think the plugin found the override configured when the bridge starts: .[37m[5/8/2021, 10:45:01 AM] .[39m.[36m[Logitech Harmony].[39m .[90m(Logitech Harmony)INFO - commands found fo r ovverride : Internet Radio-PLAY:{"command":"Mute","type":"IRCommand","deviceId":"49730126"}.[39m

When other override is used: [5/8/2021, 10:52:12 AM] [Logitech Harmony] (Logitech Harmony)INFO - SET Characteristic.RemoteKey : 6 with currentActivity 45280979 [5/8/2021, 10:52:12 AM] [Logitech Harmony] (Logitech Harmony)INFO - sending command {"command":"PresetPrev","type":"IRCommand","deviceId":"49730126"}for 6 [5/8/2021, 10:52:12 AM] [Logitech Harmony] (Logitech Harmony)INFO - sendingCommand{"command":"PresetPrev","type":"IRCommand","deviceId":"49730126"} 1 times [5/8/2021, 10:52:12 AM] [Logitech Harmony] (Logitech Harmony)INFO - sendCommand done{"cmd":"vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction","code":200,"id":"0.7355585364898574","msg":"OK"}

Config Below is the config for the activity in question: { "ActivityName": "Internet Radio", "CommandsList": [ { "CommandName": "ARROW_RIGHT", "NewCommand": "AV Receiver;NextPreset" }, { "CommandName": "ARROW_LEFT", "NewCommand": "AV Receiver;PrevPreset" }, { "CommandName": "ARROW_UP", "NewCommand": "AV Receiver;Net/UsbUp" }, { "CommandName": "ARROW_DOWN", "NewCommand": "AV Receiver;Net/UsbDown" }, { "CommandName": "SELECT", "NewCommand": "AV Receiver;Net/UsbSelect" }, { "CommandName": "BACK", "NewCommand": "AV Receiver;Net/UsbReturn" }, { "CommandName": "PLAY", "NewCommand": "AV Receiver;Mute" }, { "CommandName": "PAUSE", "NewCommand": "AV Receiver;Mute" } ] }

The option "playPauseBehavior" is set to true.

Additional context N/A

Edit: added with debug logs

maisun commented 3 years ago

Just want to add I also tried to set "playPauseBehavior" to false and the problem persists. There were some change in 1.5.0 related to those overrides not sure if anything was broken since then.

nicoduj commented 3 years ago

Hi,

thx for reporting, probably a bug. Will try to reproduce / fix . Just to narrow the issue, other commands are ok ?

maisun commented 3 years ago

Hi,

thx for reporting, probably a bug. Will try to reproduce / fix . Just to narrow the issue, other commands are ok ?

Yes, I believe all other commands are not affected. Thanks for looking into it!

maisun commented 3 years ago

Hi,

thx for reporting, probably a bug. Will try to reproduce / fix . Just to narrow the issue, other commands are ok ?

@nicoduj have you been able to re-produce it? Please let me know any more info you need from me :-) Many thanks!

nicoduj commented 3 years ago

@maisun Hi, sorry did not have much time to deal with the plugin :) tried something by code reading in 1.5.3 that is on its way, hope it works. If not will take some time later to check / try to reproduce.

maisun commented 3 years ago

@maisun Hi, sorry did not have much time to deal with the plugin :) tried something by code reading in 1.5.3 that is on its way, hope it works. If not will take some time later to check / try to reproduce.

Hi thanks just want to report version 1.5.3 seems to fix the issue.