[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)

Can’t really understand how this logic works, as the ‘else if’ will only initiate when the condition ‘changes to present’ changes from a true state to a false, or am I missing something here?

My Sonos speak and resume still works flawlessly although I’m not use line in. The wife will generally be in the kitchen with a Spotify or TuneIn channels playing on the Sonos

@bangali,
Sunrise is 5:47 am.

> Quick facts
> Piston state: Kitchen Light: OFF. Level: 30% on Mon, Jul 3 2017 @ 2:21:18 PM EDT. \n Kitchen - Sunrise: OFF. \n Kitchen - Sunset: OFF. \n Kitchen - Manual: OFF. \n Kitchen - Motion: OFF. \n Kitchen - Timed-K: ON.

> Last executed: 7/3/2017, 8:14:59 PM
> Next scheduled: 7/4/2017, 5:30:00 AM

> Subscriptions: 9 events, no controls
> Devices used: 8
> Memory used: 74% (73636 bytes)

Yep, doesn’t work for me either

Rick

1 Like

Continuing the discussion from webCoRE Beta Milestone 2:

Hi All–
I’m making a piston to respond to my thermostat’s temp up and temp down commands. Since it’s an IR up/down switch, the command has to be executed the number of times as i where “i = (originalSetpoint - NewSetPoint).”

The problem I’m running into is that I don’t know how to make originalSetpoint (which is based on the actual setpoint) remain a static number. So i keeps going to 0 before the repeat loop finishes its i={i-1} until i=0 executions of the command.

I tried all different types of variables as well as the “Capture Attributes” option (which I’m probably not comprehending nor sure of the syntax).

Thanks for any advice you may offer.

Can anybody please offer some advice? I’m at a loss. I can’t imagine that it would not be an available option.

@DarcRanger thanks. i even imported the piston but cant seem to find anything obvious for the 5:30am trigger.

has the piston actually executed at 5:30am and do you have the logs from that run?

EDIT: for the timed events nested under if conditions with other timed events. the nested time event condition will never become true. something like this may be what you are thinking of:

if time happens daily at 6:45am
then
… move the when true block here
else if time happens daily at 7:45am
then
… move the tasks from the nested if block here
end if

1 Like

@bangali,

9:30 pm should turn off SunSet Mode and I will see soon if it triggers.

Here is a log snippet from an hour ago. I have nothing from this morning.

7/3/2017, 8:14:59 PM +206ms
+1ms ╔Received event [StarBase One].time = 1499127300000 with a delay of -795ms
+364ms ║Runtime (76669 bytes) successfully initialized in 103ms (v0.2.0ce.20170629) (361ms)
+365ms ║╔Execution stage started
+542ms ║║ comparing 77400000 < 72901710 < 0
+567ms ║╚Execution stage complete. (202ms)
+574ms ║Setting up scheduled job for Tue, Jul 4 2017 @ 5:30:00 AM EDT (in 33300.221s), with 2 more jobs pending
+595ms ╚Event processed successfully (594ms)

For some reason it still won’t change back to the last color it was before the flash? It stays on the last flash color even though I placed a 5 second timer. Oy. Any other suggestions? Thanks guys!

OK … lets see if it does. may be it will work because of how timers work in webcore.

as an aside even if it does work … it should not … literally the second if should never be true :smile:

if time happens daily at 8pm
then
… do something
… if time happens daily at 9:30pm
… then
… … do something else
… end if
end if

@Savio could you try with color, colorTemperature, level and switch and check if that works?

Still same thing :/, does it matter if the three lights I am storing variables for are different colors initially? It saves each of the bulbs local states to their own variables right? Thanks for all the help!

I think that’s the problem, they are all in different colors and states and it’s picking one of them to be the restore state. Is there a way to make each bulb have it’s own local store state for that color and switch option? Thanks!

Have you posted the piston somewhere for review?

Here’s the piston with a single switch…

But if I select multiple switches and use the variable to target the one which was manipulated…

Then the command I want isn’t given as an option with reference to the variable content. If I also create a variable to hold my list of Motion Dimmers (because I’ll be adding at least one more and want to add it in one place), then even the “switch physically changes to off” option doesn’t appear.

yes, you can use a named store instead of defaulting to the local store. in the UI I think it’s called State Container.

@MikeBishop seems to work for me … Test is a variable of type device

Hi Bangali, thanks for all your help in helping me with my first Piston, I am still not sure where to go in the State Container part though. I guess I am trying to figure out a way to make these light bulbs each hold their own variables with their own settings and then restore them after the flash. I am not sure how to go about that in the UI even in State Container?

Thanks!

Thank you @bangali, will try that.

I intentionally left out the presence sensors in respect of some devices such as the lights, in case I wish to leave the “alarm” on to create the impression of people being home. So lights will still be turned on, but not devices like heaters, water heaters etc.

Edit: I tried your code, but the Dashboard doesn’t like it. It shows this (and as I know just about nothing about programming, I can’t figure out what makes it unhappy):


Here you go.

  1. The “Thermostat = Thermostat 1” variable is not actually used. The anonymizer changed it inconsistently (only as device, but not when part of an expression) so I added the variable to make it clearer.
  2. I included both of the repeat loops I have tried as well as the Capture attributes setting.
  3. I also set global and local coolingSetpoint variables to see if it made a difference.

The problem is that the “i” value changes along with the physical thermostat’s setpoint and I need it to remain a static number. Thanks.

@949BFN when setting piston state are you using value or expression?

If you use expression it will let you see the results in the evaluation bar above after you have typed.