Help with rule machine

Hi, I'm new to Hubitat and I don't know how to do this in rule machine (I come from smartthings and I have it done in webcore). It is as follows: if contact sensor 1 opens, and within the next minute, contact sensor 2 opens, then turn on light A.
Could you help me?
Thanks in advance.

You can still use webCoRE.
I have around 100 pistons running smoothly.

I suppose this doesn't help you if you are trying to learn/use RM but thought I would mention it in case you were unaware.
(And of course you can just import your ST piston to HE).

1 Like

Thanks for your answer. Yes I have webcore in HE, but my query is because I want to do it in RM and avoid Webcore. Not for anything in particular, but for doing it in the "native application".

First, there's a way you could do this without Rule Machine at all (besides webCoRE) if you want, though it does involve combining a few different things to get what you want:

  • Use this app to turn your contact sensors into (different) virtual motion sensors: Contact-Motion app, which opens up the possibility to use contact sensors in places where many "standard" apps assume motion sensors
  • Use a Zone Motion Controller to tie those two sensors into one and require "activation" of both within your specified window (1 minute) in order for the "zone motion" device this app will create to become active. Use the "False Motion Reduction" type of zone.
  • Now, use this zone motion sensor in any app you want: Simple Automation Rules (formerly Simple Lighting), Motion Lighting, or (I wouldn't start here but it's still an option...) even Rule Machine.

If you did want to go straight to RM, I still see it being best done with a couple rules, though I'm thinking you might be able to get it down to one as long as you don't expect quick (probably <1 second and probably really even less) changes in both sensor states. That's another story but I could share what I'm thinking if you did want. :slight_smile:

3 Likes

Ok, thank you very much for your response. I will try to do what you tell me.

Regarding the time window between one sensor and another, it is necessary that it only be activated if sensor 1 has opened and sensor 2 has opened within the next minute. But not the other way around, that is, it should not be activated if sensor 2 has been opened first and then 1.
I think that with the solution you have told me, it is activated in both cases, and that is not what I need. Is it possible or am I wrong?

Without knowing exactly what you are trying to do, is this the sort of thing you are trying to achieve.
This may give you some pointers.

image

1 Like

I think I have solved it as indicated by @bertabcd1234, changing the type to triggered activation in the motion zone controller.
Thanks, @bobbles , I'll try as you tell me, to learn RM. It is different from Webcore and it costs me.
Thank you all.

1 Like