Vera, Heatit, Scenes, Reactor, Lua and comparing two variables

Hi

I’m new here!

I have on Heat-It thermostat controlling 3 three heaters. But I need to control at least one more heater by indirect control from the thermostat. I control the thermostat from Vera Plus by z-wave, and I want to control the fourth heater with a z-wave Nexa switch.

It look like the best way is to use the room temperature, the CurrentTemperature, and the thermostat CurrentSetpoint temperature CS. I want to set my fourth heater to:

ON when CurentTemperature < CurrentSetpoint
OFF when CurentTemperature >= CurentSetpoint
OFF when CurentSetpoint <= 19.50 (Celsius)

I have install Reactor Plugin in my Vera Plus, but I can’t see how to compare two variable. If I use Reactor I suppose I have to use Lua code, but I’m not familiar with programming in Lua.

I suppose I can do the programming under Expressions?
What is the complete code I need to enter to Succeed.

Any good sugestions?

No Lua required at all for Reactor. Here’s a recipe:

Create a new ReactorSensor. Go to its “Expression” tab and create a variable with name “currSP” (for example–I’ll stick with that, but call it what you want). For the expression, click in the expression field, then click the “Insert device state” tool image in the cluster of buttons on the right. That will present some fields, and there you choose your Heat-It thermostat and the CurrentSetpoint variable. There may be several; if there’s more than one, choose the one for “TemperatureSetpoint1_Heat” in preference to the one without “_Heat” for now. Also click the image tool button to export the variable (it should be highlighted green when exported). Save.

You’ve now created a variable that fetches the CurrentSetpoint of the controlling thermostat we’re going to mirror. It will look something like this…

Then go to the Conditions tab. Do the following steps:

  1. Make sure the group operator is “AND” (in the group header row)
  2. Add a “Device State” condition;
  3. Select the device that is the source for the “current temperature” (a temperature sensor or a thermostat, you didn’t say which you intended to use);
  4. Choose the less than < operator;
  5. In the operand field, type {currSP} (if you used a different variable name, type that);
  6. Add another Device State condition;
  7. Select “(this ReactorSensor)”;
  8. Select the currSP variable (if you used a different variable name, choose that);
  9. Choose the greater than > operator;
  10. Enter 19.5 as the operand;
  11. Save.

It will look something like this:

Now you’ve set up two Device State conditions in an AND group, so both have to be true for the group to be true: the current temperature has to be lower than the current setpoint, and the current setpoint has to be greater than 19.5 (I flipped this test to make the logic simpler).

Actions…

On the Acitivities tab, under the “is TRUE” activity:

  • Add a Device Action, select the Nexa switch, “turn on/off” action, and “ON (1)”

And under the “is FALSE” activity:

  • Add a Device Action, select the Nexa switch, “turn on/off” action, and “OFF (0)”

Save. Done. Looks something like this…

Now, the currSP variable may take some experimentation, as there is some variation between thermostats as to what service they use to store their CurrentSetpoint variable. So if your thermostat lists more than one CurrentSetpoint variable, you may need to try several before you find the right one. Just clear out the expression and use the “Insert device state” tool to create a new expression for each attempt until you find the right one. A quick way to tell would be to just do the first part–set up the variable/expression, then watch the variable’s value in the “Status” tab of your ReactorSensor–change the real thermostat’s setpoint up and down, and when the Status display updates with the right values for what you are doing on the thermostat, you’ll know you have the right one.

1 Like

Thank You Rigpapa

This worked just perfect, and helped me a lot. In fact it was more easy than I had suspected. I had a few trouble with the hard reset in Firefox. But I managed to solve that with CTRL F5. Except for this worked perfect, and is no active in the smart heating of my combined living, dining room and kitchen. Thanks a lot.
Reactor is really great and easy to use. I really love it. You have done a great job here! :blush:

Have a very nice day.

1 Like

Hi @rigpapa
The programming seems to work perfect, just as intended! So thank you for really good help :+1:However, I have discovered that HeatIt is smarter than just following setpointemperature and the current temperature. There are some logic giving power pulses to keep temperature constant. I have looked after variables just telling power on/off, but I can’t find any. if so, it ought to be very simple to use this variable to control new heaters to follow this logic.

So, a quick question: Do you know if such a variable exists or ought to exist?

A

There’s often a ModeState (not the similar ModeStatus) state variable that will change in these circumstances.

Thanks for reply. I can’t see any such variable or others. I have done several tests without find any variable that respond on power of. Only Heat Cold Eco OFF. Nothing that indicate power off/on to the heaters.
But the help you gave me to Reactor is good enough, it works perfect. :+1::smile:

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules