Hub Variable offset ranges not working


Hello experts,

I have a C8-Pro and the platform version is currently 2.5.2.135.

I'm having trouble with hub variable offsets working. I have 7 ceiling fans that have automations that trigger depending on room temperature. I have hard coded these temperature ranges in my automations. I recently decided to create a hub variable where i could change the room temperature once and have my automations update to the new variable, without me having to go into each fan automation and editing it manually.

I attached a screen shot of the "hard coded" temp range automation and the automation utilizing the hub variable. They should do the exact same thing but the hub variable code does not work. What's even more frustrating is when the temp of the room is less then 75 they both show "TRUE" as one would expect. I attached a screenshot of the temp at 75.0 where the hardcoded range is showing true but the hub variable range is false, even though they both (in theory) should be the same thing.

I did created the "RoomTemp" variable as a decimal, if that helps.

image

Here is a screen grab of the temp below the 75 degree threshold showing both as "TRUE" as i stated earlier.

I hope I'm making enough coherent sense for someone to help. I need more seasoned veterans i think....

If you read to the bottom of this message/rant, thank you!

I see no difference in the two things you posted, so I can't say what is going on.

If those are screenshots from your rule the bottom part of the rules appears to be disabled.

I would suggest turning on logging and running the rule and posting the log here so others can look at it.

@MWParrish First, welcome to the Hubitat Community! It's great to have you here.

As for your trouble, the "Upper range value" is - other than the "Variable offset" - an absolute value, not relative to the variable.

Here is an example:

Instead of

it needs to be

I hope that helps.

@terminal3

Yes the bottom portion was disabled, but still shows the results of the automation. Thank you for the welcome. I've been a stalker for a couple years now. I typically try and figure things out, but this one had me stumped. I "phoned a friend" on this one! :slight_smile:

@nghtly_strngr

I understand what you wrote. But If i decided to change the RoomTemp variable from 74 to 73, I would still have to manually edit the "Upper range value" of eash fan automation from +1.0 to 74.9 instead of 75.9 (just an example), which defeats the purpose of what i was trying to do. I'm just spitballing here, but maybe create a local variable that does the math i need on the System wide variable and reference that instead?

Well, there are a lot of ways to skin that cat, like using more complex conditions (including AND or OR's) or IF - THEN - ELSE / ELSE IF constructs. But as it looks, you will have to create a local variable to compute the respective bounderies from your global setpoint (with Variable Math).

Just my two cents for now...