11
« on: March 09, 2014, 04:27:33 AM »
Here is my first attempt at this so i hope it is all ok.
This script is one that you can run if you have HA and you want to shut everything down as you leave the house.
It currently is using x10 command but could be adapted for any HA system.
I did want to have a "cancel shutdown" command in case I want to halt the count down timer but I could not get it to work correctly.
BTW - the count down timer only goes for 20 sec but you should be able to see how to adjust that.
The alarm is controlled by my HA system so there are no commands for it in the script.
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="House Shutdown" enabled="True" prefix="" priority="3" requiredProcess="" description="">
<command id="688" name="House shut down mode" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Do you want me to shut the house down?</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.On</cmdType>
<cmdString />
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>I am leaving, I am leaving the house, </phrase>
</command>
<command id="520" name="Shut house down" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>{LastSpoken}&&be good</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Ok I will initiate the House shut down procedure</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>I will turn off all the lights and activate the alarm system</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>the shut down process will occurr in 60 seconds</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.TellVox</cmdType>
<cmdString>Count Down Timer</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>{LastSpoken}&&not today</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Understood, the house will remain in the current mode</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<phrase>that would be good, not today</phrase>
<phrase optional="true">yes, ok, no</phrase>
</command>
<command id="549" name="Count Down Timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>initiating the house shutdown procedure</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>You have 60 seconds to leave the house.</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>59, 58, 57, 56, 55, 54, 53, 52, 51, 50,</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>10, 9, 8, 7, 6, 5, 4, 3, 2, 1,,,</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>The House Shutdown has been Initiated.</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>X10.SendPlc</cmdType>
<cmdString>K1 ON</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Count Down Timer</phrase>
</command>
</commandGroup>