Variable for temperature offset

I would use a Decimal Variable for temperature offset in a rule so I can just change it's value once instead of all through the rule, when necessity calls.

When I plug my variable name, TempSwing into the temperature offset box and hit (Enter) the screen just resets to '0' in the box.

Any Ideas anyone?

It would be helpful if you shared a screenshot of your rule, so we know how it is currently designed.

1 Like

You just need to toggle the option for using the variable. The "offset" is if you want to offset the value from the variable value. If your use-case is to use the decimal variable as is, leave the offset to "0".

1 Like

Here is the rule with the variable only defined as 3 for the (offset)

how can I just plug the variable name into the code?

I am not sure where that toggle switch is you mentioned.

Unless I'm mistaken, the reference was to these "Enable Variable Value" toggles (underlined in red), for allowing non-constant offsets to be applied to Heat or Cool setpoint(s):

Actually...I originally thought that's what was being looked for. Now I see that OP is trying to compare two sensors and then compare their difference to a variable.

@MRG I think what you'll have to do is set the temp reading of each sensor to it's own variable, then use those to get the difference, then use the diff in your rule;

I think you can use variables for the "in range" but that's probably more work than just manually setting the range. For future updates, you can just edit the range in the conditions box.

1 Like

This is just what I need; An example of a local variable coding.

thanks so much:)


Download the Hubitat app