Change Captitalization of Virtual Device in Expresison


#1

How do you include virtual devices in expressions? I’m trying to do something with hub power status in an expression but not sure what to call for. I know physical devices are [device:status]. My objective is to do something like title([hub:power status])

Currently I’m using the option of virtual device and then selecting hub power status.


#2

You’ll need to build a string variable with the the hub power defined as the initial value.

You can then reference that variable in your expressions.


#3

image

Expression editor:

image


#4

Thanks! Can I ask one other question while you’re helping - is there a way to trigger a piston manually? I’d thought that using the test feature we the way to do this but it seems I’m wrong. So not only that I’m wondering what exactly the test feature actually does?


#5

Here’s the piston I’m referencing. Basically I’m trying to trigger piston to set piston state without having to pull power supply.


#6

The test feature does trigger the piston… but if the conditions within the piston are not met, nothing will happen.

Likewise, if there is a trigger in your piston, nothing will happen, as the trigger will obviously be false at that point in time.

The test button is good for testing actions, when you know conditions are met (or no conditions / triggers exist)


#7

You press test, the piston goes ‘hub power didn’t change’ and does nothing.

For testing, just change the trigger to a condition… i.e. IS mains.

If you turn logging to full… you’ll see what’s going on though.


#8

Btw… try not to post your private email address (post 1)… I hid it for you :wink:


#9

One last question - you’re solution involved using a string variable which I’m to understand is for text. Normally I just use dynamic variables which i think are for any type of data. Is there a page anywhere on the webCoRE wiki that describes the types of variables or at least their uses. As I said I just leave it set to dynamic and wondering if some of my pistons should have different types of variables used. Thanks again!


#10

Dynamic would have also worked… I just like to be specific when I know what data is to be held.

There isn’t any documentation that I know of.


#11

I’ve seen this page but doesn’t really show any of the information im looking for.

https://wiki.webcore.co/Variable


#12

what do you know… someone’s been busy!

https://wiki.webcore.co/Variable_data_types