I use a galaxy Tab A with a 10.1" display. https://www.amazon.de/dp/B07888JKDW
The metal plates for backside are https://www.amazon.de/gp/product/B01ET4DUU4. The tape on this metal plate was not strong enough, so I used additional adhesive. And the magnets are this one https://www.amazon.de/gp/product/B074V4478F
The app itself is also my own. Inside I start a webview and a REST Server (https://github.com/koush/AndroidAsync) as an background job which is listen for some urls. If I call e.g /sleep, it is activating the os powermanagent and the display goes off after some seconds. A challenge here was the reactivation of the tablet. If I call /wakeup, the os powermanagement goes off, the display on, then I call a javascript snippet to refresh all items (because I missed some events during the sleep), but habpanel was not reactivation the event listener after. So the only way to handle this without patching habpanel is a full browser refresh.
I was also thinking about motion detection, because I have a sensor directly below the tablet. I decided against it because I want to see the tablet also if i sit on my couch for a while without any motion event. For me it is enough to disable it during the night and when I’m away.
any additional tool is not needed.
The biggest challenge is the digest cycle of angular. Before, all widgets has no knowledge which data they should show. With the result that every item update will trigger hundreds of digest cycles. My tablet was running with ~20% CPU the whole time and consumed a lot of energy. I have 60-70 updates every minute with ~500 items. But the habpanel main screen (first screenshot) needs only ~100.
I solved this by skip all digest cycles. All my widgets are wrapped with a new custom directive. This disables all watchers. Instead it registers itself for openhab updates. Additionally it overwrites “getItem”, “getItemState” etc… All other widgets which are inside this custom directive are registering their self as listener to this custom directive.
Now, during the first itemUpdate where all items are updatet, I forward this event to all my subwidgets. During this cycle, the custom directive is collecting used items via their calls of getItem, getItemState etc. From now on I can forward item updates to the right widget or completely ignore updates for unused items. As a result my tablet runs with 2-3% CPU ![:slight_smile: :slight_smile:](https://community.openhab.org/images/emoji/twitter/slight_smile.png?v=5)
I was also trying to enable watchers temporary for some widgets when the right item was triggered. This works too but not so efficient. The digest cycle was fired in many additional unwanted situations which results in unnecessary widget updates. The only case where i want widget updates is, when items are new initialized or updatet. At the end I came up with my solution described above.
Another problem was a noticeable delay if I was going back to the complex main dashboard from any other widget. This was also solved by my digest cycle change. Before the delay was ~1500ms. Now it is max 500ms and feels smooth.