Logic for DIY solar controller - Tuya/SmartLife app

Jul 12, 2023
11
Detroit, Michigan
Pool Size
35000
Surface
Plaster
Chlorine
Liquid Chlorine
I am adding a solar heater (in between filter and existing gas heater), and am using @Rancho Cost-a-Lotta 's amazing post as a guide for the automation for contolling the actuator-enhanced 3-way valve. Most folks here seem to opt for the Sonoff line of products for wifi relays and sensors. I am trying to stick with devices that work with the Tuya/SmartLife app since I already have a bunch (including Dewenwils pool switch), so I have purchased this relay and this temperature gauge, which appear to have identical hardware to the Sonoffs and I assume the apps include similar features (but if I need to I'll buy the Sonoff versions).

My question is about programming the logic for turning on and off the solar heater. My thought is to use two temp sensors, one right before the solar heater and one coming out. Solar will go on automatically in the morning and will stay on as long as the water coming out from solar is higher than going in, and if not, then turn off (and it will turn off in any case in the late afternoon when the sun is gone). By the way, I'm in Michigan, and the pool is only open from around Memorial Day to around Labor Day, so this doesn't need to be a year-round solution.

Problem is, I don't know if the Tuya app (or Alexa routines) supports comparing two temporature sensors. I can set a trigger for if the temperature is below or above a set number, but I can't figure out how to use two sensors in concert to define the trigger.

Does anybody know how to do this? Is this supported by the app the Sonoff app, or is there a third service (IFTTT or something) that can enable this functionality? Did I buy the wrong product? If I flash the firmware and install Tasmota (which I know will entail a learning curve) will that add this functionality? I'll do that if I have to, but I'm curious if anybody has gotten this to work with the stock smart home platforms.

Taking a step back, is this even the most efficient logic to control the solar? Should I be measuring air temperature or light (which the sensor I bought also does) instead?

Tuya and Alexa can use weather data (reported from an online service, not based on sensors, so reliability is questionable). Is the simplest solution to just use that, i.e., on during normal daylight hours, turn off if weather is "cloudy" or "rainy," turn on if "sunny" (BTW only options are sunny/cloudy/rainy/snowy/hazy)? I want to balance efficiency with ease of use so I can set it and forget.
 
Sorry I can't help with solar control. Maybe the thread below can help. @Dirk and @strategy400 are fairly active and may stop by to offer advice.

Best of luck!

 
I write/debate/argue/warn extensively in the thread that @Rancho Cost-a-Lotta linked about why I think trying to build your own solar controller is a waste of time, even if the challenge is interesting to you. It is NOT just a matter of temps or daylight or weather, it is ALL of those things and a whole lot more, all figured out over years by teams of programmers that considered all of the factors. They then programmed them all into a logic board that can control your pump and your actuated solar valve, and compute on-the-fly when to engage the solar heater based on available heat on the panels, water temp, thermostat setting, etc.

These computations are so sensitive they will shut your heater off if a cloud passing overhead for a few minutes will cool your pool more than it will heat it. Remember, it's not just about turning the heater on in the morning and shutting it off when your pool gets warm enough. You also have to calculate exactly when the heater will warm the pool effectively, and not cool the pool. And to do so in the most cost effective way possible.

You could spend almost the same amount of money, and months fooling around with ad-hoc solutions and components, and at best you're going to end up with a lame solution that will not get your pool as warm as a dedicated controller will. And then you'll give up and go buy a dedicated solar controller anyway. My advice to you is forgo the experiment, save yourself a lot of time and frustration, and just buy the right tool for the job up front.

Just one guy's opinion.

Shop around for a bundle like this, which includes everything you need. Be sure to buy from a reputable source, not necessarily the best price (I'm not endorsing this particular vendor, just grabbed one out of the blue to show you the bundle):

 
Thanks, you make a good argument, that makes sense. (y)
I'm attempting to help another here regarding their solar setup, and took a peek at the SolarTouch manual. You might do the same, to get an idea of what is possible with a good solar control setup. Things like ramping up your pump to the RPM your panels need, then idling the pump when the pool is warm enough (great energy cost saver). Or freeze protection. Or error messages. All sorts of things, that would not be possible with a couple of wifi switches.

Full disclosure: I have read some complaints about Pentair's solar controllers, regarding their ease of use (or lack thereof). It might have been their SunTouch product. You might do a search here for some threads that discuss this issue.

Fuller disclosure: I've never used any dedicated solar controller. I have an EasyTouch pool automation controller, that includes all the solar stuff. It works great. I have some issues with the EasyTouch product line, but cannot imagine owning a pool without full automation (I even have automation for chlorine and acid). Point being, before you invest in any solution to control your heater, you might explore not only dedicated solar controllers, but full automation controllers as well.

Not doing so when I was making my purchasing/modifying decisions is still a regret. I should have found a forum and asked questions (just like you are doing), and downloaded brochures and manuals to better understand what is available, then made a well-informed decision. (And given what I know now, I would have made different decisions.)

My recommendation: Explore all that automation can offer, decide what features you'd like, then what you really need, then decide which of those you want to pay for! There are plenty here that will chime in about their experiences with various controllers, what they like, or don't like, or what they should have purchased, etc.

And it may sound expensive (and it is), but I don't regret automating my pool. I use it every day (even in the off season), and it has turned out to be a good investment. I think of it like any appliance. Yes, I could get out of my car and open my garage door by hand, but I like pushing the button! I could warm up my coffee on the stove, but it's way more convenient to use my microwave.

The expense and complication of tech is the cost of convenience and leisure. Do the research and the math to see what works best for you.
 
I use the sonoff temp sensor to measure air temp and turn my valve on in the morning and off in the evening. If the temp drops below my set point during the day it shuts it off. I tell it to shut off a half hour before sunset. Sometimes if the temperature is high at night I'll catch it turning on in the middle of the night. Still working the bugs out. You can create logic in the app. It requires some user interaction occasionally but I'm always poking at my phone anyway. Crude yet effective and constantly under refinement. I figure one of those store bought automation system is going to wear my actuators out turning them on and off all the time anyway, maybe by design! I had to turn my solar off yesterday because the pool got up to 86 and wasn't even refreshing anymore. When it cools down I'll probably wish I had one of those engineering marvels like Dirk is talking about.
20230707_154815.jpg
Screenshot_20230522-121128_RXCamView.jpg
 
I use the sonoff temp sensor to measure air temp and turn my valve on in the morning and off in the evening. If the temp drops below my set point during the day it shuts it off. I tell it to shut off a half hour before sunset. Sometimes if the temperature is high at night I'll catch it turning on in the middle of the night. Still working the bugs out. You can create logic in the app. It requires some user interaction occasionally but I'm always poking at my phone anyway. Crude yet effective and constantly under refinement. I figure one of those store bought automation system is going to wear my actuators out turning them on and off all the time anyway, maybe by design! I had to turn my solar off yesterday because the pool got up to 86 and wasn't even refreshing anymore. When it cools down I'll probably wish I had one of those engineering marvels like Dirk is talking about.
View attachment 514689
View attachment 514690
Would you mind sharing the cost of everything we're looking at, including the box and terminal and transformers, etc?

I'm assuming that setup does more than just solar. If so, can you break out the cost of just what would be needed to control solar heating?

Can your system report it's status remotely (temps and what is active/on/off)?

I'm just looking for some rough figures. Are you getting 10% of the capability of a dedicated solar controller, or a pool automation controller, but paying almost 90% of the cost of one? Or have you replicated 90% of the features of a solar controller but saved 90% by doing so? Or where in between?

You have a valuable perspective, having built your system, vs my perspective of only using "store bought."
 
Why do you need 3 relays? You have 12 different circuits to control?
3 relays will give me 8 pump speeds. I need 1 for solar valve. 2 for suction and return valves (pool/spa mode). 3 for lights (pool/spa/yard). 2 for heater (high/low). 1 for Chlorine generator. I might need to add relays.
 
Would you mind sharing the cost of everything we're looking at, including the box and terminal and transformers, etc?

I'm assuming that setup does more than just solar. If so, can you break out the cost of just what would be needed to control solar heating?

Can your system report it's status remotely (temps and what is active/on/off)?

I'm just looking for some rough figures. Are you getting 10% of the capability of a dedicated solar controller, or a pool automation controller, but paying almost 90% of the cost of one? Or have you replicated 90% of the features of a solar controller but saved 90% by doing so? Or where in between?

You have a valuable perspective, having built your system, vs my perspective of only using "store bought."
Can't remember what everything cost. Most expensive are the valve actuators. Close to $200 each. The box was near $200. The smart switches were 3 @ ~$40. Terminals ~$20. Wire.. I forget... $40? Conduit? I forget. Transformer? ~$40. Outlet... $40. Probably add $100 for other misc. stuff. The main reason I went this direction is the way any name brand unit would interface with the pump. My pump is Hayward and Hayward won't even sell me a recent automation system.
 

Enjoying this content?

Support TFP with a donation.

Give Support
1 problem I'm having is how to get water temp. I don't like a metal sensor in my pool water.
Did I show you this thread already?


I solved for my metal-cased temp sensor by embedding it in a length of cable jacket filled with marine-grade caulk. I doubt the metal casing is even connected electrically (I measured) but to play it safe I added the insulation. The thing runs on 5VDC, so the shock hazard is non-existent anyway. It was an underwater-rated sensor, so the caulk is just added protection.

It's been totally submerged in my pool (not just mounted in a hole in a pipe wall) for at least a year and a half. If it was leaking, or in any way exposed to the pool water (which is full of salt), it would have already failed.

pool sensor.jpg
 
  • Like
Reactions: strategy400
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.