Re: Turn screen Android tablet off when sleep/not home
Posted: Thursday 04 June 2015 23:02
What?ThinkPad wrote:.....you also need to set Tasker/plugin for Tasker to give it more control ...
Open source Home Automation System
https://forum.domoticz.com/
What?ThinkPad wrote:.....you also need to set Tasker/plugin for Tasker to give it more control ...
Code: Select all
var domswitch=arr.result[0].Data;
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;
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.
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;
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.
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"
}
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