What?ThinkPad wrote:.....you also need to set Tasker/plugin for Tasker to give it more control ...
Turn screen Android tablet off when sleep/not home
Moderators: leecollings, remb0
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
I needed to install 'Secure Settings' plugin for Tasker, to give it more control over the tablet' hardware. Otherwise it couldn't turn the screen back on.
Was able to verify that by constantly pinging the tablet from my PC. It responded, but as soon as the screen was turned off the responses stopped.
What i also noticed, was that the CPU of the tablet went into sleep after screen was turned off. So it couldn't be turned back on by Tasker, because it was asleep.
I now keep it awake with an app, see here: viewtopic.php?f=28&t=4733&start=20#p32972 it now keeps responding if i ping it, doesn't matter if screen is on/off.
Was able to verify that by constantly pinging the tablet from my PC. It responded, but as soon as the screen was turned off the responses stopped.
What i also noticed, was that the CPU of the tablet went into sleep after screen was turned off. So it couldn't be turned back on by Tasker, because it was asleep.
I now keep it awake with an app, see here: viewtopic.php?f=28&t=4733&start=20#p32972 it now keeps responding if i ping it, doesn't matter if screen is on/off.
I am not active on this forum anymore.
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
I already installed the secure settings plugin. And also the awake app.
But the sceen switches off and doesnt switch on so it looks like there is no connection to domoticz or something.
Is there a way to test the connection? The tasker log doesn't tell much, only the task is running.
But the sceen switches off and doesnt switch on so it looks like there is no connection to domoticz or something.
Is there a way to test the connection? The tasker log doesn't tell much, only the task is running.
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
Can you still ping the tablet if the screen is off?
And can you post a screenshot of your Tasker event?
And can you post a screenshot of your Tasker event?
I am not active on this forum anymore.
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
I can keep pinging it, even if the ís off for a day.
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
One question, where does the "%domswitch" points to? It looks like a variable or parameter but where is it set?
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
You have to add the following to domdev2.js.
Code: Select all
var domswitch=arr.result[0].Data;
Not using Domoticz anymore
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
This line isn't in the instruction described before....G3rard wrote:You have to add the following to domdev2.js.Code: Select all
var domswitch=arr.result[0].Data;
Is it correct that the domdev2.js file is in "/mnt/sdcard/Tasker/js/" folder?
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
It is not in the instruction indeed, but without it domswitch is not defined.
I got it running with this addition.
I placed the js file in a folder on the Nexus and then used the browser (magnifying glass) of Tasker to point to that file.
I got it running with this addition.
I placed the js file in a folder on the Nexus and then used the browser (magnifying glass) of Tasker to point to that file.
Not using Domoticz anymore
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
I did that already and double checked it but still the screen goes off.G3rard wrote:It is not in the instruction indeed, but without it domswitch is not defined.
I got it running with this addition.
I placed the js file in a folder on the Nexus and then used the browser (magnifying glass) of Tasker to point to that file.
When i do the json in the browser I get
http://xxx.xxx.xxx.xx:8080/json.htm?typ ... es&rid=285
Code: Select all
{
"ActTime" : 1435262038,
"ServerTime" : "Jun 25 2015 21:53:58",
"Sunrise" : "05:18:00",
"Sunset" : "22:08:00",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 2,
"Data" : "On, Level: 100 %",
"Favorite" : 0,
"HardwareID" : 22,
"HardwareName" : "Multimedia apparaten",
"HaveDimmer" : true,
"HaveGroupCmd" : true,
"HaveTimeout" : false,
"ID" : "001416C",
"Image" : "TV",
"IsSubDevice" : false,
"LastUpdate" : "2015-06-25 08:00:13",
"Level" : 100,
"LevelInt" : 15,
"MaxDimLevel" : 15,
"Name" : "Tablet scherm",
"Notifications" : "false",
"PlanID" : "0",
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : 7,
"Status" : "On",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "AC",
"SwitchType" : "On/Off",
"SwitchTypeVal" : 0,
"Timers" : "true",
"Type" : "Lighting 2",
"TypeImg" : "lightbulb",
"Unit" : 1,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "285"
}
],
"status" : "OK",
"title" : "Devices"
}
Code: Select all
var domswitch=arr.result[0].Data;
Code: Select all
var domswitch=arr.result[0].Status;
The log of the tasker shows also no errors (see my screenshot above).
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
Your virtual switch is a dimmer, make it a normal on/off switch and it will work.
Then the Data field will only contain On and Off.
Then the Data field will only contain On and Off.
Not using Domoticz anymore
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
I think it's not. I create a virtual switch with type "Switch" then in devices I give it a name and then on the switch tab i set it to type "on/off".G3rard wrote:Your virtual switch is a dimmer, make it a normal on/off switch and it will work.
Then the Data field will only contain On and Off.
This also matches the "SwitchType" : "On/Off"," of the json.
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
Here is my json for an On/Off switch. Look at the Data part, it's only containing "On" (or "Off"). I use this switch with my tablet and it's working...
Code: Select all
{
"ActTime" : 1435268559,
"ServerTime" : "Jun 25 2015 23:42:39",
"Sunrise" : "05:14:00",
"Sunset" : "22:01:00",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 118,
"Data" : "On",
"Favorite" : 0,
"HardwareID" : 3,
"HardwareName" : "Dummy",
"HaveDimmer" : false,
"HaveGroupCmd" : true,
"HaveTimeout" : false,
"ID" : "65",
"Image" : "TabletAndroid",
"IsSubDevice" : false,
"LastUpdate" : "2015-06-25 13:16:13",
"Level" : 0,
"LevelInt" : 0,
"MaxDimLevel" : 0,
"Name" : "Android Tablet Motion",
"Notifications" : "false",
"PlanID" : "0",
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : 7,
"Status" : "On",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "X10",
"SwitchType" : "On/Off",
"SwitchTypeVal" : 0,
"Timers" : "true",
"Type" : "Lighting 1",
"TypeImg" : "lightbulb",
"Unit" : 14,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "167"
}
],
"status" : "OK",
"title" : "Devices"
}
Not using Domoticz anymore
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
Your subtype is X10, mine is AC. Only I'm not able to change this....
Besides that, can you post a screenshot of your JavaScript rule in tasker (where you also set the path).
Besides that, can you post a screenshot of your JavaScript rule in tasker (where you also set the path).
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
Add the virtual switch from the Switches tab by clicking the Manual Light/Switch button. There you can choose the subtype (standard X10), but that should not matter.
I copied the js file to my tablet (folder does not matter) and in Tasker pointed to that folder and file with the magnifying glass. Have you tried that?
What happens if you run the task in Tasker with the play button?
I copied the js file to my tablet (folder does not matter) and in Tasker pointed to that folder and file with the magnifying glass. Have you tried that?
What happens if you run the task in Tasker with the play button?
Not using Domoticz anymore
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
I was on vacation from 13 till 27th of June, so i couldn't respond.
roblom, have you figured it out already, or do you still need some help with something?
roblom, have you figured it out already, or do you still need some help with something?
I am not active on this forum anymore.
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
Yesterday the screen switched on after I made a new virtual switch with a type X10. But after that no response anymore...
Tasker reports sometimes a "SocketTimeoutException: Failed to connect" error, but the ping from domoticz to the tablet seems to work (used the built in ping function from domoticz).
Tasker reports sometimes a "SocketTimeoutException: Failed to connect" error, but the ping from domoticz to the tablet seems to work (used the built in ping function from domoticz).
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
Weird. I also use a virtual X10 switch (on/off).
I am not active on this forum anymore.
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
If you have Pushover you can also use that to trigger Tasker. http://updates.pushover.net/post/831182 ... er-support
It's easier then using the domdev2.js solution, just send a pushover message when you change a switch. The task in Tasker is started immediately when the message is received, so you don't have the 2 minute interval.
I have just configured this and when the tablet receives a certain message from Pushover it starts the Motion Detector app
It's easier then using the domdev2.js solution, just send a pushover message when you change a switch. The task in Tasker is started immediately when the message is received, so you don't have the 2 minute interval.
I have just configured this and when the tablet receives a certain message from Pushover it starts the Motion Detector app
Not using Domoticz anymore
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Turn screen Android tablet off when sleep/not home
But then you probably are using pushover only for the tablet? Because you are not able to send messages two different pushover devices, or am I wrong?G3rard wrote:If you have Pushover you can also use that to trigger Tasker. http://updates.pushover.net/post/831182 ... er-support
It's easier then using the domdev2.js solution, just send a pushover message when you change a switch. The task in Tasker is started immediately when the message is received, so you don't have the 2 minute interval.
I have just configured this and when the tablet receives a certain message from Pushover it starts the Motion Detector app
Who is online
Users browsing this forum: Google [Bot] and 0 guests