Rule Machine Global Variables

Understood. I will look at it as a possible enhancement.

1 Like

This isn't going to work for a number of reasons. The only way to do this would be to introduce something specific to delay based on a variable. I will look at that possibility.

Thanks, Bruce! Appreciate your work and such a great product.

@bravenel

Can a GV value be accessed from within an app or a driver? Or must we send the value through a custom action?

They are only available within Rule Machine.

Ahh Ok I was hoping something similar to this might be possible. No biggie though itll work the sending the custom action as well I think..

Is there anyway to set a global variable to open weather attributes not listed as sensors such as cloudiness? have no issues with setting variables from temperature or humidity, however, attributes which are not common too many devices are not available in the select for sensor type when setting values in rules machine.

as long as that attribute is exposed in the driver correctly you can use it as a action or a condition (depending on what it is obviously cloudiness can't be a action), so i suspect you need to reach out to the developer to ask the driver to be corrected. IE below

thank you borris, it is for the Open Weather Map driver which I believe is a hubitat created / supported driver. haven't been able to find any way to set a global variable to the cloudiness value or implement as needed in a rule. you can select the virtual device created for the OpenWeatherMap driver along then with custom attributes to use in a rule conditions as you captured in your response, however, are limited to comparison operators of =,!=,contains, and changed. same goes for if attempting to use in action conditional actions. Possibly assigned as a string rather than numeric based on those operators and no ability to assign its value to a variable. will look for support of OpenWeatherMap driver.

Not sure if i'm understanding you correctly but if i am you want want when a the driver "changes" its cloudiness value you want this to represent in a GV?

So what about a trigger for when custom attribute "changes" set GV X to ?


assuming this is where you got too?

If so it looks like your need to request it as a feature as it does not currently seem possible

that's right where i'm at. have a trigger built already looking for changes in value. stuck here trying to extract value.

tried to go a different route using a rule to assign a variable value based on ranges and can't make that happen either unless i get in the mood to create a boat load of conditional statements

grabbed an api for apxi and added csteele's wx-ApiXU-Driver.groovy driver in. run into same issues. can't pull those custom attributes out when looking to assign their values.

Will be able to make a work around with the APXI driver cloud attribute as it's comparison operator selection contains the full list of operators. If statement with use of >,<,>=, and <= comparisons operators to create ranges.

Looks like the cloudiness attribute in the OpenWeatherMap driver may need a type reassignment and possible new functionality request to extract the custom attributes for assignment to global variables...unless i'm missing something yet

You may be dealing with the differences between vendors. I reworked all of APIXU's values last weekend to match what THEY say the values should be....

Anything in Green I made numbers, anything in magenta I left alone as strings.

However, that cannot force OpenWeather to also perfectly match. I already found, with Dashboard 2.0 and it's newly available Weather Tile, that it's looking for the specific spelling of "windSpeed" vs "wind_mph" (or _kph)

I have to admit to NOT looking at OpenWeather with a magnifying glass as I did with APIXu last week.

Drivers should be 'translating' specifics into higher levels or vise versa. But at this time, there's no 'high level' for weather values. In other words, there's no Driver Capability definition for Weather that would encourage "correct spelling." (whatever correct might be.:slight_smile: )

Hi!

Do you know of a way to call for a GV within groovy?

Thanks

They are not exposed... they are entirely Internal to RuleMachine.

1 Like

Ok, good to know, one less thing to mess around with. Since you're here, do you know why I get the cooling set point "SKIPPED" every time I want to lower both heating and cooling setpoints?

not every Thermostat is alike... skipped might mean it's in not-cooling mode, so changes to cooling does nothing. Just a wild ass guess though.

1 Like

It's idle so I suppose this is not the reason. I'd have to try on different thermostats to see how it goes but for now I'm just going to try to work around this using delays. Thanks a lot for your help!

Could you show a larger context? That (skipped) is coming from RM, and it's not clear why. It shouldn't be skipping it unless there was some conditional action involved.