CoRE - Get peer assistance here with setting up Pistons

It looks like the IF is checking if the Outlet is ON, did you mean OFF?

If on (manually), I want it to stay on until either off manually or it’s midnight.

First off, the Turn off after x ms cannot be cancelled because the command is sent to the device with a delay. Use a Wait 35 seconds followed by Turn off instead. Also, you can put all the tasks (send push and turn off in one command)

I’d do this:

IF
   Power Outlet switch is on
   AND
   Power Outlet power is less than 15W
THEN
   Using Power Outlet... (TCP: cancel on piston state change)
      > Wait 35 seconds
      > Turn off

See how that works


2 Likes

Wow, thank you @ady624 so much
 that was much easier than what I was attempting and it made more sense once I followed your lead. I see that you can TCP a whole section


1 Like

Is there a way to use multiple global variables as criteria for a piston to evaluate, or to concatenate multiple variables?

Use the Variable capability and then evaluate the global variables in your conditions. You can also concatenate text with variables like what I had rigged below, so you should be able to do the same with multiple variables.

● My ecobee3 coolingSetpoint changes
When true...
Using location...
â–ș Set number variable {@coolingSetpointValue} = $currentEventValue
â–ș Set string variable {@thermostatStatusString} = "Cooling to {@coolingSetpointValue} F"
â–ș Send notification 'Thermostat Status String: {@thermostatStatusString}' in notifications page

Can one help with When to use the “Only execute on piston state changes”?

I have a CoRE piston defined that watches a outlet with a power meter reading. I want to send ONLY ONE notification of which range the power meter is reporting when the power reading is in three pre-defined ranges. I have the CoRE piston defined with three different notifications so I can distinguish which range the power meter is reporting.

I have noticed that I get several CoRE notifications within the same defined range, even when the power reading does not leave that same range. Would the “Only execute on piston state changes” button help with suppressing the multiple same notifications, and are their side effects to this being turned on (I only ask because the default is OFF). Or do I use some other setting to cancel the duplicate messages?

Thanks!

That should do it.

Can anyone provide an example of how saving and restoring state is supposed to work? I’ve tried every way I can think of and it’s not working. I posted an example a week or so ago, no responses.

This is a rough example
 captures the state of a hue bulb, changes to blue, waits 30 secs and restores settings.

IF
● sim Button1 switch changes to on
THEN...
Using Living Room Hue...
â–ș Capture state of attributes [color, colorTemperature, hue, level, saturation, switch] to local store
â–ș Set color to "Blue"
â–ș Wait 30 seconds
â–ș Restore state of attributes [color, colorTemperature, hue, level, saturation, switch] from local store

OK that example works, but I’m trying to accomplish this in 2 distinct events: 1) I push button 1 which captures the state, changes lights to something else. 2) I push button 2, it restores the lights to their original state.

I thought this is what saving state to global store was for, so it would be saved until I clear it. But that doesn’t seem to happen.

I have a piston set up to send me notification when the time becomes 9PM and the status of the door is unlocked. How would I make this piston repeat every 15 minutes and send me a notification until the time when the door becomes locked?

IF
Time is between
> 9pm and Sunrise
AND
Using Lock
> is unlocked

THEN
Using Location
> Send message

IF
Time is between 9PM and sunrise
AND
XXX Lock is unlocked

THEN
Using Location, send sms notification
Follow up with (choose the name of this piston) after 15 min

Also enable cancel on piston state change so the 15 min timer stops if the state changes.

I just created virtual pushbutton switches.
“Alexa turn on ‘work in TV Room’”
"Alexa, turn on ‘Reading in Living Room’"
Much shorter than using AskAlexa for common tasks.

Use a virtual pushbutton instead of a regular switch. It will always cycle.

That’s true
 but some folks really dislike the virtual switches
 at one point I was using upwards of 50 virtual devices
 then I hit the limit
had to delete them so I could install real ones and I haven’t gone back sense.

The only on piston state change may work, but the state changes when all conditions work together towards a false or a true. Since you probably have three conditions, depending on your grouping (and, or, etc) it is very likely that the piston doesn’t change states. Look into “power enters range” or “power exits range”. Those are triggers that will only run once. Enable expert mode and use OR between several triggers and for each trigger have individual actions to do what you want

1 Like

No luck here getting the store and restore from global store to work. Maybe @ady624 can give us pointer.

Noob here, I’ve added a few pistons successfully, and the next task is regarding motion sensors and a light switch. I can see how to turn on the light switch when a motion sensor is activated, but I would like to add something like an ELSE-IF that will cancel/override the piston if the light switch has been manually turned off. I can’t find something for the manual changing of a light switch in CoRE or in this forum.
E.g. I to walk through the motion sensor room to access the room with the switch, but in reverse, when I’m exiting the room with the switch, I manually turn off the light, then the motion sensor activates and turns it back on

Similar but different to THOMAS request.

I have a motion sensor, a smart button and a lightswitch.

I want it so that if I press the button the motion sensor is active for a piston which turns on the light or group of lights at a set level.
If I push the button again the motion sensor is ignored or the piston task is disabled.

So basically can I use an action(button press) to enable or disable a piston? I’m guessing yes by using variables.