Is this the perfect standalone tablet for HA?

@jakhei those are some sexy dashboards, I love the color palette.

It‘s the kernel source and it does build successfully. That’s as far as I’ve taken it though.

I guess to build a fully open source rom (minus the blobs, of course), we would need to, at a minimum:

  1. port Lenovos kernel source to a later version compatible with the targeted android sdk

  2. Build device and/or vendor trees

There are other devices out there that utilize this same chip with later versions of android, so it has been done.

2 Likes

That doesn’t make sense. If you disable the screen timeout in Android, the screen just won’t time out. At least that’s how mine works…

I did actually take another peek at it. Similar Lenovo Devices (same SoC) are the Lenovo TAB4 10 Plus and the Lenovo TAB4 8 Plus.
There’s also some info regarding mainline Kernel support here: Qualcomm Snapdragon 450/625/626/632 (MSM8953) - postmarketOS
So possible Linux could be another alternative if someone is willing to spend the time :wink:
The dts file from the device can be easily pulled and converted. It sits at /sys/firmware/fdt, as you’d expect.

Full Disclosure: I’m not an android aficionado by any means. I have built android from source, but not since the days of the Nexus S (lol, does that date me?)

Interesting link. It does appear that our SoC has at least partial mainline support.

Reviewing the hardware notes in your link, it seems everything is working with one exception:

Camera is able to perform RAW capture only

I’m not sure what this really means in terms of functional limitation, but would suspect our current rom is similarly limited. It could explain the hit or miss camera support for video conferencing apps that’s been reported in this thread.

Anyway, nice find, with mainline support, the time investment shouldn’t be too terrible.

An updated, 64bit rom would probably also constitute a fairly significant performance boost.

I’m starting to feel motivated.

1 Like

Very nice dashboards! Really like the weather and thermostat cards—what are they?

We should probably look into starting a new thread for that, because we’re getting pretty off-topic here :wink:

But I’m looking into it further as we speak and I’m getting the sense that most of the support we require already exists mainline.
There currently isn’t a driver for the Touchscreen (Focaltech FTS8201) but the upstream kernel has a driver for that brand of touchscreen controllers (edt-ft5x06.c « touchscreen « input « drivers - kernel/git/torvalds/linux.git - Linux kernel source tree) that seems to work with other models as well, so it’s worth a shot.
Same goes for the audio codec (TAS5825M) where a device from the family (TAS5805M) is supported mainline.
Other than that most everything else, I assume, should work.

2 Likes

Perhaps I mis-stated. I WANT the screen to time out, but it won’t if Home Assistant is open.

Would anyone be willing to offer step-by-step instructions for windows users?

I’m having a heck of a time getting any of my machines to boot a live version of linux.

I couldn’t get it to install using Windows. The Linux method works. If you don’t have a Linux computer, make a Linux boot thumb drive. My particular favorite is Ubuntu. When Linux boots, select “Try Ubuntu”.

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.)

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?