I don't know what you are asking me any more... it is a bit hard to follow after all your posts.
What error are you getting? Maybe if you can upload all the xml and all the python that you are using, I can try to make some sense of it.
Impossible. vc.callAction will never return a value.
The first question I would ask is, why is the sensor sending the event more than once? What kind of sensor is it?
One way to avoid the problem with the sensor triggering multiple times is this.
1 - When your code is initialized, store the current time in a variable called "lastTriggerTime".
2 - Every time the sensor triggers your code, you compare the current time to the last time that was stored in lastTriggerTime. If it has been less than 5 seconds (or whatever period of time works best) then exit.
3 - Update the variable lastTriggerTime to the current time.
another option would be to use a timer, but that is more difficult.
Ok, you can test this by yourself, but this is working
powerArCondition =vc.callAction("File.Read","{Path.VC}\Devices\ArGree.txt",None)
I tested this a few minutes ago, but maybe i did something wrong or forgot to delete something, but i am almost sure that this is working because was my first test with a OSD showing the value of the powerArCondition, before change the script.
What i want understand is how Vox call the actions when a script is running (or stating to run), because i need to understand if this is a asynchronous thing. Sorry but i will not be able to explain again, try to read my last posts, i know, my English is bad, but i explained two situations: One its using the action to set a variable and prevent the action to run again, the other way is use the script, but the action run every time that i get a new feedback (its a serial feedback).
My objective its not exactly put the code to work, i can do this in a few ways. What i want is understand how a action, a event and a script are related.
- If two events run almost at the same time, and the first event have a script, what will run first ? The script or the second event ? In the example that i put in the previous post the second event run first.
- If a script is running and Vox get another event that trigger a action, what will happen ? Vox will wait until the script stop to run or will execute the action immediately ?
I have to understand this to prevent a variable to change before the script finish the code, among other things.