Simple Automation with Shelly - Air in pump detection

peterolson07

New member
Mar 29, 2020
2
nebraska
TL;DR Use Shelly relay's to automate the pool timer and swg autooff if pump is off. Also use home assistant to check if there is air in the pump using power monitoring. This is not a full how-to, just an overview.

Last year I put up a 21' AGP. When I running my electrical, I wanted an easy way to schedule my pump and SWG. There are a million smart plugs out there, but it seemed like Home | Shelly Cloud were some of the best for compatibility and security (you don't need to use there cloud if you don't want). I've been very happy with the result.

What I am doing with shelly:
- Turn on my pump and SWG remotely (in my house, at work, wherever)
- Schedule my pump and SWG
- Set timers on my SWG and pump
- view on-off logs to see when it ran

Basic Equipment:
- 2 shelly 1pm's Shelly 1PM | Shelly Cloud
- 2 standard paddle switches
- Modification: I converted a couple paddle switches to momentary switches using this video:
- All wiring and gang boxes needed for exterior use.

Some simple automations using Shelly "Scenes"
- Turn off SWG if the pump is turned off
- Turn on the pump if the SWG is turned on.

Advanced - Problem and solution
This is my second season with the pool and I have an air leak on the intake side. Its not a bad leak and only shows itself if the skimmer is getting clogged (I use hair nets in the skimmer which can get clogged). I would also find kids toys stuck in the skimmer flap. I kept finding my pump running dry... not good.

Since I bought the Shelly 1pm's, they have power monitoring. When my pump is running on high it pulls about 975-1013 watts. If its on low, it pulls around 200 watts.

I realized that when there is air in the pump, the wattage drops quite a bit. On high it will drop below 900 watts, on low it will drop below 190 watts.

Shelly doesn't look like they have a great way to do this in their "scenes" so I installed a program called Home Assistant. I'd never used it before but had a file server running in my basement and just installed it right there.

Home assistant detected and added my shelly's instantly. It was super easy and required zero coding, I could do it all in the web interface.

My simple automation - Detect water in the pump, turn it off and notify me:
When the pump is on high speed -
- Trigger: pump power is <900w for at least 30 sec.
- Condition: if pump power is >500w (this is so it doesn't trigger when the pump is in low speed mode) & the pump is on
- action: turn off the pump & notify me with notify.notify (this is basically just the android app). This will notify me and my wife.

When the pump is on low speed-
- Trigger: pump power is <195w for at least 30 sec.
- Condition: if pump power is >1w & the pump is on
- action: turn off the pump & notify me with notify.notify (this is basically just the android app). This will notify me and my wife.

Conclusion:
I'm very happy with my simple low effort solution. It didn't take a lot of time and it runs perfectly.

In the future I'm going to add a thermometer to one of the shelly's and setup home assistant to do temperature logging of my pool water into a google sheet. I want to better understand how the pool temps fluctuate with outdoor temps
 
hi. i'm looking at using shelly(ies) + ESPhome to automate most of my pool equipment - pump, heater, valves, etc. i can't bring myself to paying 1000s for the Pentair stuff :) anyway, i stumbled on your post and saw you're using a shelly 1PM. Is this because your equipment runs off 110V only? Mine is 220V. thanks and good solution!
 
hi. i'm looking at using shelly(ies) + ESPhome to automate most of my pool equipment - pump, heater, valves, etc. i can't bring myself to paying 1000s for the Pentair stuff :) anyway, i stumbled on your post and saw you're using a shelly 1PM. Is this because your equipment runs off 110V only? Mine is 220V. thanks and good solution!
I'm looking into building DIY automation using Z-Wave and Home Assistant as well for the same reason... That pool automation prices are outrageous by today's standard of capabilities for home automation. Thoughts on your 220V stuff: my relays are Midtex 187-262CL1 (Pentair) and Jandy is similar. They both use a low-voltage circuit to trigger the high-voltage relay. This means you could wire the low-voltage to the Shelly to trigger the relay and supply your 220.
 
  • Like
Reactions: elmoco
I'm looking into building DIY automation using Z-Wave and Home Assistant as well for the same reason... That pool automation prices are outrageous by today's standard of capabilities for home automation. Thoughts on your 220V stuff: my relays are Midtex 187-262CL1 (Pentair) and Jandy is similar. They both use a low-voltage circuit to trigger the high-voltage relay. This means you could wire the low-voltage to the Shelly to trigger the relay and supply your 220.
yes, this is the route i'm going. for the pump/heater/SWG control, i currently have an intermatic PF1112T that handles everything. i was thinking of transitioning to something like this tuya-based controller originally. Tuya stuff integrates OK with Home Assistant, unless tuya decides to break its cloud service somehow. So instead, i was thinking of going your route. Getting a 40A contactor like this one and controlling it with a Shelly 1PM. For the valves, i already purchased this one Intermatic PE24VA Valve Actuator, Black which I can control with a sprinkler controller i had laying around (Orbit), which coincidentally, also integrates well with Home Assistant. However, i'm also looking at a ESP32-based 16 channel 24VAC relay system to control the valves. all this is certainly a work in progress but it's literally $1000's cheaper than the name brand pool smart controllers.
 
Check out the low-budget automation link in my signature. It may or may not be of use to you. I used simple relays to control valve actuators, my SWG, and Intelliflo pump speeds.

If you're controlling only one valve actuator, a sprinkler timer will work. It doesn't work well for multiple actuators that need to move at the same time since it can only operate one station at a time.

I've since added a Sonoff TH-16 with temp probe to track pool temps and to control the heater function.
 
  • Like
Reactions: elmoco
Check out the low-budget automation link in my signature. It may or may not be of use to you. I used simple relays to control valve actuators, my SWG, and Intelliflo pump speeds.

If you're controlling only one valve actuator, a sprinkler timer will work. It doesn't work well for multiple actuators that need to move at the same time since it can only operate one station at a time.

I've since added a Sonoff TH-16 with temp probe to track pool temps and to control the heater function.
i like what you did with the valves. that's very close to what i'm doing. thanks!
 
@Rancho Cost-a-Lotta like the band Chicago once said "You're my inspiration!" :ROFLMAO: Really good stuff. I've got most of my solution mapped out, but instead of using Wifi I'm planning to use Z-Wave as I'm already invested in it as my automation mesh. Zooz multi-relays also come in NO/NC variety for my actuators. The most expensive piece of the puzzle seems to be controlling this Pentair VSF pump.... That IntelliCOM II module ain't cheap to buy. I did find this cheapo knock-off... wonder if it's worth the shot?
 
I did find this cheapo knock-off... wonder if it's worth the shot?
I've seen this (or a similar version) before, but I don't recall where. My 2 cents...I would step up to the IntelliComm. Take into account the overall cost savings in creating your own automation system. You have to decide if it's worth it to you.

Make sure you have 24 VAC power for the valves. Each valve draws about 0.75 amps.

Are you capable of setting up your own controller using Raspberry PI? A few members have set up there own automation using "nodejs-poolController. Way above my skill set, but here's a Wiki page for you reading pleasure.

 
  • Like
Reactions: elmoco
I've seen this (or a similar version) before, but I don't recall where. My 2 cents...I would step up to the IntelliComm. Take into account the overall cost savings in creating your own automation system. You have to decide if it's worth it to you.

Make sure you have 24 VAC power for the valves. Each valve draws about 0.75 amps.

Are you capable of setting up your own controller using Raspberry PI? A few members have set up there own automation using "nodejs-poolController. Way above my skill set, but here's a Wiki page for you reading pleasure.

This setup is incredible. I was only looking to automate the valves, maybe the pump/circulation. But this write up is amazing. Particularly the ph probe setup, which I definitely would benefit from if it was automated. Thanks!
 
  • Like
Reactions: Rancho Cost-a-Lotta

Enjoying this content?

Support TFP with a donation.

Give Support
This setup is incredible. I was only looking to automate the valves, maybe the pump/circulation. But this write up is amazing. Particularly the ph probe setup, which I definitely would benefit from if it was automated. Thanks!
Ping @rstrouse if you need help.
 
  • Like
Reactions: elmoco
Makin' it happen!

You probably know this, but (if I'm reading the label correctly) the power supply can only handle one valve at time at 750 mA.
Good eye! Yes, that’s a “light” power adapter I’m using to test. I’m looking at this one:
FUNCTIONAL DEVICES TR100VA002 100VA, Primary 120V, 50/60HZ, Secondary 24VAC, 4 Wire, Transformer, Dual HUB/Foot Mount, AUTO Reset Amazon.com: FUNCTIONAL DEVICES TR100VA002 100VA, Primary 120V, 50/60HZ, Secondary 24VAC, 4 Wire, Transformer, Dual HUB/Foot Mount, AUTO Reset : Electronics
If I can get it cheap(er), or this one:
Outdoor Landscape Transformer 110/120V to AC 24V/2.5A,60W Low Voltage Waterproof Power Supply Converter for LED Landscape Lighting, Spotlight, Pathway Light https://www.amazon.com/dp/B081349RT1/ref=cm_sw_r_cp_api_i_Y8AFB0DW36YTHP6E3W4F
I’m not planning on driving more than 2 valves at once, but a little amp margin is good.
 
  • Like
Reactions: Rancho Cost-a-Lotta
i havent been able to dedicate as much time to this as I’d like, but this is what the control center is starting to look like. I do need a bigger box because things are looking tight.

EDC689F6-2195-4E68-A3D6-21624600B1FD.jpeg

Question - is it possible to control the temperature settings (spa and pool) on a Mastertemp 400 via RS485? Thanks
 
  • Like
Reactions: Rancho Cost-a-Lotta
Question - is it possible to control the temperature settings (spa and pool) on a MasterTemp 400 via RS485? Thanks

The answer to your question is yes. However, it is not that simple. For you to maintain control of the heater you will need to send repetitive messages every 10 seconds or so from your master.
The message format is not a typical modbus rather it goes like this.
[preamble][header][payload][checksum]

Where:
preamble = [255, 0, 255]
header = [165, 0, heater address + 111, 16, 114, 10]
payload = [144, call for heat, pool setpoint, spa setpoint, 0, 0, 0, 0, 0, 0, 0, 0, 0]
checksum = total sum of all previous bytes starting with the header in big endian format

For each message you send it will return a response that has a preamble/header like [255, 0, 255][165, 0, 16, heater address + 111, 116, 23]. The payload of this message contains encoded bytes that describes the current state and mode of the heater. It is important to note that the temperature from the internal temperature sensor is never sent back from the heater.

You have a very long road when it comes to building something out that controls your pool with heater control, pump control, valve control, monitoring, chemistry control, delay processing, and even Home Assistant interfaces on an ESP32. Why not just start with something that is fully developed and hook your hardware up to it. This will do all of it for you from the simple to the extremely sophisticated.

 
The answer to your question is yes. However, it is not that simple. For you to maintain control of the heater you will need to send repetitive messages every 10 seconds or so from your master.
The message format is not a typical modbus rather it goes like this.
[preamble][header][payload][checksum]

Where:
preamble = [255, 0, 255]
header = [165, 0, heater address + 111, 16, 114, 10]
payload = [144, call for heat, pool setpoint, spa setpoint, 0, 0, 0, 0, 0, 0, 0, 0, 0]
checksum = total sum of all previous bytes starting with the header in big endian format

For each message you send it will return a response that has a preamble/header like [255, 0, 255][165, 0, 16, heater address + 111, 116, 23]. The payload of this message contains encoded bytes that describes the current state and mode of the heater. It is important to note that the temperature from the internal temperature sensor is never sent back from the heater.

You have a very long road when it comes to building something out that controls your pool with heater control, pump control, valve control, monitoring, chemistry control, delay processing, and even Home Assistant interfaces on an ESP32. Why not just start with something that is fully developed and hook your hardware up to it. This will do all of it for you from the simple to the extremely sophisticated.

you're absolutely right and was already seeing "the light" and following your suggestion re the SW side of it. my project started with me trying to automate the valves. straight forward. then i started looking into replacing the intermatic clock/contactor. then the heater, then.... you get the idea. i happen to have an RPI4 laying around (lucky me). i'm going to give PoolManager, and REM, a try this week. if you dont mind, i may reach out to you. thanks for the info

ps - fyi, i was considering doing REST commands via home assistant for the RS485 (ie heater controls).
 

Enjoying this content?

Support TFP with a donation.

Give Support
Thread Status
Hello , This thread has been inactive for over 60 days. New postings here are unlikely to be seen or responded to by other members. For better visibility, consider Starting A New Thread.