This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Number of "Pulses" Detection
#11
Hi,

In the above script created by admin I would like to control scenes sequence (order and delay) between scenes for the same G.A. instance like below.

Is it possible to implement this with 'os.sleep' function as below?

Is there any way I could control scene sequence (order and delay) when multiple scenes should run with same command.

Thanks in advance!

   
Code:
-- ΣΚΗΝΗ @H - H - Leave Home for a while
['20/1/130'] = {
    timeout = 0.5,
    longpress = 5,
    press = function(ptype, count)

      if ptype == 'short' then
        if count == 1 then
          scene.run('@H - R1 - Leave Home for a while - Lights')
          scene.run('@H - R2 - Leave Home for a while - Lights')
          scene.run('@H - R3 - Leave Home for a while - Lights')
          scene.run('@H - R4 - Leave Home for a while - Lights')
          scene.run('@H - R5 - Leave Home for a while - Lights')
          scene.run('@H - R6 - Leave Home for a while - Lights')
         
          os.sleep(0.2)
         
          scene.run('@H - G_LR/DR/KTC/COR - Leave Home for a while - Lights')
          scene.run('@H - B1_LR - Leave Home for a while - Lights')
          scene.run('@H - F1_COR - Leave Home for a while - Lights')   
          scene.run('@H - LDR/RF - Leave Home for a while - Lights')
          --scene.run('@H - H - Leave Home for a while - Outside Lights')
        elseif count == 2 then
          scene.run('@H - R1 - Leave Home for a while - Lights')
          scene.run('@H - R2 - Leave Home for a while - Lights')
          scene.run('@H - R3 - Leave Home for a while - Lights')
          scene.run('@H - R4 - Leave Home for a while - Lights')
          scene.run('@H - R5 - Leave Home for a while - Lights')
          scene.run('@H - R6 - Leave Home for a while - Lights')
          scene.run('@H - G_LR/DR/KTC/COR - Leave Home for a while - Lights')
          scene.run('@H - B1_LR - Leave Home for a while - Lights')
          scene.run('@H - F1_COR - Leave Home for a while - Lights')
          scene.run('@H - LDR/RF - Leave Home for a while - Lights')
          --scene.run('@H - H - Leave Home for a while - Outside Lights')
          scene.run('@H - H - Leave Home for a while - Curtains')
        end
         
      elseif ptype == 'long' then
          scene.savelive('@H - R1 - Leave Home for a while - Lights')
          scene.savelive('@H - R2 - Leave Home for a while - Lights')
          scene.savelive('@H - R3 - Leave Home for a while - Lights')
          scene.savelive('@H - R4 - Leave Home for a while - Lights')
          scene.savelive('@H - R5 - Leave Home for a while - Lights')
          scene.savelive('@H - R6 - Leave Home for a while - Lights')
          scene.savelive('@H - G_LR/DR/KTC/COR - Leave Home for a while - Lights')
          scene.savelive('@H - B1_LR - Leave Home for a while - Lights')
          scene.savelive('@H - F1_COR - Leave Home for a while - Lights')
          scene.savelive('@H - LDR/RF - Leave Home for a while - Lights')
          --scene.savelive('@H - H - Leave Home for a while - Outside Lights')
          scene.savelive('@H - H - Leave Home for a while - Curtains')
      end
     
    end
  },   
Reply


Messages In This Thread
Number of "Pulses" Detection - by p_xatzi - 04.10.2021, 11:06
RE: Number of "Pulses" Detection - by Daniel - 04.10.2021, 11:17
RE: Number of "Pulses" Detection - by p_xatzi - 04.10.2021, 14:15
RE: Number of "Pulses" Detection - by p_xatzi - 25.10.2021, 11:12
RE: Number of "Pulses" Detection - by admin - 25.10.2021, 11:35
RE: Number of "Pulses" Detection - by admin - 26.10.2021, 08:18
RE: Number of "Pulses" Detection - by p_xatzi - 26.10.2021, 09:31
RE: Number of "Pulses" Detection - by admin - 26.10.2021, 09:39
RE: Number of "Pulses" Detection - by p_xatzi - 31.10.2021, 22:15
RE: Number of "Pulses" Detection - by admin - 01.11.2021, 07:32
RE: Number of "Pulses" Detection - by p_xatzi - 20.04.2022, 07:22
RE: Number of "Pulses" Detection - by admin - 20.04.2022, 07:36
RE: Number of "Pulses" Detection - by p_xatzi - 20.04.2022, 08:23

Forum Jump: