Author Topic: Imperihome Screen Off Using Tasker & AutoVera  (Read 1850 times)

Offline swfire271

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +3/-2
Imperihome Screen Off Using Tasker & AutoVera
« on: March 15, 2016, 01:31:08 pm »
So....I thought I came up with an easy plan for having the screen on my Imperihome wall mounted tablet go completely off when Vera changes to Away or Night mode instead of the 'black' standby mode for auto wake with camera. 

I was hoping I could use Autovera to detect when the House Modes Plugin changes from Home/Away/Night modes to then have tasker launch a Screen On or Screen Off task.

I set up a Profile Event and navigated to Autovera in the plugin section, Configuration selected my Vera controller, Device selected House Modes Plugin, Service is House Modes, No Variable, then New Value (1 for Home, 2 for Away, 3 for Night).

However, it seems Tasker/AutoVera doesn't get this updated status change after changing house modes from a phone/computer/tablet.

Is there any way to make this possible?

Then the screen would be completely off when Away/Night mode is activated.  I'm hoping I have something wrong somewhere.


If not, I will have to stick with screen off overnights on a time schedule.
I was successful in creating a Time event from 11pm to 5am.  It activates Task 'Screen Off' which consists of Secure Settings->Screen and Keyboard Lights on for 1 Second....then Go Home->Page 0.  This wakes up the tablet, and goes to the home screen where it automatically times out after 30 seconds and the screen completely shuts off.

The Exit Task at 5am is 'Screen On' which also uses Secure Settings->Screen and Keyboard Lights on for 3 seconds....then Launch App->Imperihome Pro.

Offline Chrisfraser05

  • Sr. Member
  • ****
  • Posts: 447
  • Karma: +16/-31
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #1 on: March 15, 2016, 05:19:41 pm »
Make a virtual switch and have it turn on when in home mode and off when in away/night.

Then tasker can monitor that switch.

Bingo.

Offline swfire271

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +3/-2
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #2 on: March 28, 2016, 12:58:17 pm »
If I have tasker Get State of the virtual switch once every 20 min to see if it's changed to away or night, is that too often or any reason not to do it this way?

And once in away or night mode I have tasker checking the state of the switch every 5 min to turn on the screen again once I'm home.

Didn't know if this puts any weird strain on my vera 3 or the tablet, etc?

Offline swfire271

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +3/-2
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #3 on: March 30, 2016, 01:13:52 pm »
Anyone??

Online Priest

  • Full Member
  • ***
  • Posts: 178
  • Karma: +7/-0
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #4 on: April 14, 2017, 02:48:49 pm »
I'll be messing with this soon myself. I'm bringing this back to life since no one answered his last question to maybe get an answer...or at least be able to get involved when I try it myself.

Offline kfxo

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #5 on: April 14, 2017, 04:00:50 pm »
This how I handle turning on/off android devices in my system. I use tasker with secure settings plugin and Tasker Network Event Server plugin. On vera I create a virtual switch for the android device. I create three profiles in tasker: Display State On, Switch On, and Switch Off and four tasks: Display Off, Display On, Turn Switch On, and Turn Switch Off. 
Display State On profile:
State--Display--Display State--On
     Enter Task: Turn Switch On
     Exit Task: Turn Switch Off
Switch On profile:
Event--Plugin--TNES:Tasker Network Event Server (configure that with Event Name: AnythingYouWant and Filters: message==on)
     Enter Task: Display On
Switch Off profile
Event--Plugin--TNES:Tasker Network Event Server (configure that with Event Name: AnythingYouWant and Filters: message==off)
     Enter Task: Display Off
Turn Switch On Task:
     1. Profile Status:Switch On Set Off
     2. Profile Status: Switch Off Set On
     3. HTTP Get (Send HTTP Request to Vera to turn the created virtual switch ON) Server:Port: VERAIP:3480 and Path: data_request?id=lu_action&output_format=xml&DeviceNum=VIRTUALSWITCHDEVICENUMBER&serviceId=urn.:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1
Turn Switch Off Task:
     1. Profile Status:Switch On Set On
     2. Profile Status: Switch Off Set Off
     3. HTTP Get (Send HTTP Request to Vera to turn the created virtual switch OFF)
Display On Task:
     1. Secure Settings: Screen and Keyboard Lights On
Display Off Task:
     1. System Lock
Then in vera create two scenes (or use Pleg), one for the virutal switch ON and one for the virtual switch OFF. In those scenes you need to specify LUUP code to send the correct Tasker Network Event Server message. For example the ON message would be: local status, result = luup.inet.wget("http://ANDROIDDEVICEIP:8765/?message=on", 5)

If everything is set up correctly, you should now have a virtual switch that you can turn on and off and your android table will turn on and off. Further, if you manually turn the tablet on/off, your virtual switch will correclty show on/off. Now you can incorproate that virtual switch into any scene to turn your android device on/off. Also, in your Display On task you can specify additional steps like Start Imperihome so that whenever your device turns on Imperihome will start. You can also use Autovera instead of the Tasker Network Event Server and the HTTP Get commands but I do it my way for speed and reliability.

Online Priest

  • Full Member
  • ***
  • Posts: 178
  • Karma: +7/-0
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #6 on: April 14, 2017, 07:54:11 pm »
And I assume you have the tablet on a static ip based on the command.

Offline kfxo

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #7 on: April 14, 2017, 08:10:21 pm »
Yes. Both Vera and the Android device should have static IP to ensure it always works as expected.

Offline 3rdStng

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +1/-0
Re: Imperihome Screen Off Using Tasker & AutoVera
« Reply #8 on: April 17, 2017, 07:15:19 pm »
I recently setup my ImperiHome and an older tablet to do just this. I leveraged the API's within the mini HTTP server that ImperiHome runs.

I have a scene with an interval of 5 minutes running LUA code using the URL "http://<IP Address>:8080/api/rest/dashboard/wakeup". This scene runs in Home mode only. When my controller switches to any other mode, the screen saver within ImperiHome kicks in and sleeps the screen.

My next steps will be to move this into PLEG and narrow down my "screen wakeup" window to a set time period (6:00 AM to 11:00 PM.) This is mainly in case I forget to set the controller into Night mode.