Tips: NexaHome + Duo --> Home/Away automatik

Moderators: hekj, Telldus

Post Reply
hekj
Posts: 992
Joined: Fri Mar 17, 2023 9:45 am
Location: Stockholm
Contact:

Tips: NexaHome + Duo --> Home/Away automatik

Post by hekj »

Den som har en eller flera IR-detektorer innomhus kan få Mode att växla automatiskt mellan Home och Away genom att använda bsh scripts.

no_ir_detected.bsh

Code: Select all

if (hourIsGreaterThan(21) || hourIsLessThan(7)) {
   startTimer("no_ir_detected", 60 * 60);  // 1 hour
} else {
   if (!modeIs("Away")) {
      echo("No IR detected!");
      mode("Away");
   }
}
20.bsh

Code: Select all

if (deviceIsOn("20")) {
   echo("IR Kylskåp - ON");
   if (!modeIs("Home")) {
      mode("Home");
   }
} else {
   echo("IR Kylskåp - OFF");
}
if (timerIsRunning("no_ir_detected")) {
   stopTimer("no_ir_detected");
}
startTimer("no_ir_detected", 120 * 60);  // 2 hours
Skapa en ny bsh fil för varje ny IR-detektor som tillkommer.

Se även följande inlägg:
http://www.telldus.se/forum/viewtopic.php?f=1&t=1040
Post Reply