Is this the perfect standalone tablet for HA?

Thanks to @FelixKa, we’ve moved discussion of further rom development to this thread.

I’m excited to contribute. I hope others in the community with applicable skills will join in the fun :nerd_face:

It may take some time for us to make meaningful progress, until then let’s keep supporting our fellow community members and….

PLEASE keep those beautiful dashboard shots coming!

3 Likes

On the topic of the screen not turning off, is there no way to do that using a command/button?

is there no way to do that using a command/button?

One option is to use Fully Kiosk Browser and integrate it with HA, which exposes a light entity for the screen that you can control like any other light in HA. Note that the light entity is not just software dimming (like you get with the Browser Mod integration), it actually changes the screen brightness and can turn it all the way off.

From within FKB you should be able to set a screensaver brightness of 0% after a timeout and use the camera motion to turn the screen on, just like people do with tablets. I want mine always on at my desk, but in my testing this has behaved a little differently than the Fire tablets. I still think it should work though. For my wall tablet I have it turn the screen on with motion in the FKB settings (as well as room motion sensors) but I turn it back off with HA.

Also worth noting is that the camera motion in FKB is a “Plus” paid feature ($9). All plus features are available without paying, but come with a watermark in the app. This means that if all you want is to control the screen you can just use the HA app and control the screen via FKB in the background without paying. IMO, FKB is well worth the price though and I like the other features like being able to load a different view (URL) or automate refreshes (these Lenovo devices seem to become unresponsive at times and it appears you can’t refresh by swiping down in the HA app).

1 Like

those are pre-configured themes, I’m very happy with them too:

in my installation I had to fix the path for the background images before them being available.

also using the layout card extension (GitHub - thomasloven/lovelace-layout-card: 🔹 Get more control over the placement of lovelace cards.) to properly align the cards with grid templates. Was a bit of of fiddling around, but quite happy with it currently.

The thermostat is this one: GitHub - nervetattoo/simple-thermostat: A different take on the thermostat card for Home Assistant ♨️
The weather (with clock, that was important to me) is:GitHub - pkissling/clock-weather-card: A Home Assistant Card indicating today's date/time, along with an iOS inspired weather forecast for the next days with animated icons

2 Likes

I thought there was a long post with detailed instructions on how to install for either Windows, Linux, or Mac but now I can’t find it. The instructions in the original post assume a level of knowledge that I don’t have since I’m a newbie with Linux.

I did some more testing on the display on/off front, maybe someone can read something out of it (I’m not a developer, certainly not an Android developer)

Short version:
Quite a few commands/parameters that I’ve found should turn on/off the screen, or indicate the state don’t to so.
However, the adb shell input keyevent 26 command worked in my tests, to send the screen to sleep.
The mScreenBrightness and mScreenBrightnessModeSetting parameters seem to properly indicate, if the screen is on or off.
I could not find a reliable way yet, to wake the display, nor do I know (yet?) how to make use of these findings to turn off the display without accessing the device over adb.
I’ve actually uninstalled the Home Assistant app in the meantime, so this is not the root cause for the screen not going to sleep. The issue also persists when using WallPanel.

Long version:
There is an adb command to press the “virtual” power button (actually, there are even more than one). It seems that the adb shell input keyevent 26 command on this device does actually only work for turning off the display, it won’t wake the device.

Logcat presents the following output after sending that event:

01-20 15:27:52.336 11186 11186 D AndroidRuntime: Calling main entry com.android.commands.input.Input
01-20 15:27:52.340 11186 11186 I Input   : injectKeyEvent: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_POWER, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=64181066, downTime=64181066, deviceId=-1, source=0x101 }
01-20 15:27:52.342  1206  1352 I PowerManagerService: Going to sleep due to screen timeout (uid 1000)...
01-20 15:27:52.345  1206  1352 D AppOps  : startOperation: allowing code 40 uid 1000 package android
01-20 15:27:52.357 11186 11186 I Input   : injectKeyEvent: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_POWER, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=64181066, downTime=64181066, deviceId=-1, source=0x101 }
01-20 15:27:52.357  1206  1352 I PowerManagerService: Going to sleep due to power button (uid 1000)...
01-20 15:27:52.360  1206  1352 I PowerManagerService: Going to sleep due to screen timeout (uid 1000)...
01-20 15:27:52.363 11186 11186 D AndroidRuntime: Shutting down VM
01-20 15:28:00.001  1206  1269 I PowerManagerService: Going to sleep due to screen timeout (uid 1000)...
01-20 15:28:00.005  1360  1360 D KeyguardUpdateMonitor: received broadcast android.intent.action.TIME_TICK
01-20 15:28:00.006  1360  1360 D KeyguardUpdateMonitor: handleTimeUpdate
01-20 15:28:00.019  1206  1206 I PowerManagerService: Going to sleep due to screen timeout (uid 1000)...
01-20 15:28:43.065  1360  1360 D KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
01-20 15:28:43.065  1322  1808 D HeadsetStateMachine: Disconnected process message: 10, size: 0
01-20 15:28:43.065  1322  1808 D HeadsetStateMachine: Enter processIntentBatteryChanged()
01-20 15:28:43.065  1322  1808 D HeadsetStateMachine: Exit processIntentBatteryChanged()
01-20 15:28:43.065  1322  1808 D HeadsetStateMachine: Exit Disconnected processMessage() 
01-20 15:28:43.067  1577  1577 D QtiCarrierConfigHelper: WARNING, no carrier configs on phone Id: 0
01-20 15:28:43.069  1360  1360 D KeyguardUpdateMonitor: handleBatteryUpdate
01-20 15:28:53.727  1206  1216 I zygote  : Background concurrent copying GC freed 116463(18MB) AllocSpace objects, 18(808KB) LOS objects, 58% free, 12MB/30MB, paused 193us total 150.355ms
01-20 15:29:00.001  1206  1269 I PowerManagerService: Going to sleep due to screen timeout (uid 1000)...

If this command is sent, the screen actually dims more or less immediately, and after the screen timeout setting (at least it appears so), it goes dark completely.

When comparing certain parameters, that should indicate if the screen is currently on or off, I’ve found that most of the values don’t really help. I actually tried the following commands to compare the parameters:

  • adb shell dumpsys display | grep "mScreen"
  • adb shell dumpsys power
  • adb shell dumpsys power | grep mPowerState (no value returned)
  • adb shell dumpsys input_method | grep mInteractive=true

the following return values differed between on and off:

  • mScreenBrightness (on: 255, off: 10)
  • mScreenBrightnessModeSetting (on: 1, off: 0)
  • the Looper state returned 3 messages when the screen was on (including the AutomaticBrightnessHandler when the screen was on), vs. only 1 message when the screen was off
2 Likes

Really appreciate all the effort going into this, we’re seeing some great contributions!

Does this work to change brightness?

adb shell settings put system screen_brightness X

Where X is 1-255

Could we use the following command to ease some of the audio focus problems?

adb shell appops set package.name TAKE_AUDIO_FOCUS ignore

Also, check out PermissionManagerX

Check out @Nerwyn’s post, I finally got around to linking it up top.

1 Like

Ok, here come the newbie questions…

When I enter UsbDkController -n in Power Shell or in Python, here is what I get:

Both Git and Python 3.9 are installed.

Also, on the EDL install page, when is the process done? That isn’t clear.

I really don’t want to step into @mattmon’s sandbox because his instructions are complete. But, requiring a bit more than a passing exposure to Linux and I think I may have insulted him by calling it a spaghetti bowl of instructions. (I apologize). My issue was that the instructions for Windows, Linux and Mac were all in the same bowl.

I made notes to myself when I used a Ubuntu computer to install the firmware on my ThinkSmart. You can see them here. (This is the first time I shared anything from my notebook. Please let me know if you can see it.)

1 Like

It’s our sandbox, that’s the point of a community, right?

I recently referenced spaghetti in another thread. Pasta is sometimes a fair technical assessment.

Really, my primary concern with the instructions in OP is to keep them simple and versatile.

I’d rather have someone dive in and ask a lot of questions than scare them away with complexity.

Not to say that granularity can’t be helpful.

@stevemann: if you post the guide you PM’d me, I’ll be happy to link it above.

3 Likes

Just curious, but it doesn’t look like the horizontal boot animation is included. Is there anyplace we could grab that file from?

It is in my wiki.
You can see them here

I PM’d it to you for your critique because there has to be at least one error in my process. (Track record). If it looks good, then feel free to post the link to my Wiki page.

2 Likes

That’s exactly what I needed. Thank you. However, I got this error when trying to run “pip3 install -r requirements.txt”:

Out of curiosity, I kept going and when I tried to start EDL using “./edl qfil ~/edl/bin/rawprogram.xml ~/edl/bin/patch0.xml ~/edl/flash --loader=~/edl/bin/prog_emmc_firehose_8953_ddr.mbn” I got this:

Ok, i added the ‘pip install -r requirements.txt --break-system-packages’ that error message suggests and it installed. Then, I went thru all of the steps again.
However, it is still looking for module named “docopt” when I try to run ’ ./edl qfil ~/edl/bin/rawprogram.xml ~/edl/bin/patch0.xml ~/edl/flash --loader=~/edl/bin/prog_emmc_firehose_8953_ddr.mbn’

Both are already present within the rom. See extras section in OP

I’m a knucklehead. The file is there, but it’s not named .horiz, it’s named .horizontal. Please double check me, but I think post 1 extras and notes last command needs to be updated.

2 Likes

Have you added the UsbDk installation folder to your system path? For me it’s C:\Program Files\UsbDk Runtime Library.

I’ve seen so many great dashboards, it seems kind of unfair to everyone that I haven’t posted mine.

Though for good reason, I haven’t put nearly as much time or thought into mine as others and it shows!

Never the less, here goes, please take it easy on me :wink:

It’s just the wallpanel app, pointing to a specific dashboard with HA wallpanel mode enabled and some pretty egregious abuse of bubble card’s CSS.

I would really like to get some kind of voice assistant stack running, and will be working toward that in the future.

If you build edl outside a venv, you’ll likely end up with a broken mishmash of system deps and stuff pip installed.

Make a venv specifically for edl as the warning dialog suggests. Then make sure to reference that venv for each subsequent python related command.

1 Like

Mine may take the prize for plain and simple. It is on the side of my desk and only shows my driveway and front porch cameras. I’ll take a photo if I ever get my desktop cleaned up.

No, doesn’t work.

But I got a little further. Sending the wake command over mqtt (Wallpanel app) does turn on the screen immediately.
it works as indicated in the WallPanel documentation:

json payloads sent to the mqtt topic: wallpanel/mywallpanel/command

  • wake: {"wake": true}
    it also seems to “reset” the issue with the screen not timing out, since the screen goes back to sleep after the timeout when sending that command.
This returned the following logs in logcat:
01-21 10:10:36.142  1206 13999 D AppOps  : noteOperation: allowing code 23 uid 10069 package xyz.wallpanel.app
01-21 10:10:36.146  1206 13999 D AppOps  : noteOperation: allowing code 23 uid 10069 package xyz.wallpanel.app
01-21 10:10:36.312   672   705 E libnav  : CablComputeBacklightLevel(): UpdateType = DifferentSceneUpdate
01-21 10:10:36.328   672   705 E libnav  : CablComputeBacklightLevel(): UpdateType = DifferentSceneUpdate
  • screen off: {"wake": false}
    doesn not work and does not produce any log entries in logcat either.
    however, the adb shell input keyevent 26 still works to turn off the screen, even when it’s stuck on

I tried testing a few other mqtt commands, but they did have no effect (again: not even logcat entries).
the {"settings": true} command does work, and open the WallPanel settings, however, if the screen times out / or was already timed out before, apparently it blocks further mqtt commands from being executed.
From that state (being in the settings menu) I tried to go back to the Home Assistant dashboard using the {"url":<http://....>} command, but that one didn’t work either. So best to avoid opening the settings over mqtt.

The {"url":<http://....>} does work (when not being stuck in the settings), so it can be used to load a specific dashboard - even if that takes 2-3 seconds to complete.

Sadly, the screenOn Parameter in the wallpanel/mywallpanel/state topic doesn’t work, and does not correctly report the screen state (neither does the brightness level).
So at the moment, we can’t get the current screen state without actually polling them using adb commands.

However, it seems, we can at least turn on the screen in Home Assistant using the mqtt command, and turn if off again using an adb command (there is an ADB integration, I’m going to test that next)

1 Like