[DEPRECATED THREAD] webCoRE Beta Milestone 1

Thanks for the example. My only concern here is that there’s no “lightning” icon next to the else if statement, i.e. i guess it means that is not subscribed to events and won’t get fired? Also this piston says that it’s not subscribing to events and won’t be fired automatically. Doesn’t look good, or am i missing something?

@ady624 is it possible that the piston subscribes to the events (as per sshot above), but the piston web page still has this warning

That is a bug with display. The stays is a trigger and should subscribe. Also, in advanced options of the conditions, you can force a condition to subscribe even when mixing it with triggers. Or stop a trigger from subscribing. Complex logic you make.

1 Like

To add to that you can see the in the gutter. That icon represents a subscription to that line item.

I get that, apparently it’s just a bug in the display for “stays” per @ady624 AND another but in the display for the piston page. Hence the beta.

Is there a way to combine “if” and “timer” in the same statement, as in:

if (weather’s illuminance changes) or (every 1 hour) then …

Ok I actually figured that I can add this to achieve same effect:

if (weather’s illuminance changes) or (weather’s illuminance stays same for 1 hour) … :slight_smile:

1 Like

@ady624

Not sure if this is a bug or not, but when using the green camera to post images “safe to publish” if one includes their phone number for SMS, it will come over if someone tries to import the piston. The devices are removed, but the phone number will import even though it is redacted in the posted image, it still shows up. Thanks to @BlackCatPeanut for pointing that out for me.

Quick question related to that: if the wiki says

format()
//todo

does that mean the function has to yet be implemented or that the description in the wiki is still missing? Based on a quick test I have to assume the former :cry:

I did not know what the format or description was so I had to leave it blank cause I didn’t know.

1 Like

I know it’s not a solution to what you are asking, but consider creating a global variable and store a phone # there. Thus if you have multiple pistons that send you an SMS, and you change your number, you’ll need to update only this variable.

looking into it, that’s risky. Please do not publish pistons with SMS in them until I figure out what is going on

1 Like

The function is implemented, it is an alias of sprintf - look that up on google.

Example:

format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])

The first parameter is a format string, then for each % add a parameter… the number of parameters is dynamic depending on how many parameters (%) you use

1 Like

Thanks - I guess it wasn’t working for me since I had the order of arguments reversed :wink:

Continued from the Alpha thread. Has anyone gotten a piston to fire when using Echosistant?

Any idea why line #30 always results in 50? In line 29 @DayTimeLuminance sets to 10000, so #30 should set @DayTimeLevel to 0, but it’s always 50.

I need to check and see if reading a global variable reads values previously set by the same piston, it should - values are saved to global store at the end of run. I checked, it should do it correctly.

don’t think that’s the problem - in that case I would still have had values different from 50 on a 2nd run, however it’s always 50. Does the expression look right? What exactly do curly brackets signify? That everything between them will be passed to a proverbial eval() ? :slight_smile:

No eval used. Using { } inside an expression acts exactly like ( )

Using { } in a value will evaluate the text inside { } as if it were an expression.

You don’t have to use { } inside the expression. It would help if you showed the logs too, particularly that last log line, what does it output?

Also, what are the data types for the global vars?

Anyway to rename a piston? Other than duplicate.