Hi All,
I am trying to send a url that switches on my lights and then close the browser.
Switching on my lights works - but for the life of me I can't then close the browser.
<?xml version="1.0" encoding="utf-16"?>
<command id="249" name="Lights On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Launch.OpenURL</cmdType>
<cmdString>http://192.168.0.112/lightwaverf.php?room=living&device=socket&state=on</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Window.Close</cmdType>
<cmdString>firefox</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Enable Standing Light</phrase>
</command>
Can any one tell me what I am doing wrong.
Best wishes.
I suspect that you are trying to close the window before it has a chance to open. I don't think the Launch command waits for the web page to load or anything like that, before moving on to the next action.
I suggest that you use the scrape command instead, so you won't need to worry about opening a browser at all, and it will be much faster. Plus if you happen to be using firefox at the time you don't have to worry about firefox closing when you want to turn the lights on!
Try this:
<?xml version="1.0" encoding="utf-16"?>
<command id="249" name="Lights On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Scrape</cmdType>
<cmdString>http://192.168.0.112/lightwaverf.php?room=living&device=socket&state=on</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Enable Standing Light</phrase>
</command>
Super - That works.
Appreciate your help.
Best wishes.
Hi Guys,
I am using the stable version 2.0.
I want to use this code from james. How can I use it exactly? I think I have to save as xml and change my url of course. But how to load this xml to a command exactly??
Please help! I am loving voxcommando and will buy this week after my tests.
Best regards
Welcome eTrust.
Looks like you've missed a very important wiki page! http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum
Knowing how to copy and paste xml into your command tree will make the forum posts a lot more useful. :)
oh yes thank you very much!!!