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: the play and say console commands not working #1784

Closed
lolodomo opened this issue Jan 28, 2017 · 7 comments
Closed

Chromecast: the play and say console commands not working #1784

lolodomo opened this issue Jan 28, 2017 · 7 comments

Comments

@lolodomo
Copy link
Contributor

With my Freebox Player Mini 4k (Android TV), the following console commands are not working (the palyer is switching to a notification screen but the audio file is never played):

openhab> smarthome:audio play chromecast:chromecast:68531fbf51cfff589ca6043630b411bb doorbell.mp3
openhab> smarthome:audio play chromecast:chromecast:68531fbf51cfff589ca6043630b411bb barking.mp3
openhab>
openhab> smarthome:voice say voici un essai de texte
@lolodomo
Copy link
Contributor Author

Here is a warning I get:

13:19:30.240 [WARN ] [su.litvak.chromecast.api.v2.Channel ] - Unable to process request ID = 62, data: {"responseType":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"BUFFERING","currentTime":0,"supportedMediaCommands":15,"volume":{"level":1,"muted":false},"media":{"contentId":"http://192.168.1.xx:8080/audio/0f501ff6-50a2-4a5d-b06e-fdccd6ab8881","contentType":"audio/mpeg","metadata":{"title":"Notification","thumb":null},"duration":0},"currentItemId":1,"items":[{"itemId":1,"media":{"contentId":"http://192.168.1.xx:8080/audio/0f501ff6-50a2-4a5d-b06e-fdccd6ab8881","contentType":"audio/mpeg","metadata":{"title":"Notification","thumb":null},"duration":0},"autoplay":true,"customData":null}],"repeatMode":"REPEAT_OFF"}],"requestId":62}

@lolodomo
Copy link
Contributor Author

@watou : could it be a problem with the proxy?

Are these commands working well with the official Chromecast products?

@watou
Copy link

watou commented Jan 29, 2017

could it be a problem with the proxy?

The proxy servlet in ESH is only for Image and Video sitemap widgets (presently) and cannot serve any other purpose. I have proposed here to securely generalize its function so non-sitemap-based UIs can traverse it.

@lolodomo
Copy link
Contributor Author

Sorry I certainly made a confusion, this URL is an URL for an audio file delivered by openHAB, no link with the UI proxy.

@lolodomo
Copy link
Contributor Author

Ok, maybe chromecast needs to establish several connections to the audio stream ?
The binding uses the audio servlet in such a way that only one access is possible: https://github.com/openhab/openhab2-addons/blob/master/addons/binding/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/handler/ChromecastHandler.java#L282
I will check what happens if a duration is defined by the binding.

@lolodomo
Copy link
Contributor Author

lolodomo commented Jan 29, 2017

Ok I can confirm that defining a duration (and so allowing multiple connections) solves this issue.

Another "problem" is that at the end of the notification, google cast player is not closed.

@lolodomo
Copy link
Contributor Author

The problem is now fixed by the proposed PR.

In addition, I tried to close the application using chromecast.stopApp() when IDLE media_status is received but it leads to either NPE or problems.

ibaton pushed a commit to ibaton/openhab2-addons that referenced this issue Jan 31, 2017
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Markinus pushed a commit to Markinus/openhab2-addons that referenced this issue Feb 8, 2017
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
fharni pushed a commit to fharni/openhab2-addons that referenced this issue Feb 10, 2017
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
jarlebh pushed a commit to jarlebh/openhab2-addons that referenced this issue Mar 4, 2017
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
tratho pushed a commit to tratho/openhab2-addons that referenced this issue May 5, 2017
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants