[DEPRECATED THREAD] webCoRE design process

Thank you, an error occurred in the compression/publishing of the code and it has already been corrected. Please hard reload. Sorry for the trouble.

4 Likes

looks like it is working again - tyvm!

4 Likes

jsut and FYI. Since the last update I am getting this error

e156b2eb-6b09-4106-9cbb-ecf8857bd588 10:18:19 AM: error java.lang.NullPointerException: Cannot get property ‘authorities’ on null object @ line 1525

First condition works. Second condition with motion does not work. What am I doing wrong?

Looks like there are no devices subscribing (orange lightning bolt) in your second statement block, you can force it by clicking on the cog and change from automatic to always subscribe.

Sorry, very silly question I am sure - what is the “cog”?

For example, line 63, click the device and in the Edit Condition dialogue box that comes up, on the bottom right is the cog (gear icon).

Thank you for your help and patience - which option do I change here?

Sorry, I think the line numbers are different in the piston pic and the editor. You’re looking for the the option that says Subscription Method, you’ll want the “always subscribe”.

Click the ones that correspond to the Switch and the Motion sensor.

OK and just so I understand why do I need to do this? I don’t remember having to do this before, shouldn’t automatic pick it up? Just trying to understand this lightning bolt concept and automatic vs subscribe.

Heh, let me see if I can explain it. Triggers like changes to, stays, and others in the list automatically subscribes to events for the device so it watches open/close/active/etc. Conditions do not, so if you want the piston to evaluate that part of your statement when any events happen for that device, then you force the subscription.

Very good explanation, thank you. Is there a better way for me to be writing that statement? Sure enough the sun just came out while I was just to test, LOL. #firstworldproblems.

LOL, that is a first world problem. Didnt’ know which car to drive to work today :wink: j/k

The first else block, you could probably do away with the conditions since, the weather will trigger an evaluation when it’s not Rain or Overcast. Same for the second else.

But
 this app is so flexible that we can probably arrive at the same result with just the difference in effort expended, the seasoned coders can probably do this with much less code lol.

You have to work? I just sit around all day and figure out how to avoid doing the hard work of turn on switches and pushing buttons manually, j/k too. Glad it’s Friday! Makes sense @eibyer thank you so much!

2 Likes

Is the datetime() function gone? It’s still in the wiki
I’m trying to parse a date/time which is a bit different from standard (comes from a sensor)

No, it’s still there. What is the string like?

@ady624

Adrian, can you tell me why this piston always says True in the dashboard?

Thanks in advance
Rick

It only says false when an else executes. You have none

I want to write a code to speak a text at higher volume, pause for few seconds and the restore the track it was playing. how do I do that? is there a shareable code that I can use

Just migrate over from Core to WebCore and having a small issue I can’t figure out.

In this piston the switch is a virtual switch. When it changes to on, it kicks the furnace fan on for 60 minutes and turns it back off (to auto).

I built it like it was in Core. Wait a few seconds, reset the virtual switch to off, then do the furnace stuff. In Core it seemed that both “Using” statements ran simultaneously. Now it does one, then the other.

With this piston the way it sits, it turns the virtual switch back off, turns the fan on and then dies. I see no countdown to turn the fan back to auto. I’m betting it’s something pretty simple.

I also tried putting both devices in the same with statement, but can’t figure out how to differentiate which device it’s controlling then.