Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chromecast] STOP channel not accepting commands in 3.4.2 #14516

Closed
scatterthought opened this issue Feb 28, 2023 · 21 comments · Fixed by #15357
Closed

[chromecast] STOP channel not accepting commands in 3.4.2 #14516

scatterthought opened this issue Feb 28, 2023 · 21 comments · Fixed by #15357
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@scatterthought
Copy link

Expected Behavior

Sending an ON command to the STOP channel will stop casting to a Chromecast device.

Current Behavior

After upgrading to 3.4.2, the STOP channel no longer accepts ON commands. After downgrading to the 3.4.1 binding, the STOP channel works again.

Possible Solution

I suspect this is related to [chromecast] Fix for NPE when playerState is null #14191. I think there may be an extra } on line 177.

Steps to Reproduce (for Bugs)

  1. Cast to a Chromecast device
  2. Send an ON command to the device's STOP channel

Your Environment

  • Version used: OH 3.4.2
  • Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...): Raspberry Pi 4 4G
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): openHABian
@scatterthought scatterthought added the bug An unexpected problem or unintended behavior of an add-on label Feb 28, 2023
@mhilbush
Copy link
Contributor

I think there may be an extra } on line 177.

If there was an extra }, the binding wouldn't compile. Plus, the changes in the PR you referenced have nothing to do with how the binding handles commands to the stop channel.

Did you consider that this commit, which actually modified the handling of the stop channel, might be in play as well?

@scatterthought
Copy link
Author

Thanks, @mhilbush! I thought that would be the case, but I'm not a programmer.

I only saw #14191 listed in the 3.4.2 release notes, so I didn't think to look for anything else. Apologies, as I don't know my way around Github very well.

@mhilbush
Copy link
Contributor

No worries. I can see how you easily could've drawn that conclusion given the absence of that other commit from the release notes.

@lsiepel
Copy link
Contributor

lsiepel commented Feb 28, 2023

That PR did fix an issue, but might have introduced this. Are you able to provide a debug log ?
I currently don't have my chromecast setup, so i can't look into this before thursday.

Had a quick ook at the code. What app are you trying to stop? Probably not MEDIA_PLAYER ?

@scatterthought
Copy link
Author

I'll provide a debug log later today. No need to rush on my part, as the 3.4.1 binding is working for me.

I don't think I've run into the offline issue you fixed, but I suspect that's due to how I'm set up. I use a group item to manage the STOP channels for all of my Chromecasts. I'm guessing that when I trigger it, the group only passes the ON command to the Chromecasts that are OFF.

@scatterthought
Copy link
Author

What app are you trying to stop? Probably not MEDIA_PLAYER ?

Is that the same as "Default Media Player"? I use that and Spotify regularly, but I can only be certain that it didn't work with Spotify.

@lsiepel
Copy link
Contributor

lsiepel commented Feb 28, 2023

What app are you trying to stop? Probably not MEDIA_PLAYER ?

Is that the same as "Default Media Player"? I use that and Spotify regularly, but I can only be certain that it didn't work with Spotify.

Oke in that case i allready know what is going on. That commit checks if the app is running before closing it. But the check is only for media_player, not for others. So if media_player is not running it exits. In your case spotify is running and it exits.

I'll try to come up with a fix, not sure when, a bit busy now.

@lsiepel lsiepel self-assigned this Feb 28, 2023
@scatterthought
Copy link
Author

Sounds good. I'll test it with the Default Media Player and generate a debug log to confirm. Thanks!

@scatterthought
Copy link
Author

I tested the 3.4.2 binding with Default Media Player, TuneIn Free, and Spotify. As expected, the STOP channel worked for the Default Media Player, but did not work for the other two apps.

I set the binding to debug, but nothing shows up when I trigger STOP to ON. I don't even see the item change in the log. But if I stop the player through Google Assistant, I see the STOP channel change from OFF to ON as expected.

Here's a brief log. I definitely sent an ON command to STOP during this time frame (I bracketed it with volume changes so that I'd know when to cut/paste).

Let me know when you want to test, but like I said before, I'm in no hurry. I can use the 3.4.1 binding for now.

Chromecast debug log.txt

@nils2410
Copy link

We are at version 3.4.4, unfortunately the bug still exists. Anyone know a workaround?

@scatterthought
Copy link
Author

The workaround is to manually install the 3.4.1 binding.

@nils2410
Copy link

nils2410 commented May 10, 2023

Can you please give me a rough description of how this works?
Thank you

@scatterthought
Copy link
Author

  1. Download the .jar file. Here's a direct link to the JFrog repository (which was conveniently still in my Chrome history).
  2. Remove the 3.4.4 Chromecast Binding from your system through Main UI.
  3. Copy the .jar file into your addons folder to manually install it. Your existing things will start using the the manual installation immediately.

@jlaur
Copy link
Contributor

jlaur commented May 10, 2023

When quickly looking through this issue, it seems that it might be a regression of #14158. @lsiepel, any chance you will find time for looking into this issue, as it seems you already had an idea how to fix it?

@lsiepel
Copy link
Contributor

lsiepel commented May 11, 2023

Still have this on my todo list. If someone can ccome up with a fix, don;t wait for me. Otherwise i will fix this as soon as i have some hours of free time.

@lsiepel
Copy link
Contributor

lsiepel commented Jul 28, 2023

Got it fixed. Test jar is here: https://1drv.ms/u/s!AnMcxmvEeupwjq1Zw3n0MTdrkMY4ZQ?e=lEs4Uz

It should work as before (and a little better). When an ON command is send to the STOP channel, it stops the running app.
However not all running apps make this channel go to Off position. I'm pretty sure this has allways been the case. Only some casting and media apps do make it go to Off position. Netflix Disney and Prima don't, will casting with youtube did, so did the default media app.

lsiepel added a commit to lsiepel/openhab-addons that referenced this issue Jul 28, 2023
Signed-off-by: lsiepel <leosiepel@gmail.com>
@scatterthought
Copy link
Author

Cool. Does the test jar work in 3.4? If so, I'll test it this weekend. I haven't upgraded to OH4 yet.

@lsiepel
Copy link
Contributor

lsiepel commented Jul 28, 2023

Cool. Does the test jar work in 3.4? If so, I'll test it this weekend. I haven't upgraded to OH4 yet.

You could give it a try in 3.4, but i think it won't work as some xml files have changes name/structure.

@scatterthought
Copy link
Author

Gotcha. I won't be able to test for awhile then, as I probably won't get to 4 for a few weeks (maybe longer). Thanks!

jlaur pushed a commit that referenced this issue Aug 1, 2023
Fixes #14516

Signed-off-by: lsiepel <leosiepel@gmail.com>
Pshatsillo pushed a commit to Pshatsillo/openhab-addons that referenced this issue Sep 29, 2023
Fixes openhab#14516

Signed-off-by: lsiepel <leosiepel@gmail.com>
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/chromecast-stop-command-does-not-work-anymore/150081/2

jlaur pushed a commit that referenced this issue Oct 7, 2023
Fixes #14516

Signed-off-by: lsiepel <leosiepel@gmail.com>
@sidamos
Copy link
Contributor

sidamos commented Oct 10, 2023

Test JAR fixes the STOP command for me. OH 4.0.2, Nest Hub.

austvik pushed a commit to austvik/openhab-addons that referenced this issue Mar 27, 2024
Fixes openhab#14516

Signed-off-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants