Using thermostat setHeatingSetpoint with a variable

I have a rule that uses a number variable to set a thermostat heating and cooling temperature point.

Recently, this stopped working and is reporting error 422. However, other rules which use set the heatpoint or cooling point with a fixed number are still working.

I noticed from the logs the command which uses a variable are sending the temperature value in quotes, while those using constants are not.

Could this be the cause of the issue, and if so, did this change recently?

1 Like

Was heatPointLivingArea being set as the result of an expression? If so, I just pushed a hotfix which should resolve the issue where expression results weren’t getting implicitly converted to their target variable type.

Yes, it was. I just checked and the hotfix appears to have fully resolved the issue. Thanks Josh!

1 Like

I still have this problem with one of my rules. Do I need to force some kind of reset on it to take your fix into account. Disable/Enable maybe?

Thanks

16 h 35 min 23 s

Triggered by device event: Home heatingSetpoint is 20

view

16 h 35 min 24 s

IF condition logic is matched. Continuing to activities in the “THEN” path.

view

16 h 35 min 24 s

Set variable value: $TemperaturePlancherChauffant = 20

view

16 h 35 min 25 s

Set variable value: $TemperaturePlancherChauffant = 24

view

16 h 35 min 25 s

Sending device command: Plancher chauffant ▸ setHeatingSetpoint(“24”)

view

16 h 35 min 25 s

Failed to send device command; Status code: 422

view

16 h 35 min 25 s

Rule execution is completed.

view

Disable/Enable did not fix it.

What is strange is I have other rules sending the same command from a numeric variable to the same device and the parameter is sent in numeric. But only this rule uses expressions.

Can you try the following steps to make sure the Set Variable action has the appropriate target value type:

  1. Open the rule for editing and edit the impacted Set Variable block

  2. Switch the ‘Source’ to Manual Input and then back to Expression*

  3. 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.

Hi @josh,
This switch in the expression block fixed it.
As usual, thanks for the quick response.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.