I’m hoping to integrate my tablet into HA and then use it as a media player client to initiate triggered alarm siren through bluetooth speakers throughout the house. I’ve installed the “Home Assistant” android app, but it doesn’t create a media_player entity and doesn’t seem to keep data refreshed. I’m considering trying ADB debugging approach, but don’t really know if there are any side effects.
Also, as my title/subject states I’m running Fully Kiosk Browser, which works great and has a published API which possibly could make a nice integration with HA.
It is a Lenovo Tab M10 FHD Plus. I got it mainly because of the screen resolution of 1920x1200 px. It shows most of my dashboard. There’s currently about a 1 inch scroll up showing my fans.
I don’t think it will work because it will shove the app to the background, but you could install Kodi on the tablet and then it will show up as a media player in HA (there may be a way to still get audio without displaying the video).
I did not do this on a tablet but I did make my own media player speaker with a usb speaker and a Raspberry Pi, and that works great with my Mary TTS container.
Thanks @GlennHA, I read a thread earlier where someone had made the same suggestion. Yes, I believe that is one option, but I don’t want to tax the tablet resources.
After posting my question, I continued to search for answers and believe I’ve found the solution; browser_mod. It literally integrates the web browser as a media player and lots more. I’m reading up on it now. It looks like it will even allow me to better manage dashboard real estate. I will follow-up with my findings.
@TechBrain64 Try browser-mod. It will expose your tablet as a media_player entity, and you will be able to play any music file you want.
I am using it myself on my wall tablet to make tts announcements or play mp3 files when various timers run out.
Edit:
Also, since you’ve talked about suggestions…
Fully kiosk can provide a live feed from your tablet’s camera. I enable this feature every time my alarm gets armed, so that i can have a face snapshot of someone that would potentially try to mess with the tablet.
The ip of the feed would be similar to http://192.168.*.*:2323/?cmd=getCamshot&password=*** which you can implement into HA use the generic_camera component.
In order for Fully kiosk to capture the camera feed you need to enable motion detection with the following command
curl -X GET "http://192.168.*.*:2323/?cmd=setBooleanSetting&key=motionDetection&value=true&password=***"
After installing/configuring “browser_mod” integration here is my impression. As stated it does enable a media_player entity for my tablet and laptop. However, after a routine HA reboot or tablet goes to sleep all the media_players/sensors disappear until the devices browser are refreshed. The author of browser_mod denotes this fact in his FAQ and suggest using “force_stay_awake: true” in configuration. I’ve done so and still getting sporadic results.
@TechBrain64 What i’ve done to get around this issue is to wake the tablet and/or refresh the browser before casting anything.
curl -X GET "http://192.168.*.*:2323/?cmd=screenOn&password=***"
curl -X GET "http://192.168.*.*:2323/?cmd=loadStartUrl&password=***"
It adds a 2-3 second delay, but after the Fully kiosk refreshes the page, the browser mod entities instantly become available.
Apart from that, I literally can’t imagine using home assistant whithout browser mod.
Every single card in my lovelace links to a new pop-up card (browser_mod.popup). Also, my entrance camera popups on the tablet screen whenever there is motion. So, have a look at its other uses, besides the media player.
Based on install comprising latest version of the Fully Kiosk Integration (as at 17 March 2023), HA 2023.3.3 AND no installation of browser_mod, the following works for me on my old Samsung Galaxy Tab S SM-T800 (flashed with Lineage 14.1 = Android 7.1.2) running Fully Kiosk 1.5:
Does it work reliably? I can’t make it work no matter what I do. The following is the log from fully kiosk side:
04-18 07:22:31.697 7095 18983 I ExoPlayerWrapper: uri is http://192.168.1.xxx:8123/local/media/1417.wav type is 3
04-18 07:22:31.698 7095 18983 I ExoPlayerWrapper: isSupportFormat is false
04-18 07:22:31.698 7095 18983 V MediaHTTPService: MediaHTTPService(android.media.MediaHTTPService@6c65a23): Cookies: null
04-18 07:22:31.708 7095 18983 W MediaPlayer: Use of stream types is deprecated for operations other than volume control
04-18 07:22:31.709 7095 18983 W MediaPlayer: See the documentation of setAudioStreamType() for what to use instead with android.media.AudioAttributes to qualify your playback use case
04-18 07:22:31.713 7095 23546 V MediaHTTPService: makeHTTPConnection: CookieHandler (java.net.CookieManager@95764cc) exists.
04-18 07:22:31.713 7095 23546 V MediaHTTPService: makeHTTPConnection(android.media.MediaHTTPService@6c65a23): cookieHandler: java.net.CookieManager@95764cc Cookies: null
04-18 07:22:31.868 7095 7095 I MediaPlayer: [exo-MEDIA_PLAYBACK_COMPLETE]-receive
04-18 07:22:31.900 7095 7095 V MediaPlayer: resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
04-18 07:22:31.900 7095 7095 V MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
04-18 07:22:32.086 7095 7104 W System : A resource failed to call end.
04-18 07:22:35.005 7095 18983 D ConnectivityManager: getMobileDataEnabled()- remote exception retVal=false
and this is the automation trigger config in HA side: