Set a global variable with webcore piston

Is it possible to set a global hubitat variable from a piston on webcore?

If you create a connector for it, you can bring it into webCoRE as a device and read the variable but the command to set it conflicts with an internal command.

I have a device that could serve as a bridge to RM and then you could trigger a rule to update the RM Global using the Custom Attribute capability. (You update the variable in the driver, RM sees the change and updates the Global.)

https://raw.githubusercontent.com/thebearmay/hubitat/main/dashVariable.groovy

I believe this was fixed shortly after I reported the issue several months ago in a different thread, so I think that should work now, too--but I will say I haven't tested (just repeating what I've been told), so can't say for sure. :slight_smile:

Just looked at webCoRE and it still has a conflict with the native RM connector command unless I'm missing something. (The connector device is using the command setVariable which is a webCoRE internal which tries to set a webCoRE variable).

Edit: It is a conflict with the internal command, but it does work if you leave the variable name blank and ignore the warning about an invalid variable name.

So for instance add this to your code if MyDate is my GV?
command "MyDate", [[name:"$day", type:"STRING", description:"Date"]]

I am trying to set the Month, Day of the week, and Date from webcore to GV in Hubitat.

I am able to set a RM Global variable using webCoRE

So did you ignore the "Invalid Variable" warning in webCoRE?

Edit: It does work if you don't furnish a variable name and ignore the warning in webCoRE.

Boom!! Thank you! :+1:

It's a good day, I learned something new!

(...and my apologies to @bertabcd1234 for ever doubting him :sunglasses:)

For sure I had built big heavy RM rules to get this info into Hubitat now it is lite and fast.

This may not be the correct place to ask this question. However, with the pending migration of Webcore_user into Webcore_HE I wanted to pose this possibility.

Question: Is there currently a method to track which pistons are using a Global Variable? I do not know of one, if there is not a current search/find method perhaps there could be one added in the migration. It would be so useful to track global variables down to the piston(s) they belong to as is possible when searching what pistons are used by a device in HE. I use them frequently, but change methods of control often as well, so sometimes these variables are no longer in use (or are they?) With over 50 active pistons always progressing and revising, its very difficult to keep track of some of the global variables I created years back.

Anyway, just a quick question/suggestion...

If you convert them to Hub Variables (@@ instead of @) then you can look at the Hub Variables page to see what is using each.

1 Like

Any way to monitor global variable use? I have created so many global variables and I am not very good at keeping track of them. I am sure that I have some that can be deleted. But I would like to know if they are in use.