This object is in archive! 

Need help with two rules

johannes helje shared this question 9 years ago
Need Answer

Hi!


I need help creating two rules.


The first is for a switch.

I want it to run a scene turning ON all the lights in the apartment if ALL lights are OFF or turn OFF all the lights in the apartment if there is one or more lights ON. I've tried making a rule with a variable sensing if the switch is off or on, but because it's a bipole switch that only works have of the time. If there's some lights on, it turnes them off, but sometimes it just runs the scene and then I have to flip the switch again to turn off all the lights.


The second rule is a simple coffee machine timer. I have a switch that I want to switch off 2 hours after I switched it on.


I've attached the current rule.

Replies (2)

photo
1

01)

How many light do to you have?


For each ligt make this rule:


  1. Light x

    When Light x = Any

    If Light x = On

    Set var Light > 1

    Else

    Set var Light > 0


    Light y

    ....


  2. Main rule

    When virtual switch x = On And Var Light = 1

    Scene x = Off

    Else

    Scene x = On


    Maybe you could combine it into 1 rule.


02)


  1. When Coffee Switch=ON

    WAIT xx

    Coffee Switch=OFF


But it's better to make it like this (check if you turn it on again):


When Coffee Switch=ON And NOT Var Coffee =1

  1. SET VAR Coffee > 1

    WAIT xx

    Refresh ALL

    IF VAR Coffee =1

    Coffee Switch > OFF

    SET VAR Coffee > 2


  2. When Coffee Switch = ON and Var Coffee = 1


    SET VAR Coffee > 2

    WAIT xx

    Refresh ALL

    IF VAR Coffee =2

    Coffee Switch > OFF

    SET VAR Coffee > 2


This way the coffee machine is never turn off if you turn it on again.

photo
1

where i can do that ?

can u explain the attached seen in that comment ?

where can i see that interface ?

photo
1

What do you mean?


You can creator this rule with the rule creator.

photo
photo
1

Here is a little introduction on the rule created to get you started:


http://wiki.zipato.com/wiki/Overview_(Rules_Creator)

Leave a Comment
 
Attach a file