Reversing Valve Control

I didn’t think through how i was going to control the O/B wire. I saw your earlier reply to jrbender on this matter but I’m not super clear on where to concentrate my effort.

Your note linked above directs to edit the rules file. I think you’re referring to default.rules? Can you provide an example of how this should look? I stuck my orange wire in the water heater terminal. Otherwise, I matched up the terminal labeling with the Nest.

If the trick to turn on cooling is to activate both heating and cooling (and for heating you need to activate only the heating pin) then parse the default.rules (in /etc/openhab2/rules) and change any line that turns cooling ON to also turn heating ON and any line that turns cooling OFF to also turn heating OFF.
So one example (note the example below is in different location):


Change from this:

rule "CoolingPin changed"
when
    Item CoolingPin changed
then
    switch(CoolingPin.state) {
      case ON: {
        Pin23.sendCommand(ON)
        //CoolingPinTopic.sendCommand(ON)
        logInfo("Default","CoolingPin set to ON.")
      }
      case OFF: {
        Pin23.sendCommand(OFF)
        //CoolingPinTopic.sendCommand(OFF)
        logInfo("Default","CoolingPin set to OFF.")
      }
    }
end

To this:

rule "CoolingPin changed"
when
    Item CoolingPin changed
then
    switch(CoolingPin.state) {
      case ON: {
        Pin23.sendCommand(ON)
        Pin16.sendCommand(ON)
        //CoolingPinTopic.sendCommand(ON)
        logInfo("Default","CoolingPin set to ON.")
      }
      case OFF: {
        Pin23.sendCommand(OFF)
        Pin16.sendCommand(OFF)
        //CoolingPinTopic.sendCommand(OFF)
        logInfo("Default","CoolingPin set to OFF.")
      }
    }
end

This is the main logic you need to follow.
There is a big BUT though… Next release has a major rewrite of the way rules work and your edits will not work. As it is a great optimisation that is coming up I would suggest to wait and get the update and then follow this great guide by Rich to apply similar logic there from the convenience of your browser without editing files like above. Till then you can experiment with my above suggestion and see if the logic works for your system.

Thanks bro, you saved my weekend. I was so confused because I thought i was going to have to activate the water heater pin some way to send charge through to orange wire. Loving the design.

1 Like

The change won’t be quite so easy with the changes coming up because I have a lot more checking in place to prevent heating and cooling from activating at the same time. But when the time comes let me know and I’ll tell you all the places you need to make the changes. It will be the same overall approach, you’ll just have to disable the checks that prevent heating and cooling from being on at the same time in addition to adjusting the pins.

Wild guess but could a diode or something (between cooling and heating pin) work on an strictly electrical level so you dont touch the files etc?
Alternatively an appropriate additional relay could help in sending the signal to both contacts when needed.

Oh you mean like just a jumper?

Just a piece of wire won’t do as it will always be like activating both, hence cooling when you only want heating. Ask an electrician though

I think I’m understanding how this works, I just connected the orange wire to the 3rd terminal from the left and set pin 32 to high. What i found is that when the orange wire is NOT energized the reversing valve’s default state is cooling.