Can't Get an Expression to Evaluate Correctly


#1

I want this expression to evaluate to true, but I think the way I’m going about doing this is incorrect.

How do I accomplish getting this attribute ‘cloudCover’ (looks like a house icon next to it) to evaluate properly? I checked that attribute and it’s at over 90 right now. Also if attributes have this symbol to the right of them (that symbol that looks like a house) what does that mean v.s. the ones that don’t?

Also when you select a ‘Compare to’ in a Piston, what’s the difference between the ‘Expression’ field and an ‘Argument field?’

Thanks for any insight…


#2

When you’re building the IF, is greater than or greater than or equal to not available as an option when doing the comparison? If they’re not available, the device handler must be outputting the cloudCover value as a string. You can get around that by using an Expression:

integer([DeviceName:cloudCover])

The house symbol means those are custom attributes that is being made available by the device handler.


#3

Thanks for help clarifying that, appreciate it!


#4

One outstanding question I mentioned earlier…

Let’s say I setup a condition and it gives the drop-down options of Physical Device(s), Virtual Device, Value, Expression, Argument.

What’s the difference between ‘Expression’ and ‘Argument’ fields respectively?

Thanks.


#5

I’ve never really used that before, never really bothered to inquire about it either. I have a guess on how it works but I will have to try it out :slight_smile:

Edit: Ok, if you call a piston from another piston and pass it a variable as argument, you can make webcore use it as condition of the receiving piston.

Here’s a rough example. I hope it makes sense.

And for the Expression part, it can be used as a shortcut to making comparisons. Instead of picking two devices and selecting the attributes to compare using the gui, you can select Expression and type it out like:

[device1:temperature] > [device2:temperature] (just a basic example)


#6

Nice, thank you for doing the extra work to find that out…appreciate the help once again!