Jump to content

looking for a way to automate trigger from android phone to turn a windows application on/off


Recommended Posts

Hi all - was wondering if the following is possible:

I have a motion detecting ccrv software on PC (icam or similar) - there is a bottom that turn surveillance (motion detection) on and off. I can get autoit to automate the clicking on the button. 

 

I want my android phone to send a trigger every time it disconnect from the home network (i.e when I leave home) to tell autoit to turn on surveillance and when reconnecting to home network to trigger it to click off

 

does any one have a suggestion how to go about achieving this?

Link to comment
Share on other sites

So my computer is connected to my wifi, and my phone is connected to my wifi...so I can ping my phone continually.

When I leave, and my phone disconnects, the ping will return a failure, and I can have the same locally running script on my computer click the button.  Then I'll start looping the ping until it succeeds in pinging the cell phone, and click the other button.

I'm not sure if the IP is generated real time or not though, so it might change with each reconnect.  You can get the IP by going to your wifi page, clicking on your home's wifi settings.  It will display all the info including the IP.

$myCellPhoneIP = "127.0.0.1"

While True
    While Ping($myCellPhoneIP)
        Sleep(5000)
    WEnd
    ConsoleWrite("Failed to ping $myCellPhoneIP=[" & $myCellPhoneIP & "]" & @CRLF)
    ControlClick('yourwindow',"","your button")
    While Not Ping($myCellPhoneIP)
        Sleep(5000)
    WEnd
    ConsoleWrite("Able to ping $myCellPhoneIP=[" & $myCellPhoneIP & "]" & @CRLF)
    ControlClick('yourwindow',"","your button")
WEnd

If the IP does change (you can test by turning on and off your phones wifi), then you will have to google how to dynamically get the ips connected to your network, such as looping through an IP range that your local wifi uses.

 

Edit: I know this isn't exactly what you asked for, you'll have to wait for someone else for your specific question, but this is a very simple way to do the same kind of functionality.

 

Another route: 

I suppose you can then create a file on your phone whenever, which you can check for on your computer, inside that mapped drive.  Then when you get home, you can delete the file, which your script can check for, and turn off your application.

I'd stick with the pings, because then I wouldn't have to do manually add in a file, or manually delete a file, it would just work.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

thank you very much for the suggestion - very clever work around - didnt even think about this way... the only thing I wonder is the overhead of pinging continuously - I know pinging is only a tiny load on the network but is continuously doing so adds up to a lot of unnecessary  traffic/cpu load ?

Link to comment
Share on other sites

No problem at all, its not like you're going to crash the network by means of denial of service.

Ping is very light on the network and you can time it for some seconds of interval.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

i would suggest you install Tasker and the AutoRemote plugin on your Android phone, then install EventGhost on PC along with its AutoRemote plugin. then spend lots of hours searching the respective forums for those apps to learn how to make Tasker use AutoRemote to send commands to EventGhost to run AutoIt scripts and vice versa. Then after you have your project working to your satisfaction start experimenting with lots of other ways to automate your phone/pc and start making pointless scripts that eat up more of your time than the initial action you wanted to automate would actually take you to perform manually.

If @error Then
    MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!")
EndIf

"Yeah yeah yeah patience, how long will that take?"  -Ed Gruberman

REAL search results  |  SciTE4AutoIt3 Editor Full Version

Link to comment
Share on other sites

Ha! that sounds like me sometimes. @alienclone

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...