Using the climate integration to control motor ball valves

Hi.

I am working on a project where I want to use a three-wire motor valve to control my hot water usage through Climate Integration in Home Assistant. I’ve noticed that Climate Integration seems to assume the valves are normally closed, meaning they don’t need to be specifically closed.

The motor valves have one common wire, one for open signal and one for close signal. I am using shelly 2pm and using .yaml or Node-RED to implement this, and I’d appreciate any advice on the best approach to implement this functionality in Home Assistant, given that the valves have to be closed when the Climate Integration is not calling for more heat.

Any advice would be greatly appreciated :slight_smile:
Thanks for your help!

Do your motorised ball valves disconnect power to the motor when they reach the end of their travel (fully open or fully closed)?

If so it would be a simple matter of creating a single template switch to control the two open / closed Shelly switches. Though you will have to use an assumed state as you have no state feedback.

Then just write an automation to turn this template switch on when the climate device is heating or off when it is not.

The motor valves do disconnect power when they reach the end of their travel. Sounds like a good idea, I will just have to find some template with this kind of inverted switch to follow.

switch:
  - platform: template
    switches:
      hot_water_valve:
        friendly_name: Hot Water Valve
        unique_id: hot_water_valve_123456
        turn_on:
          - action: switch.turn_off
            target: 
              entity_id: switch.shelly_1_close
          - action: switch.turn_on
            target: 
              entity_id: switch.shelly_2_open
        turn_off:
          - action: switch.turn_off
            target: 
              entity_id: switch.shelly_2_open
          - action: switch.turn_on
            target: 
              entity_id: switch.shelly_1_close

This will create s switch called switch.hot_water_valve. Turning it on will open your valve, turning it off will close your valve. Note you need to change the entity ids to the ones from your Shelly.

Because it has a unique id you should be able to change the appearance in the frontend to valve.hot_water_valve which will have the advantage of being open/closed instead of on/off

What a nice workaround, thank you for this solution.

How about using your shelly to drive a relay that has normally closed (NC) and normally open (NO)? The common leg is power, the NC goes to the closed wire and NO goes to the open wire.

Thank you for the reply, that is actually a really good idea for anyone that doesn’t want to go into the .yaml coding.

That’s actually how I’m planning on controlling a 12V motorised ball valve connected to ESPHome. Initially I was going to use two relays but found out it cuts the power when fully opened or closed so there’s no issue with the motor overheating. Also using the NC relay contact for the motor closed wire makes it more likely to fail to valve closed if I lose 5V power (12V power fail would still be an issue).