(start|play) music
Код
runScript('playFavoriteMusic');
|
light off
Код
$lroom="living room";
$looby= lobby;
$rroom= "raivis room";
$luroom= "luize room";
$proom = "parent room";
$wroom= "work room";
$toil= toilet;
$kitc= kitchen;
$clroom="Living room";
$clooby= Lobby;
$crroom= "Raivis room";
$cluroom= "Luize room";
$cproom = "Parent room";
$cwroom= "Work room";
$ctoil= Toilet;
$ckitc= Kitchen;
if($matches[1]== $lroom||$matches[1]== $clroom){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay01.turnOff");
callMethod("Relay12.turnOff");
}
elseif($matches[1]== $looby||$matches[1]== $clooby){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay11.turnOff");
}
elseif($matches[1]== $rroom||$matches[1]== $crroom){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay06.turnOff");
}
elseif($matches[1]== $luroom||$matches[1]== $cluroom){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay07.turnOff");
}
elseif($matches[1]== $proom||$matches[1]== $cproom){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay08.turnOff");
}
elseif($matches[1]== $wroom||$matches[1]== $cwroom){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay09.turnOff");
}
elseif($matches[1]== $toil||$matches[1]== $ctoil){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay04.turnOff");
}
elseif($matches[1]== $kitc||$matches[1]== $ckitc){
$tests.= $matches[1] ." Turn Off light".'.';
say( $tests,2);
callMethod("Relay10.turnOff");
}else{
say( "didn't understand the room name",2);
}
|
light on
Код
$lroom="living room";
$looby= "lobby";
$rroom= "raivis room";
$luroom= "luize room";
$proom = "parent room";
$wroom= "work room";
$toil= "toilet";
$kitc= "kitchen";
$clroom="Living room";
$clooby= "Lobby";
$crroom= "Raivis room";
$cluroom= "Luize room";
$cproom = "Parent room";
$cwroom= "Work room";
$ctoil= "Toilet";
$ckitc= "Kitchen";
if($matches[1]== $lroom||$matches[1]== $clroom){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay01.turnOn");
callMethod("Relay12.turnOn");
}
elseif($matches[1]== $looby||$matches[1]== $clooby){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay11.turnOn");
}
elseif($matches[1]== $rroom||$matches[1]== $crroom){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay06.turnOn");
}
elseif($matches[1]== $luroom||$matches[1]== $cluroom){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay07.turnOn");
}
elseif($matches[1]== $proom||$matches[1]== $cproom){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay08.turnOn");
}
elseif($matches[1]== $wroom||$matches[1]== $cwroom){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay09.turnOn");
}
elseif($matches[1]== $toil||$matches[1]== $ctoil){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay04.turnOn");
}
elseif($matches[1]== $kitc||$matches[1]== $ckitc){
$tests.= $matches[1] ." Turn On light".'.';
say( $tests,2);
callMethod("Relay10.turnOn");
}else{
say( "didn't understand the room name",2);
}
|
Play radio
Код
sayReply("Eiropas hītu rādio ir 1",2);
sayReply ("Eiropas hītu rādio Superhiti ir 3",2);
//say("Saldus",2);
sayReply("Rādio Skonto ir 5",2);
sayReply("izvēlaties raidsatciju beigās nosaucot ciparu angliski",2);
|
|
report system state
|
stop radio
|
time
|
tv off
|
tv on
|
weather
|