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

Try enclosing the variable in integer().

Thanks. I had already tried that. I should have said.

I needed another set of brackets …

@nezmo you are welcome. see that you already found the missing bracketa. :slight_smile:

1 Like

I’m sure there are plenty of reasons to have webCoRE evaluate what AskAlexa did, say, trigger a macro if AskAlexa turned on a light or something. Since I do not add my switches to AskAlexa, I can’t quickly create a piston to demonstrate that.

However, you do not need to have webCoRE evaluate what AskAlexa did in order to have AskAlexa make a thing happen in webCoRE. Go into AskAlexa on your phone and set up a macro that triggers a DO piston in webCoRE. That is much more reliable than trying to have webCoRE determine if what you said to Alexa actually equals the trigger phrase. Yes, it’s more hassle because you have to add each macro to Alexa’s Skills, but it’s also much more reliable because Alexa will handle the speech interpretation rather than webCoRE.

@ptdalen please give me a few minutes, i am going to run through a simulation then respond to this one.

thanks.

I had this same problem trying to fade on over a period of 30 mins, I ended up breaking up my fades into 15 min increments.

@ptdalen please see this example. while the previous one would work for most scenarios, it would have missed some edge conditions. this one should catch all the real world conditions and send you the sms notification when it should.

if you want me explain why i put in all those conditions, please ask and i will be happy to. :slight_smile:

and yes, if you are not present and your wife leaves with your car you will not get a notification. :smile:

Presence sensor 3 = Your presence sensor
Presence sensor 4 = Car presence sensor
Presence sensor 5 = Your wife’s presence sensor
On line 30 change “Mom’s iPhone” with the name of your wife’s presence sensor.
On line 40 change “Test Presence sensor” with whatever your car presence sensor is called.

Now I am having difficulty applying the scaled colors to another piston that is using a variable and current event.

With the following I get valid current event information displayed.

But when I try and switch to using an expression as follows I get problems:

7/22/2017, 12:33:13 PM +146ms
+2ms ╔Received event [Hot Water Tank Leak Sensor].temperature = 111 with a delay of 1156ms
+286ms ║RunTime Analysis CS > 20ms > PS > 60ms > PE > 206ms > CE
+295ms ║Runtime (43952 bytes) successfully initialized in 60ms (v0.2.0db.20170717) (293ms)
+297ms ║╔Execution stage started
+423ms ║║Comparison 111.0 changes = true (1ms)
+433ms ║║Cancelling condition #2’s schedules…
+435ms ║║Condition #2 evaluated true (126ms)
+437ms ║║Cancelling condition #1’s schedules…
+439ms ║║Condition group #1 evaluated true (state changed) (131ms)
+445ms ║║Cancelling statement #3’s schedules…
+519ms ║║An error occurred while executing the event: java.lang.ClassCastException
+521ms ║╚Execution stage complete. (225ms)
+529ms ╚Event processed successfully (529ms)

matching brackets? if you post the piston, i can check it.

Here you go. Thanks!

checking …

actually on second thought may be everything is all right and you are not seeing anything in edit mode because you are using $currentEventValue which only works at run time?

so, have you tried running it and looking at the result? :slight_smile:

I wondered that but in run mode I get the Java error in the log I posted and the piston does not update (Piston state shows the last time it worked successfully with the value statement rather than the expression.

oops. yeah see that. let me run it myself.

Could someone explain TCP more clearly to me? I’ve read and re-read the wiki multiple times and it just doesn’t appear to work the way I understand it to. In my example, below, if both sensors change at the same time, only one of them does the “something”. The other starts to evaluate, gets a semaphore timeout, and doesn’t do the “something”. I’ve tried ASYNC as well with the same results.

IF
Sensor 1 changes
THEN (TCP = NEVER CANCEL)
Do something

IF
Sensor 2 changes
THEN (TCP = NEVER CANCEL)
Do Something

@Nezmo just cast the $currentEventValue before comparing. i used int( ) because it was shorter than typing decimal( ) :slight_smile:

Thank you!

I must admit, I get confused when to use integer. Within a value statement it wasn’t needed.

@sockmonkey its complicated. which basically means - i dont understand it either. :slight_smile: but, i will try the best i can.

if you look at the help text for TCP the following line is probably the most important. in a normal execution with no wait task there is no need to cancel any tasks. when there is a wait task the TCP value controls wether the wait task and any tasks following the wait task will be cancelled or not cancelled.

When a task execution is delayed by any means (i.e. a Wait task)

does that help?

you are welcome. you are not alone :slight_smile:

1 Like

@bangali if that is the case, then I’m probably barking up the wrong tree with TCP. I want both IF statements to evaluate without one cancelling the other. Is that possible?

I was assuming that “delayed by any means” would include a semaphore which is why I was trying the TCP route.