After you installed your tablet in a nice frame on the wall (https://forum.pimatic.org/topic/3311/koffienl-s-tablet-guide-frame-for-wall-mounted-tablet) you might want to control it’s state with Pimatic.
In my opinion Tasker is great app, but a pain in the ass to use and find all the settings. I hope that this guide will help to understand how you can easily control your tablet wit Pimatic (and thus wit rules and such).
The only downside for this method : you can’t tell Tasker to check the state of Pimatic less than every 2 minutes. Not a big deal for me.
When you configure Tasker with the actions and profiles in this guide, you can control the state of your table with Pimatic; you can:
- Reboot the tablet
- Turn the screen off
- Turn the screen on
- Go the homescreen
- Turn daydream off (and set screen timeout to never)
- Turn daydream on (after 2 minutes of no activity)
I have created rules in Pimatic to turn off the tablet when nobody is home, or when the last person goes to sleep. The tablet wil be turned on at daily wakeup time (if anybody is home) or when someone is heading to home.
Requirements:
Install and buy Tasker
Install secure settings plugin for Tasker
Enable system+ module in secure settings (root!)
In Pimatic create a variable called tablet
Tasker configuration
VARS
- Create a variable called
%Tablet
(with a capitall T)
TASKS
-
Get Pimatic state
run shell: curl -X GET --user “admin:password” --url http://pimatic_ip/api/variables/tablet
store output in %Tablet -
Set pimatic state
run shell: curl -X PATCH --header “Content-Type:application/json” --data ‘{“type”: “value”, “valueOrExpression”: 1}’ --user “admin:password” http://pimatic_ip/api/variables/tablet
store output in %Tablet -
Screen off
system lock IF %Tablet set -
Unlock
Secure settings: Wake device, Screen % Keyboard lights on for 1 second -
Reboot
Reboot -
Homescreen
Go Home -
Daydream off
Secure settings: Daydream disabled
Display timeout: seconds, minutes and hours to the max -
Daydream on
Secure settings: Daydream state enabled
Display timeout: 2 minutes
PROFILES
-
Get Pimatic state every 2 minutes
From 00:00 every 2 minutes till 23:59
Power source AC
Add action: “Get Pimatic State” -
Turn screen off when Pimatic variable is '0’
Variable %Tablet
Value: {“variable”:{“name”:“tablet”,“readonly”:false,“type”:“value”,“value”:0,“unit”:""},“success”:true}
Power source AC
Add action: “Screen off” -
Turn screen on when Pimatic variable is '1’
Variable %Tablet
Value: {“variable”:{“name”:“tablet”,“readonly”:false,“type”:“value”,“value”:1,“unit”:""},“success”:true}
Power source AC
Add action: “Unlock” -
Reboot tablet when Pimatic variable is 'reboot’
Variable %Tablet
Value: {“variable”:{“name”:“tablet”,“readonly”:false,“type”:“value”,“value”:“reboot”,“unit”:""},“success”:true}
Power source AC
Add action: "Set Pimatic State"
Add Action: “Reboot” -
Go to table homescreen when Pimatic variable is 'home’
Variable %Tablet
Value: {“variable”:{“name”:“tablet”,“readonly”:false,“type”:“value”,“value”:“reboot”,“unit”:""},“success”:true}
Power source AC
Add action: "Set Pimatic State"
Add Action: “Go Home” -
Disable daydream when Pimatic variable is 'screensaveroff’
Variable %Tablet
Value: {“variable”:{“name”:“tablet”,“readonly”:false,“type”:“value”,“value”:“screensaverodd”,“unit”:""},“success”:true}
Power source AC
Add action: "Set Pimatic State"
Add Action: “Daydream off” -
Enable daydream when Pimatic variable is 'screensaveron’
Variable %Tablet
Value: {“variable”:{“name”:“tablet”,“readonly”:false,“type”:“value”,“value”:“screensaverodd”,“unit”:""},“success”:true}
Power source AC
Add action: "Set Pimatic State"
Add Action: “Daydream om”
That’s it : you now have a nice framed tablet that can be controlled with Pimatic. Next step: install a Fully customizable HTML GUI for Pimatic: https://forum.pimatic.org/topic/3313/koffienl-s-tablet-guide-fully-customizable-html-gui-for-pimatic