CoRE - Get peer assistance here with setting up Pistons

Here’s a good example in one of my Pistons:

Ouch! My head hurts! I think I am getting what you are saying. I will look at your example closer and try to figure out how to lay mine out. Thanks for all the help!

Just that it is enabled for motion/recording. There’s no point in trying to disable it if it is already disabled. The switch worked fine, but I guess I still don’t understand why CoRE gives the error that it does without me even getting the chance to select a capability.

@ady624 or anyone else that may know.

Can I create a global array variable?
Can I create a set of global variables and then reference one of those based on the value of another in some way (Can you reference variables in a nested way?)?

Use case:

$DoorSlot1 = Dad
$DoorSlot2 = Mom
$DoorSlot3 = Kid
$DoorSlot4 = Special_Guest

If (Lock is unlocked by code 1,2,3,4) Then Send Push Notification: Door Unlocked by {@DoorSlot{$currentEventDeviceIndex}}.

The objective is if the door was unlocked by Door lock user #2, the notification would say: Door Unlocked by Mom.
This exact example actually returns: Door Unlocked by {@DoorSlot2.

Maybe I’m going about this all wrong. I’m open to suggestions if anyone has them. I am essentially trying to write 1 piston that will handle door unlock code notifications, but inject names instead of the door lock user number.

Arrays are not supported yet, although the “state” store is actually a map. I can have the {variable{index}} work though. Will give it some thought.

1 Like

Would this work for your use?

Hi guys - I have the ZWN-SC7 Enerwave 7 Button Scene Controller. I would like to set up a Piston so that when a particular Scene button is pressed it triggers a specific LIFX Scene that I’ve created in the LIFX app. Is this possible, and if so, how? Thank you!

You could link that LIFX scene to a virtual button using Ifttt, then create a piston that turns on that virtual button when your scene controller is pushed.

So, I was using the Goodnight routine to trigger my night mode, but it was unreliable when the wife and I are being extra lazy… it was based on ‘when things quiet down’ and would sometimes trigger when we were still awake.

So I figured I’d move it into CoRE so I could add my TV outlet into the mix. If there’s no motion and the TV is off, we in bed! I’m loking for input on this piston. We went to bed last night at 10pm… the house did not achieve night mode until 4:06am. Last motion was detected at 10:17pm. TV outlet was at 0w before last motion. Thanks!

(with that 15 minute wait I have in there… it almost looks like it waited until the time restriction window was over, then put the house in night mode)

This one is easy. The piston is acting normally. Problem is, when dealing with power meters, they keep reporting data (chatty little critters), causing your piston to keep reschedulling the 15 min wait, effectively postponing the actions. Easy fix: restrict the actions to only execute on piston state change… then your piston will do exactly what you want :wink:


Oh word, thanks!! Haha!!

1 Like

Hi, can anyone help with providing clarity on my query below:

Also, you do not need two actions. You can add the SHM after the mode change, they will both be performed at the 15 min mark.

Could you please rephrase your need into several phrases? I can’t really figure out when one condition stops and the other one starts. Also, starting backwards may help. Start with the light - figure out on paper when the light needs to be on and at what %. Then we can write some conditions…

Yeah I must have been tired… it doesn’t even make sense I did that, thanks!

1 Like

Got it. Let me get scribbling and I’ll come back ask my question more clearly. Thanks for taking a look

Currently, my washer and dryer are are hooked up to some Aeon power meters. I have a smartapp running that reports if they lose power thus basically meaning my house is on my generator. I’d like to convert this smartapp to a piston, but not sure of the comparison logic to use for the power meter capability. Has anyone done this yet? @ady624

I finally got this figured out but now I am wondering if I can just use the WHEN TRUE in the BUT IF statement also instead of using it in the THEN section?

I do not see SWITCH and CASE logic available in my version of CoRE (

Enable expert mode

1 Like