Closed M1cN closed 1 year ago
@webnar Late response, but I just installed the binding and started an app. Did not see the behavior you described with openHAB 3.4.0. Can you confirm this is still an issue? If this is still an issue, can you let me know the model and firmware version of your Chromecast?
Played around with the binding the last days, also to solve some other issues. And have seen the behavior you described. The main cause seems to be that not every app uses the same framework/lib / SDK version. And/or not every app respects the API-specification.
The binding is receiving events from the chromecast device and reports them to the openHAB event bus. For example starting the Disney app; three events are received bij the binding. So the cycle is: UNDEF to Disney+ to AndroidNativeApp to Disney+.
I don't give up yet, but not sure if this is fixable.
Edit: I can confirm when starting an app, 2 events are received. Some times the first has a null value for running application, some times it has an intermediate value (like AndroidNativeApp) depending on the app started. I don't see a way of reliable determining if the event is an intermediate one. When closing the app, i can only see 1 event just as how it should be.
As the binding reflects the behavior from the depending library / API and there doesn't seem to be a reliable workaround. I think we can only close this issue as not fixable.
Possible workaround for some use cases, outside of the binding: If you start an apllication you can see the transition in event log, if you create rules you can filter out the intermediate states. Or even better, only trigger the rule when the app changes from intermedita to final. In case of @webnar example:
rule "Start scene when app started"
when
Item 2F_Slaapkamer_Shield_App changed to "Disney+"
or Item 2F_Slaapkamer_Shield_App changed to "Emby"
then
// do work
end
Please re-open if there is more to add or if someone has a better workaround.
Expected Behavior
The binding in Openhab 3.0 should provide the currently running App and AppID in each channel. In Openhab 2 it works perfectly.
Current Behavior in Openhab 3
Currently, it is showing the name and instantly changes it back to AndroidNativeApp.
Possible Solution
Don't know I'm a user not a developer, I hope you guys can think of a solution.
Steps to Reproduce (for Bugs)
Start a video on a Chromecast device on Openhab3.0
Your Environment
Hardware: i7 with 64GB Ubuntu 20.04 x64 Running Docker(migrating from OH2 to OH3): Old prod: OH Version 2.5.10 Binding version: 2.5.10 New prod: OH Version 3.0.0 Build 2050 Binding version: 3.0.0.SNAPSHOT (I'm only running one instance of Chromecast at the same time)