-
Notifications
You must be signed in to change notification settings - Fork 2
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
Publish message when switch app #1
Comments
Hello, thank you for your feedback. Reporting the app currently displayed in the foreground would be a completely different feature. I'm not even sure there is an API for that, I need to investigate. If there is, I can try to add it and publish the value as a new topic. The current code is based on MediaSession only. As soon as there is one active MediaSession, its application name will be published to the MQTT broker. In case there is more than one active session, the last one is used, unless another one moves to the "playing" state, then it becomes the new current one. Unfortunately each application decides when to set the session as active, and it's usually right before the playback is about to start. Also note that applications can play audio in the background or video in picture-in-picture mode, so an active MediaSession doesn't always mean that the app is in the foreground. |
Thank you for the explanation and the good App you developed |
Thank you. I wrote this in a few days so I could automate lights in a room with an old Android TV that didn't work well with existing Home Assistant integrations. Chromecast did not report anything outside of Chromecast and ADB was too heavy and did not react fast enough. For security reasons, Android apps are quite limited when it comes to accessing other apps information. There seems to be a way to detect the foreground app using an accessibility service so I'll do some tests to see if it works. I don't own a Fire TV so I appreciate if you can confirm that the app works on your device as well. |
I really don't know why no one has done this before and I'm glad you are doing it |
I specifically wrote in the documentation that you should restart the device after typing the ADB command, so this was expected. |
I did a few tests using an
Another technique involves using |
When I switch the app from VLC to YouTube , no publish until the video is played in the YouTube app to :
Topic: mediaSession/1/applicationId
Therefore, if an automation is written based on program switch app in Home Assistant, it will not work properly
Is it possible publish change application without playing video?
The text was updated successfully, but these errors were encountered: