Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-09-06 Thread Launchpad Janitor
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Expired

Launchpad Janitor expired the question:
This question was expired because it remained in the 'Open' state
without activity for the last 15 days.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-21 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Needs information => Open

cemara gave more information on the question:
Sorry, after multiple testing's.
I'm not sure this is even related so sikuli or not.
So even without the java process that sikuli generates, skype won't go to front 
with incoming calls.
Really weird, it stays in the background and the taskbar icon is blinking. 
This complicates things even more..
Maybe make a code to click skype taskbar icon when it's blinking to bring it to 
front?
But the problem is, skype sometimes bring it to front, and the taskbar doesn't 
blink..

A more surefire way trigger would be when the mic or webcam is being
used, but I've searched and haven't figure out this one yet.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-20 Thread Manfred Hampl
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Needs information

Manfred Hampl requested more information:
"By detecting the red hangup button from skype call window.
Problem is for the second round, skype call window stays in the background and 
won't go to front.
So sikuli can't detect the red button anymore.."

Just talking about the second round:

How do you know that there is a red hangup button, if it is only in the
background?

If you do it manually,  how can you bring the skype call window to
front?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-20 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Needs information => Open

cemara gave more information on the question:
@m-hampl
By detecting the red hangup button from skype call window.
Problem is for the second round, skype call window stays in the background and 
won't go to front.
So sikuli can't detect the red button anymore..
It's like   HomeAssistant.focus() effect wont reset after the code runs.

Well the taskbar shows blinking skype icon when there's incoming calls, 
but If I'm going to use that then I will need to identify skype call window 
name in order to bring the window to front, 
And the last time I tried that with autoit, there was no difference between the 
name of call window and skype main app window (hence I went for sikuli)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-20 Thread Manfred Hampl
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Needs information

Manfred Hampl requested more information:
If you would have to do this manually, how do you know that a new skype call is 
coming in?
Is there an additional icon in the task bar etc. etc.?
Then you may be able to use that as trigger in the script for the second round 
(or maybe also even for the first one).

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-20 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Answered => Open

cemara is still having a problem:
Sorry for the late reply, I was looking for AIO device strong enough for this 
and can be powered by POE.
I ended up with Asus V161.

Now I think this code can run :

HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
Settings.WaitScanRate = 0.5
while True:
  Region(1381,22,519,964).inside().wait("1659658059381.png", FOREVER)
  while exists("1659658059381.png", 0):
wait(3)
  HomeAssistant.focus()

But there's an issue, the first time the code runs, it works properly with this 
flow :
1. Home assistant running, skype running in background
2. Make skype call from phone, sikuli detects (red hangup button)
3. Wait until red hangup dissapear, bring Home assistant to front.
The issue is,
4. Second time I make skype call, skype call window wont go up, it stays in the 
background, 

Seems like Home assistant window is always is front after the first time code 
is running.
Any idea why? 
If I put end, it would terminate the monitoring process..

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-07 Thread RaiMan
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Answered

RaiMan proposed the following answer:
Ok, then you have to live with the situation, after having followed
Manfred's suggestions.

You might also try with the pre-version (snapshot) of 2.0.6 from here:
https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots=com.sikulix=sikulixidewin=2.0.6-SNAPSHOT=jar

Export to jar cannot be used here.
You have to run your script from command line like so:
java -jar path-to-skulixidejar -r path-to-your-scriptfolder

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-05 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Answered => Open

cemara is still having a problem:
Windows10 ltsc 2019,
sikulixide-2.0.5-win.jar
OpenJDK16U-jdk_x64_windows_hotspot_16.0.2_7.msi

With above code, I export to runnable jar, and  run it..

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-05 Thread RaiMan
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

RaiMan requested more information:
What is your exact environment? versions of Windows, Java and SikuliX?
How do you run the script?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-05 Thread Manfred Hampl
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Answered

Manfred Hampl proposed the following answer:
Also "exists" should be restricted to the smallest possible region.

Something like

HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
Settings.WaitScanRate = 0.5
myRegion = Region(1381,22,519,964)
while True:
  myRegion.wait("1659658059381.png", FOREVER)
  while myRegion.exists("1659658059381.png", 0):
wait(3)
  HomeAssistant.focus()

Further enhancement of the script could be to identify the exact
position where the skype image is found in the "wait" statement, and
then use that region for re-checking if it still existing the "exists"
statement.

Perhaps something like

HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
Settings.WaitScanRate = 0.5
baseRegion = Region(1381,22,519,964)
while True:
  foundRegion = baseRegion.wait("1659658059381.png", FOREVER)
  while foundRegion.exists("1659658059381.png", 0):
wait(3)
  HomeAssistant.focus()

(For the openjdk processes I do not know enough about the technical
details, hopeful RaiMan can answer that.)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-04 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Answered => Open

cemara is still having a problem:
HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
Settings.WaitScanRate = 0.5
while True:
  Region(1381,22,519,964).inside().wait("1659658059381.png", FOREVER)
  while exists("1659658059381.png", 0):
wait(3)
  HomeAssistant.focus()

The skype button seems to always appear on the right side, I've narrowed it 
down to 1/4 upper right side.
is this the right way to code it? Any other possible optimization?
But it doesn't seem to help much reducing resource when i run it.
It seems now there are 2 openjdk bla3 instances on task manager instead of 1 
when I run it..

Hmm other alternative would be running the whole  thing in ubuntu light since 
skype sikuli and HA are also available in ubuntu, might take a while. But i'll 
see if I can get it running with spare ssd.
Thanks for all the help until now.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-04 Thread RaiMan
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

RaiMan posted a new comment:
@Manfred: excellent answer as always.Thanks and all the best.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-04 Thread Manfred Hampl
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Answered

Manfred Hampl proposed the following answer:
Sorry, it seems that I misunderstood the requirements.

If you want to keep the script running to answer skype calls multiple
times, whenever they come in, then you need the "While True".

In that case the only possibility that I see is fine-tuning the
frequency of checking for the skype pic by reducing the scan rate for
the skype image or increasing wait time between the checks.

HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
Settings.WaitScanRate = 3 # -reduce this number to 0.5 for checking only once 
every two seconds, etc.
While True
  wait(skype.png, FOREVER)
  while exists(skype.png, 0):
wait(0.5) # increase this number to 2.0 for checking only every two 
seconds, etc.
  HomeAssistant.focus()

Can the skype.png button appear anywhere on the screen, or is it always
in the same spot? In the latter case you should search only in that
region instead of the whole screen. This should also reduce resource
usage.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-04 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Answered => Open

cemara is still having a problem:
@manfred hampl,
Wouldn't that end the script once 1 call session is made?
My intention is to make 24/7 skype monitoring system with sikuli.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-04 Thread Manfred Hampl
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Answered

Manfred Hampl proposed the following answer:
Are you sure that you need the "While True"?

I do not know the details of your system, but I would expect that the
following may be sufficient, unless the skype window (identified by
skype.png) re-appears again and again.

HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
Settings.WaitScanRate = 3
wait(skype.png, FOREVER)
while exists(skype.png, 0):
  wait(0.5)
HomeAssistant.focus()

The WaitScanRate and wait(0.5) values could also be modified, if it is
not time-critical.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-03 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Answered => Open

cemara is still having a problem:
HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
Settings.WaitScanRate = 3
While True
  wait(skype.png, FOREVER)
  while exists(skype.png, 0):
wait(0.5)
  HomeAssistant.focus()

So i've tested this but when running the cpu usage is still high, am i
coding it correctly?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-03 Thread RaiMan
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Answered

RaiMan proposed the following answer:
--- ...waitscanrate but apparently it's used for region, 
every image search towards a screen in SikuliX is done on a Region (undotted it 
is the whole screen).
Hence setting WaitScanRate is respected by all following screen image searches 
until changed again.

waitVanish might not work as expected in earlier versions of SikuliX.
Same goes for someApp.focus() on Windows (try with App.focus("part of 
window-title"))

instead of waitVanish you might use:

while exists(img, 0):
wait(0.5)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-03 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Answered => Open

cemara is still having a problem:
The workflow is nothing complex, 
1. Skype call set for autoanswer.
2. Make call to tablet, Skype autoanswered, a contact window shows up, 
3. wait until that call is finished > this part can only be done with GUI based 
automation since skype has no API handle.
4. So i'm using a call button pic that only shows up during a call session, and 
wait until that session is finished.
Thus wait and watvanish is needed. 
5. Bring home assistant window on top again since that call window wont 
minimized by itself, also sometimes there is call quality survey window as 
well, this should be covered too.

I've looked into the waitscanrate but apparently it's used for region,
how would i use it for single image like this?


HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
While True
  wait(skype.png, FOREVER)
  waitVanish(skype.png, FOREVER)
  HomeAssistant.focus()

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-03 Thread RaiMan
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Status: Open => Answered

RaiMan proposed the following answer:
Since I cannot see your screen content and do not really understand the
workflow based on your info, I give you this general advise: When using
SikuliX for workflow automation, first try to script, what you would do
manually to reach the target situation. In most situations this is
sufficient. Then add some logic, to evaluate the auto start of you
workflow. All this usually is a sequence of wait's and click's.

on resource consumption: in the standard SikuliX tries 3 times per
second when waiting for an image. On slow machines this usually leads to
up to 100% peak machine use and high average over the time (especially
with FOREVER).

So you either have to use exists(img, 0) (only one search)  and a loop
construction that wait's in between (e.g. wait(0.5)) or you use the
parameter Settings.WaitScanRate to reduce the tries per second (e.g. 1
is 1 per second, 0.5 is one every 2 seconds, ...).

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-03 Thread cemara
Question #702646 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702646

Description changed to:
Hi, i'm working on home assistant  (HA) display tablet based on
windows10 LTSC 2019  for elderly,

the tablet serves various functions but mainly as viewing cctv station
to know who's in front.

Now i'd also like to the tablet for auto answer videocall for emergency
use. The only software capable for this so far is skype.

Problem is after a call session, skype contact window blocks the HA
instance, and it wont minimize automatically.

So i've used sikuli like this to bring HA in front after each skype
call. Where skype .png is a call / hangup button pic.


HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
While True
  wait(skype.png, FOREVER)
  waitVanish(skype.png, FOREVER)
  HomeAssistant.focus()


The problem is this takes large toll on resources, at times 50-60% which is 
understandable since it's a NUC5cphy machine.
And it makes other apps impossible to run
But i'm restricted in terms of resoure since the whole system runs on POE (30 
watts max)
So is there any other approach that is more resource friendly for my case?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #702646]: Optimizing resource usage

2022-08-03 Thread cemara
New question #702646 on SikuliX:
https://answers.launchpad.net/sikuli/+question/702646


Hi, i'm working on home assistant  (HA) display tablet based on windows for 
elderly,

the tablet serves various functions but mainly as viewing cctv station to know 
who's in front.

Now i'd also like to the tablet for auto answer videocall for emergency use. 
The only software capable for this so far is skype.

Problem is after a call session, skype contact window blocks the HA instance, 
and it wont minimize automatically.

So i've used sikuli like this to bring HA in front after each skype call. Where 
skype .png is a call / hangup button pic.


HomeAssistant = App(r"c:\HA\Home_Assistant.exe")
While True
  wait(skype.png, FOREVER)
  waitVanish(skype.png, FOREVER)
  HomeAssistant.focus()


The problem is this takes large toll on resources, at times 50-60% which is 
understandable since it's a NUC5cphy machine.
And it makes other apps impossible to run
But i'm restricted in terms of resoure since the whole system runs on POE (30 
watts max)
So is there any other approach that is more resource friendly for my case?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp