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

Yeah i updated to the firat 6/9 update yesterday then noticed another
update came out shortly after, which i havent gotten yet.

This is evaluating to 90 instead of the expected 150 on Saturday and Sundays. What am I doing wrong?

(($dayOfWeek > 0 && $dayOfWeek < 6) ? 90 : 150)

Thanks!

Try

(($dayOfWeek > 0) && ($dayOfWeek < 6) ? 90 : 150)

Thank you … time for the morning coffee …

It is from Accuweather and it is one of my devices. If I look in ide I see this:
forecast: {“1hr”:{“precipitation”:0.0,“temperature”:70.0,“realFeel”:72.0},“2hr”:{“precipitation”:0.0,“temperature”:76.0,“realFeel”:79.0},“3hr”:{“precipitation”:0.0,“temperature”:81.0,“realFeel”:83.0},“4hr”:{“precipitation”:0.0,“temperature”:82.0,“realFeel”:84.0},“5hr”:{“precipitation”:0.0,“temperature”:84.0,“realFeel”:85.0},“6hr”:{“precipitation”:0.0,“temperature”:86.0,“realFeel”:87.0},“7hr”:{“precipitation”:0.0,“temperature”:87.0,“realFeel”:88.0},“8hr”:{“precipitation”:0.0,“temperature”:88.0,“realFeel”:88.0},“9hr”:{“precipitation”:0.0,“temperature”:88.0,“realFeel”:86.0},“10hr”:{“precipitation”:0.0,“temperature”:87.0,“realFeel”:84.0},“11hr”:{“precipitation”:0.0,“temperature”:84.0,“realFeel”:81.0},“12hr”:{“precipitation”:0.0,“temperature”:81.0,“realFeel”:77.0}}
But when I pull the variable it gives me the now temp.
Here is the actual screenshot of piston:

That data is stored in the ‘forecast’ attribute and there’s no easy way to extract the info right now without some major trimming lol. Maybe @ady624 can give us a function that works like $response.XX when making a web request and receiving json data.

I tried passing that info as $args but I cannot get the nested info,

How did you include the Accuweather sensor in webcore? I had looked for it initially, didn’t think there was a way. But seeing you have it working, could use some help in figuring it out.

Thanks!

I found it under temperature sensors in the available devices section of the app. And that is if you have it installed as a device in Smartthings. It was installed through the AccuWeather Connect smartapp.

Well, I thought maybe something got pooched in my var itself, or in my piston, so I created a new test piston and a new test global var of type time, same result:

An error occurred while executing the event: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘2017-06-10T17:05:00.000Z’ with class ‘java.lang.String’ to class ‘long’

I converted the global var to datetime, same result:
+454ms ║An error occurred while executing the event: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘2017-06-10T17:08:00.000Z’ with class ‘java.lang.String’ to class ‘long’

In both cases I set the variable value with the provided dialog.

I also did a test setting the value from another piston as type datetime. The value appears to update properly in the GUI, but at the updated trigger time, the test piston never fires

I don’t see any particular errors in the IDE, maybe because the piston never runs?
The error I do see seems to happen on save.

Steps to reproduce:
create global var of type time or datetime
Set a timer based piston to trigger on your global var.
result:
+454ms ║An error occurred while executing the event: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘2017-06-10T17:08:00.000Z’ with class ‘java.lang.String’ to class ‘long’

in test piston log and the piston does not execute at the configured time.

I just tries this and it works. just need to adjust times for your needs

Why is my piston not fully firing? What I want is if the temp in a certain room goes to 86 when I am away from home, I get a text, I get an email, and the thermostat changes to 65 then waits one hour and sets to 85 and hold. Everything works up until the wait one hour and set to 85…that part is not happening, it just stays at 65 degrees??? What am I missing? Thanks%

Thank you very much, found it.

click gear icon in the edit action window to get to the options. change tasks to never cancel on the with statement and give it a shot.

I went into edit. Clicked gear symbol with the word options beside it. Got a drop down that listed six different “Show” items, like “Show variables” “Show Complex IFS”. I clicked and tried to explore each, but did not find a never cancel…

Found it…thanks

1 Like

OK With a little digging, I got this:


It doesn’t work, but I’m not sure why. I’m just looking for syntax and structure kinda stuff here. Thanks.

@lflorack so, nothing happens or the state and level of the switches are not restored after 5 minutes?

The Carriage lights went to 100% but nothing else including restoring even the carriage lights

@lflorack try this example. i didn’t copy all of the logic, just the flag and only used 2 devices. note the small icon next to the if. for the if statement you will need to click on the gear icon when editing the if and set the tasks to never cancel. which didn’t matter for my test piston but will be needed for your real piston. also, even though its an anonymized snapshot the device name don’t get anonymized yet, when using device variables in the set variable statement. so i had to hack anonymize them in the first set block, so the color and text looks odd. but they refer to the same devices as you see below in the set level and switch steps afterwards.

Thank you very much! I’ve started to look this over and already see some stuff I had wrong. I will let you know when I’m successful.