3 Position Switch

I have a challenge I want to solve but I am struggling to understand if it is possible in HA.

Challenge:

I have a pool pump I want to automate so I can control when it is on and drawing power, something like:

  • If Solar production exceeds house consumption by 2Kw AND the water heater is not on, THEN turn on

  • OR if solar production is less than house consumption OR zero, and the time of day is between 2am to 4am, Then turn on

  • Else turn off

the conditional on is via a Shelly 1Pro PM which has the amps to drive the pump.

Then I need a manual On which a standard light switch could manage installed near the pump with its feed into the Shelly Relay (similar to turning on a light manually). This function is needed so that if the pool guy arrives he can override the HA automation off and use the pool vacuum skimmer.

So ok all easy thus far. but here is where I am struggling.

I need a third switch choice that is a manual action, being OFF. this is because when the pool guy cleans the filter of the pump itself, he needs to remove its top cover, to retrieve a small filter basket that lives inside the pump. valves to the pool are in a off position so the pool will not drain into the pump house. But If the pump was to start at this point all the water within it would be ejected and the pump would quick burnout.

So What I thought I’d do was use a two channel Shelly relay, with both outs going to the pump live. and use a single 3 position switch to power either channel A or Channel B of the Shelly relay. before doing this I asked Shelly what would happen, as I know they use their Shelly 2.5 with roller shutters for a similar 3 position challenge. However they said roller shutter have 2 live inputs so the 2 channels of a roller shutter are actually separated. They also said if I attached both Shelly relay channels to a single input and switched one on, Bad things would happen.

So the hack is to use a single Shelly relay and have it manage the two ON function (conditional via HA, and manual via one switch), and wire between the shelly and the pump a breaker simply used as a safe OFF.

While this solution will work, its ugly and is error pron. As it relays on the pool guy to remember to do two actions in two different places.

I would rather have both manual ON and OFF contained in a single switch I can set ON, OFF, Auto with. thereby simplifying the switching for the pool guy.

Has anyone done a similar exercise and or can throw me some advise on wiring a 3 position switch that HA can monitor and react to.

Thanks in advance

Duncan

Hi I managed to solved this myself. Thanks to the HA community for giving me exactly zero replies, zero encouragement and or zero support with this challenge (for our American viewers that was an example of sarcasm!). Or to quote Cartman from Southpark “Screw You Guys I’m Going Home”.

Rant over, back to the solution:

The way I solved this was to use a Shelly Pro 3 relay switch. This seems an expensive waste and I agree, I’d love to find a cheaper approach, but in the end I went in this direction.

I initially used HA to listen for and establish the state of two of the Shelly Pro 3 switch positions, specifically if they are ‘ON’. I called these switches ‘Manual On’ and ‘Manual Off’. The point of these switches is to prevent HA implementing an automation action if the pool guy has either of the manual positions ‘ON’. Thus giving him absolute manual control of the pump.

Done easily using a condition that states Manual_ON and Manual_OFF have the state off. The actual manual operation is performed by a manual 3 way switch (ON-OFF-ON), where the 2 on positions either turn on the Shelly Pro 3 switch Manual_ON, or Manual_Off while at the same time toggling the other to off. Physically what happens is that these shelly outputs only turn on indicator lights (red for the off position and green for the on position). The rest is done in code.

Initially I was toggling the Shelly Pro 3 switch position 3 ‘Pump_Switch’ (the output that actually turns on and off my pool pump contactor), whenever either of the other two Shelly Pro 3 outputs became active. This worked ok, but I experienced a couple of issues using HA to manage the direct switch interactions.

  1. There was a significant delay in the reaction of the pump at the pool shed, while HA worked out what either of the switch positions 1 or 2 had been set to, and then sent the Shelly Pro 3 back instructions of how to handle the manually set positions of switches Manual_On or Manual_OFF to the output Pump_Switch. This caused confusion with my pool guy as he would turn the manual switch, and nothing would happen for up to 5 seconds. This resulted in him turning the switch on and off quickly over and over, and getting annoyed.

  2. Then if the internet dropped or HA was rebooting for whatever reason. The interaction between the Shelly Pro 3’s 3 outputs was lost so nothing happened if the manual switch was operated.

To solve the direct interaction between the 3 shelly outputs I assigned this code within a shelly script on the Shelly Pro 3 itself. See link to the Shelly forum where I posted the shelly code Shelly Script Post

By having the direct interactions of the 3 outputs managed by the Shelly Pro 3 itself, the delay is vastly reduced (a small delay still exists - but its close enough to instant the pool guy gets he has to wait a second or two and is less prone to getting pissed off). And if the internet drops the manual switch interactions still work as expected.

I then have HA manage the automation side of things setting a condition that will only allow any HA automation actions to fire if the two key Shelly Pro 3 manually assigned switches (Manual_On and Manual_off) are in the state of off.

I hope this solution helps others who need more complex switching conditions in their home Automation projects.

Take Care D.