CoRE - Get peer assistance here with setting up Pistons

Ok, got it. I know about the individuals evaluations and individual actions… Even when in a group.

I did not know about the if then to be used to inhibit others conditions…

Understood, thanks.

2 Likes

Well, the part that turns the light off is not connected to any time condition. It may turn off the light at any time.

The “THEN IF” grouping method will prevent further evaluation of conditions if one is false.

For example

IF 
  A
  THEN IF
  (
    B >> when true do 1
    OR
    C >> when true do 2
  )

1 and 2 will only run when and if A is true. If A is false, B and C are never evaluated, hence 1 and 2 never run. If the THEN IF were an AND, then 1 and 2 may still run if B or C were true, regardless of A’s value.

ahhhh. much easier to read the logic this way. Thank you… :wink:

What are you trying to do?

Rick,
I sent you a PM on this one. In the third group down you need to add the date/time restriction that is in the first group. Those two restrictions MUST be exactly the same.

This fixes your problem. Let me know if there are any more bugs in the design.

@ady624
What this piston does is this.

1 - Door opens and light turns on
2 - Door closes and light stays on
3 - Door opens a second time and light still stays on
4 - Door closes a second time, and light goes off.

The last two groups of the piston are there for syncing. Without them the entire piston is unstable and fails. I designed this in RM and converted it over to Core back in the early days of core. It works great! and it works even better now that I figured out the bug that was in it… Hopefully (I’m pretty sure) there aren’t any more… unless Rick changes his use case on it.

This type of piston is handy for letting the dog out… light comes on when the dog goes out and doesn’t turn off until the dog comes in. Same with the garage.

We have identified a bug in the Osram DTH and will roll out a fix asap.

2 Likes

Yeeey thank you! @jody.albritton you are the man!

@ady624

Got a question.

I know that the number of actions is limited to 4… but what if I do it like this???

Group A
(Device - Action 1, Action 2, Action 3, Action 4)
Group Action 1, Group Action 2, Group Action 3, Group Action 4

That gives me 8 Actions for a device. Is that stable?

Who said it is limited to 4? I set no limit… But if you ask many things that change the same raw attributes then the result may seem random :wink:

You said they are limited to four. It’s a limitation of the system. When you add a 5th things do not work right at all.

@ady624

Bug Report

Pistion - Then-IF

Primary IF
(Motion 1, Motion 2, any changes to active)

Primary Then
Blank

Then If
(Mode is Morning and Contact Sensor Closed)
Do if True - Using 3 lights, set level to 80%, wait 2 minutes, turn off

Expected behavior
Motion goes active and the lights come on. I expect the lights to stay on until two minutes after I leave the room. So, the motion sensors do not report “No Motion” until the built in time out on them. As long as I keep moving, then they stay active. Also, if they do go inactive, but go back to active before the 2 minute shut off timer I expect the lights to stay on.

What the problem is
If sensor 1 turns on the lights then sensor 1 has to stay active the entire time. But, the room has two sensors and because of the shape they do not see each other. This means if I walk in the room and sensor 1 turns on the lights, I then walk out of sensor 1 area into sensor 2 area, the lights go off after two minutes, even with sensor 2 staying active.

It seems that the “Pending off” option is not working and even though both sensors are in a group, they are not resetting the schedule for each other… as they should be doing.

What the other problem is
using “Motion is active” does NOT turn on the lights… it does nothing.
Using “Motion changes to active” turns on the lights, but does not reset the pending timer.

How I worked around the problem
I added a group.

Pistion - Then-IF

Primary IF
(Motion 1, Motion 2, any changes to active)
or
(Motion 1, Motion 2, and is active)

Primary Then
Blank

Then If
(Mode is Morning and Contact Sensor Closed)
Do if True - Using 3 lights, set level to 80%, wait 2 minutes, turn off

  • After adding the extra group, the piston works as it should.

EDIT @ady624
I stand corrected. That did not fix it. The lights will only stay on as long as add the motion sensor that turned them on stays active.

This is a major problem for me.

I have a few of thes pistons to control my ceiling fan for different temperatures, is there a way I can make this piston inactive for a period of time if someone manually changes the speed?

The lights will only stay on as long as add the motion sensor that turned them on stays active.
This is a major problem for me

I haven’t tried thismyself, but you might be able to get your Piston to work by using one of Mike Maxwell’s uDTH as the motion sensor (which is triggered active by either of your actual motion sensors).

1 Like

Jason, the keyword here is “leave”. You want the lights to turn off 2 minutes after you leave. Motion sensors are not constantly reporting you are “still there”. They only report active once, then inactive once whenever you left. This means that if you are constantly moving for two minutes, the wait will time out before any other motion event is sent to the piston. Your piston needs to “think” along these lines:

Motion is active > turn on
Motion is inactive > wait 2 minutes, turn off

This is simply because of the way motion sensors work…

I never said that. The only 4 I know of is the total number of ST jobs an app can have at any given time. And that is not the case here.

So, are you saying I have to build both of these into the piston?

To make it work correctly, yes. It’s the way it works. Extending the 2 minutes will also give it more chances to not miss. But the correct way is to turn it off 2 minutes after inactive.

Still a blank screen.

Ok, so I’m thinking that if (is active) was working this would not be a problem.

But to ver clear, there is no such thing as a pending off CoRE? This isn’t programmed into the back-end? Like in smart lighting or rule machine?

Intuitively, a user would think along these lines…

Motion reports active --> light turns on
Motion reports inactive --> 2 minutes later, lights go off, unless motion is restarted within those 2 minutes.

Seems simple. So, how do I program this to not turn the lights off until two minutes after motion has stopped? Meaning, that the turn off timer restarts every time a new motion event occurs.