CoRE - Get peer assistance here with setting up Pistons

I looked at the examples for setting the dim level of switches and created a piston that sets the level to 30 between 8:30 PM and Sunrise for the shower lights, which is what we use at night to avoid blinding ourselves. The problem, is that setting the level also turns on the lights. How would I set the level and leave the switch off? I tried adding turn off, but the simulate (changed to not in between to make the time check true) piston doesn’t work as the switch is in the same state.

My goal is to have it set to level 30 after 8:30 PM (kids bedtime) when the switch is off, but if the switch is on, it will wait for it to be turned off in that time frame and then set the level (so the next person isn’t rudely surprised).


I am trying to set a piston that when I arrive home it would change my mode based on executing a routine that sets the mode. Before I add the rest of my modes I want to ensure I am going down the right path.

In the THEN, I set restrictions for the days and time between but I am thinking there should be ORs between each item. So I would have the THEN and something OR something else OR something more.

Real newbie and have a couple ideas, but no idea how.

One is to turn on a siren and then off in a few (x) seconds.

Second is an interval timer, on for x, then off for x, repeat…

Not even sure of what type of piston to use.


Hi all, I’m trying to setup my first piston and am heaving a little trouble getting a particular piece done. I did some searching but didn’t find any similar questions (maybe my search skills suck). I’m trying to enable a scenario where my dimmer switch is on and I want to increase brightness to 100% if I tap “on” on the paddle again. Essentially:

Tap on -> dimmer turns on to previous value, e.g. 20%
Tap on any time later -> dimmer increases to 100%

I’m just don’t see a condition that listens for the “On” command when a switch is already on.

Hi everyone. I was just wondering if anyone has experience with recordClip(…). Is the record duration determined within my camera App (Arlo), or is it based on the parameter that can be set with that action? I wanted to record for a minute if motion is detected with in a certain time range, and I think I have the trigger and conditions set, but I was stumped by this portion.

I tried it without involving a variable and it immediately sets the level at 100.

My test piston was:

Switch changes to on
Switch is on
Using Switch
  > Set level to 100

I’m thinking of doing this, completely untested :slight_smile:

Switch changes to on
Variable switchedOn equals false
Using location...
  > Set switchedOn to true
// Set the variable during initial tap

Switch changes to on
Variable switchedOn equals true
Using Switch...
  > Set level 100
// Set level to 100 since the inital tap already registered

Switch changes to off
Variable switchedOn equals true
Using location
  > Set switchedOn to false
// Set the variable back to false for the next tap

Try using the “load attribue level from variable” task, you might have to initialize the variable to the level you want first.

A basic piston would work for the first one about the siren…

Your_Triggger here
Using Siren
  > Turn on
  > Wait X seconds
  > Turn off

Not sure about your interval timer though, what’s the use case?

My question related to this was how does it capture the switch event if the light is already on?

I tried to test this using various triggers and conditions I couldn’t seem to find the right combination to get noticed if the switch was already on.

I checked the live logging briefly when I tried the first piston. The second tap was registering as another on (for that device I have). I did not have time to give the second version a try though.

Is it possible to insert or reorder actions? It’s a PITA to re-enter 10 actions when you realize you needed one ahead of them. :slight_smile:


I’m trying to set up a piston where my schlage lock will change alarm mode based on the hub mode. When I go into the lock event history, it is setting the value as “setAlarmMode” but the mode isn’t actually changing

Is there something I am missing?

Thanks @eibyer, I think the problem is that the dimmer doesn’t send another “on” command of is already on. At least the Recent Activity view doesn’t show it.

Any idea if this is the case? Any way around this? There is a double tap smart app, this makes me think a solution is possible.

Hey all I’ve been trying to figure out this simple piston and for the life of me cannot get it working. I’m sure it’s something easy.
What I want it to do is text me when one of my temperature sensors is above or below a set number, but only once every couple hours so I’m not getting a bunch of messages.
Everything works except it will not wait 120 minutes until it fired again. It will continue to send SMS messages as the temperature changes every time.
I know the issue is the wait command at the end, I just don’t know what to put in its place
Here’s what I have so far:

I didn’t check the recent view on the st app but I did look the web IDE live logging. I will give that second piston a try when I get home (if I don’t sidetracked).

There’s an option “piston or state change only” that you can try enabling but it will still ignore the 120 minute wait you have. If you need that 120 minute wait, you will have probably have to involve a variable that can be checked if the notification has been triggered already and then you’ll have a timer in that piston that will reset that variable back to false after 120 minutes waiting for another event.

I’m with you. I think it is going to depend on what type of switch / dimmer you use. I have the GE dimmer installed. I can not see any events in live logging or Event list for that switch on the IDE if the switch is already in the state your trying to switch to.

I turned it on and pressed the on button again. The original on is in the IDE event list but not any of the latter. I do see my CoRe piston sending the level commands from my auto control. Which is interesting but really does you no good. If you can’t see the switched pressed again then you can’t trigger your CoRE piston on that event.

If I remember right others had issues with the double tap and the GE switches. There is another brand of switch that I believe has double tap functionality built into the switch.

So maybe if you used that switch in the places you needed this functionality, it might work? I believe it would also require the custom DTH.

1 Like

So, @bamarayne helped me out with something similar to this back in August: CoRE - Get peer assistance here with setting up Pistons

Basically, it uses a variable as a condition, notification only fires when the correct variable state exists.

Works - but the sim switch I’m using stays on ,negating running again.
Tried a button but Alexa does not seem to work. Need a way to reset the sim back to Off.

Also is the only turn off a delayed off? It works.but need to set a time.

interval timer is for a planned hydroponics setup net Summer, on 10-20 seconds and then off for 15 minutes repeat. Last time I did this I was using industrial timers but want to be able to track power usage. I could always buy a timer and use a ST device to track power - but seems excessive.

See if you can set up a virtual simulated button… which I think is normally off. The piston would look like this:

Button changes to pushed

Edit: Just read that you tried a button. Hmm, you can probably integrate the turn off of the switch in the piston itself.

Your_Triggger here
Using Siren
> Turn on
> Wait X seconds
> Turn off
Using Your_switch
  > Wait X minutes
  > Turn off