If I create a rule that upon trigger, it executes this:
It works just fine with the log looking like this:
I’m wanting, however, to make a variable of numeric value that when the rule is triggered, it sends the number associated with the variable. Here is the rule and corresponding log.
As you can see, when using the variable, it doesn’t work and seems it is because sharptools is trying to send to my device the number with “quotes” around it.
How do I send the value of a numeric variable to my device and not have quotes around it?
How was the
TemperatureMiniSplit variable set? It looks like it was stored as a string rather than a number.
If the variable is being set using an Expression… if the variable was original created as text type and the expression was created at that point (and the variable was later recreated as a Number type), then the expression might still have the value type set as text. You can reset the value type for the expression as follows:
Can you try the following steps to make sure the Set Variable action has the appropriate target value type:
Open the rule for editing and edit the impacted Set Variable block
Switch the ‘Source’ to Manual Input and then back to Expression*
Save the Set Variable block and then Save your rule
You should be able to run your rule again and it will pick up the proper inferred value type for the expression. Video demonstration attached.
The expression should be retained when switching the source to Manual and immediately switching it back to Expression, but you can always copy the expression to your clipboard as a precaution.
I have a “variable” tile on a dashboard. I click the tile and then in the pop up, I can type in a new number and press enter.
You are correct…this is the issue. If I go to my “manage resources” section and manually change the variable in there it works.
How do I make it so that my manually typed in entry in the dashboard popup is a number and not a string?
Let me take a closer look. Sounds like we might have introduced a bug with a tweak we introduced last week for variables.
Happy to share my dashboard and rule that expose this possible bug if that is helpful.
We just pushed a hotfix which should resolve this. Can you try updating your variable from the popup modal on your dashboard and see if it’s working as expected now?
now follow up question…is there a way to make the pop up look like a keypad (similar to the alarm system disarm keypad or pin code keypad for pin protected tiles)???