tagyoureit / nodejs-poolController

An application to control pool equipment from various manufacturers.
GNU Affero General Public License v3.0
314 stars 94 forks source link

Issue with Circuit Groups #361

Closed Exit2Studios closed 4 weeks ago

Exit2Studios commented 2 years ago

Describe the bug Getting strange behavior when turning on a circuit group. It turns on others.

To Reproduce Steps to reproduce the behavior:

  1. Go to features
  2. Click on Spa Spill G
  3. Waterfall G turns on

Expected behavior Only selected group turns on

Screenshots Capture

image

Config Files Archive.zip

Pool Equipment

Desktop (please complete the following information):

tagyoureit commented 2 years ago

Can you send me the json files in njsPC data directory (poolConfig.json, poolState.json)? Those are the ones I need.

Exit2Studios commented 2 years ago

Here are the files: Archive 2.zip

If you see anything off in your review, please let me know!

Thank you!

rstrouse commented 2 years ago

Pull njsPC I reworked the state synchronization algorithm. The state of the group is on when all the conditions are met for the definition. For instance your Waterfall G group should be on when the Aux pump is on and the Aux Intake V and Aux Return V are off. If you manually change the state for Aux Intake V or Aux Return V then the Waterfall G group should go off.

Exit2Studios commented 2 years ago

That makes sense, but somewhat backwards from what I was thinking. Thank you.

rstrouse commented 2 years ago

How were you thinking? This is how it works on IntelliCenter.

When you turn on the Waterfall G it should turn on the Aux Pump and turn off Aux Intake V and Aux Return V.

If you were to manually turn on the Aux Return V then it will set the Waterfall G group as off and show the Spa Spill G as on. Then if you were to turn on the Aux Intake V then it will turn off the Spa Spill G and show the Spa Jets G as on.

That being said I assume you are hiding the Aux Intake and Return features as well as the Aux Pump and only showing the groups. This will allow you to toggle between them.

Exit2Studios commented 2 years ago

I see now.  Then not opposite of what I was thinking :-). I don't have an IntelliCenter (I have a Hayward/Goldline controller).

I do plan to hide, but just have them visible for testing purposes.

tagyoureit commented 2 years ago

Not sure if this is still an issue, but I may have just fixed something that could have been causing some strange issues. Either way, I'll close this for now and please re-open if you still have the problem.

Issue possibly fixed as part of: https://github.com/tagyoureit/nodejs-poolController/issues/365

Exit2Studios commented 2 years ago

Hi @tagyoureit and @rstrouse,

I'm sorry to revisit this very old "issue" but I'm having a bit of a hard time getting my head around this behavior. I have the same Circuit Groups set up and I just don't understand the logic of how it is working. What is the best way to accomplish the 3 options I have above (spa jets, waterfall, and spa spill)? As I have it setup now, they can all be on at the same time, which shouldn't be able to happen. I need to figure out a logical way to only allow for one of those options at a time. Basically the Aux Pump is on for all three, but the Feature Valves (not my main Intake/Return) change based on mode.

tagyoureit commented 2 years ago

Since the initial issue was so long ago, can you upload another replay capture?

And to clarify... what is the exact problem you are facing? Are all three circuit groups on at the same time? Or are all three features on at the same time?

Exit2Studios commented 2 years ago

By replay, do you mean screen shot?

I’m having a hard time understanding why turning on circuit group “Spa Spill” would also turn on the “Waterfall “ circuit group.

It would seem having the other groups included in the drop downs would allow to control for turning them off when others are turned on, but I’m unclear why it’s happening in the current state.

tagyoureit commented 2 years ago

Follow these instructions for the replay capture. Start the replay with all of your circuit groups off. Change one, wait 10 seconds, change another one, wait 10 seconds, etc. Then end the replay and upload it here.

Exit2Studios commented 2 years ago

replay.zip

tagyoureit commented 2 years ago

The replay only shows me that your comms aren't working and some of the actions were delayed/cancelled because of a cleaner startup delay. I'll try to replicate your light group issue separately.

I've got a few questions...

  1. I assume your shared body has a spa that can spill over into the pool, yes?
  2. Are your spa jets hooked up separately from your regular spillway and filter (to the Aux pump)?
  3. What type of pump is your Aux Pump? Is it a single speed pump? How is it wired to your electric panel?
  4. Are you able to control your VSF pump through this app?
  5. How many valves/diverters do you have? How are they laid out? Can you send a picture? (If you want to give an entire overview of your pool in the My Pool section of the discussion forums that would be great.)
  6. Do you have a cleaner? How is it controlled?
tagyoureit commented 2 years ago

Pull the latest. I found an issues with the circuit group logic. But also lmk about the answers to my questions above... I'm curious about your pool setup and may have some suggestions.

Exit2Studios commented 2 years ago

@rstrouse , you and I had a similar conversation on this on the gitter page a while back (same issue), and I posted some info on my pool there. However, I've posted an overview in My Pool #520 section as well.

To answer your questions:

  1. Yes, my shared body has a spa, but No it does not spill over into the pool. It spills over into the infinity edge catch basin (which creates some operational challenges)
  2. Spa jets (and Scuppers) share the Auxiliary pump and are not connected to the main pump.
  3. Aux pump is a Pentair Whisperflo single speed. It is currently controlled by my Hayward panel, but will be controlled by a 3HP relay once I switch over completely to njsPC
  4. I am able to control my VSF from njsPC, but it is not currently hooked up at all (hence the comm issues)
  5. I have 4 valves, 2 for standard intake/return and two that control the spa jets and water scuppers. These also have the added benefit of being able to spill over (completely or small percentage) the spa to keep the negative edge on the spa moving.
  6. I have a Maytronics/Pentair Warrior SE (which replaced a Prowler 920, which replaced a pressure side Polaris 280), currently controlled via smart plug over Home Assistant.

As always, thank you for your dedication to this project and patience with people like me :-)

tagyoureit commented 1 year ago

There are a few things you should consider when setting up Nixie. Some of these may not seem to make a difference but will semantically let the app know what's what and be able to control in in the most efficient manner.

  1. You should setup your single speed pump to run whenever the waterfall, spa fill or spa jets are on. (*Pull njsPC and dP and we just changed this over from needing to be a body association). This eliminates the need for having an aux circuit called Aux Pump and it will also show up as an actual pump.
    2022-07-10_11-31-52

You'll also see if I have the circuits in the pump definitions assigned to the pool and spa. You previously had speed boost +/- there but those are specifically for remote controls and won't work like you are expecting. You could add additional circuits and set their associated speeds here.

You can also setup the valves as known valve items. This puts the logic for certain valve functions at the right place instead of just treating them like an off/on switch. (EG if you want the pump to turn off during valve activation.). Because you still want the spa jets g group to have both diverters active the right way to do that is to have the circuit group.

2022-07-10_11-35-29

Finally, your groups could then be a bit tidier. The pump already knows to turn on with the waterfall, spa spill and spa jets so you can leave out the Aux Pump circuit.
2022-07-10_11-42-37

Exit2Studios commented 1 year ago

Thank you. I had previously tried to add the aux pump as an actual pump, but since it required a body, tried the other option. This way seems to work much better. Appreciate walking me through the setup/cleanup of the circuits.

Exit2Studios commented 1 year ago

I do notice that if I turn off "Waterfall G", the aux valves both turn on, and "Spa Jets G" turns on. Is this expected behavior? I feel like there needs to be an option to have the 2nd SS Pump have an "off" option, but not sure how to set that up.

tagyoureit commented 1 year ago

D'oh! Right... the conditions I posted for Waterfall G and Spa Jets G are completely inverse so at least one will always be on. Go back to your original circuit group configuration in the very first post in this thread. Except... don't setup the relay for the pump from the Aux Pump circuit, but create a pump that runs when the Aux Pump circuit is on. Then it will appear as a pump but give you the same functionality.

At this point, you can hide the aux pump, feature intake, and feature return 'features' if you want.

2022-07-11_10-13-53

2022-07-11_10-18-11

2022-07-11_10-17-03

Exit2Studios commented 1 year ago

That works much better. However, when I turn the Waterfall G group off, the Aux Intake and Return Valves turn on. Same for Spa Spill G, when I turn it off, the Aux Intake valve turns on.

Exit2Studios commented 1 year ago

I also have another strange behavior. When I choose "low speed", the relay for the Aux Pump turns on and off repeatedly.

image image image
tagyoureit commented 1 year ago

I also have another strange behavior. When I choose "low speed", the relay for the Aux Pump turns on and off repeatedly.

I don't see any overlap between Low Speed/High Speed and your Aux1. You might have something that is still pointing to it somewhere. You can upload a new replay and I can also take a look.

You should, however, have the "pool" circuit as part of your VSF. It can be your low speed if you want, but you shouldn't need to turn on the pool and then additionally select a speed.

That works much better. However, when I turn the Waterfall G group off, the Aux Intake and Return Valves turn on. Same for Spa Spill G, when I turn it off, the Aux Intake valve turns on.

I'm also checking with @rstrouse and looking at the manual regarding the default behavior of circuit groups. Should turning off the circuit group turn off all the circuits? Or should it invert the status of each circuit. Right now, we have it inverting the status of each circuit.

Exit2Studios commented 1 year ago

I don't see any overlap between Low Speed/High Speed and your Aux1. You might have something that is still pointing to it somewhere. You can upload a new replay and I can also take a look.

It looks like a restart fixed this behavior, so not sure what the gremlin was. Strange for sure.

You should, however, have the "pool" circuit as part of your VSF. It can be your low speed if you want, but you shouldn't need to turn on the pool and then additionally select a speed.

This makes sense and I will make that change. Is it appropriate to have the "low speed" defined in the Aux Circuits as I do?

I'm also checking with @rstrouse and looking at the manual regarding the default behavior of circuit groups. Should turning off the circuit group turn off all the circuits? Or should it invert the status of each circuit. Right now, we have it inverting the status of each circuit.

To my very uneducated mind, it seems like having the option to turn off somehow, either by adding circuit groups as an option or some other way would make sense, but I'll be interested to hear what you both come up with.

Thanks as always!

tagyoureit commented 1 year ago

Is it appropriate to have the "low speed" defined in the Aux Circuits as I do?

No, simply assign the pool circuit as the low speed.

To my very uneducated mind, it seems like having the option to turn off somehow, either by adding circuit groups as an option or some other way would make sense, but I'll be interested to hear what you both come up with.

This is the worst of all worlds, but if you have an "all off" group and turn it on it will effectively turn off your three circuits (but this group would be on).

2022-07-11_16-43-19

Let me work on making a toggle for either inverting the states or turning off all the circuits.

tagyoureit commented 1 year ago

Pull dashpanel and njsPC. I added an On/Ignore (turn the circuit on when the group turns on; ignore it when it turns off) and Off/Ignore (turn the circuit off when the group turns on; ignore it when it turns off). Interestingly enough, Intellicenter treats 'ignore' as the On/Ignore behavior above but what you need is the Off/Ignore, hence I added both options explicitly. I'm treating ignore as simply that - ignore the circuit state when either turning the group on or off.

2022-07-12_00-21-50

Exit2Studios commented 1 year ago

Brilliant, thank you!

rock-crusher commented 1 year ago

So, this is interesting.

I too have noticed odd things in the circuit groups.

One thing I noticed is the pump delay function while valves are in motion does not work in the circuit group if the circuits are not listed in a specific order in the group circuit window.

Why should it make a difference what order you put the circuits in?

delays no work works
tagyoureit commented 1 year ago

Just so I don't chase my tail, can you tell me if which circuit functions and valves your circuits are assigned to?

Circuit - Circuit Function - Valve - Valve Assignment

Spa - Spa - Valve C - Spa Spillway - Spillway - Valve D - Spillway

Or better yet, send another replay so I have your exact setup. Given your specific scenario, I could envision you setting up your pool any number of ways.

rstrouse commented 1 year ago

Actually that spa circuit and the spillway circuit are both specifically impacting Intake and Return valves. The order in which this is done will determine whether the valve rotation delays will be in effect. The key for this function is to preserve heat in the spa when switching the valve positions. Turning the spillway on throws all of that out the window since the return valve is in the diverted position and the intake is not diverted.

If you want to empty the folks out of the spa switch to pool mode when the water temp < 60F with no delays.

If you are cavitating your pump or causing hammer while rotating either the intake or return valves even at full pump speed you should maybe revisit your plumbing.

rock-crusher commented 1 year ago

I should have been more specific. In each configuration the spa delay always works as it should, it’s the spillway pump delay that only works when the configuration is set-up as the picture below shows.

I was just more curious than anything as to why it acted this way. In the configuration below, the spillway activates the return valve to the spa all while the pump pauses the 30 second delay. It does exactly what I expected and wanted it to do in this configuration. I was just confused about when the two are flipped in the configuration (spillway listed first & spa second) the pump delay was omitted during the spillway return valve rotation to the spa.

As always thanks again for your explanation.

Works
rstrouse commented 1 year ago

It is rotating the spillway mode first in the other configuration. Once this is done then it does not see a delay condition for rotating the intake valve. If it did then we would have the undesirable condition where turning on the spillway would result in delay. You will also find that when you turn this group on and it is in pool mode it should not delay because the intake valve is already in the resultant position.

rock-crusher commented 1 year ago

It is rotating the spillway mode first in the other configuration.

Actually, it rotates the spillway mode first in either configuration. Just one has the pump delay and the other does not.

You will also find that when you turn this group on and it is in pool mode it should not delay because the intake valve is already in the resultant position.

As long as the configuration is set as shown in the picture above and you turn this group on when in pool mode it does in fact shutdown the pump for the 30 second delay while the return valve is rotating to spillway mode.

Maybe I’m just not explaining myself correctly, or simply not understanding, or trying to do something it’s not designed to do, although in the above picture configuration it’s doing exactly what I want/need it to do if that makes any sense?

tagyoureit commented 1 year ago

I know what's going on. You can only have the spillway activated when the pool is running. It's not a valid state to have the spa and spillway both on at the same time. You can test this in Nixie - Turn on the pool and you can toggle the spillway on/off. Turn on the spa and the spillway is locked out.

"works as it should" scenario - the group turns off the spa, and then pool mode is activated and the spillway is turned on.

"delay doesn't work" scenario - the group is trying to turn on the spillway with the spa on, the command will get rejected. But the next command will turn off the spa, so the spillway could subsequently be turned on.

rock-crusher commented 1 year ago

Hi tagyoureit and thanks for responding.

"works as it should" scenario - the group turns off the spa, and then pool mode is activated and the spillway is turned on.

That is not exactly how it is set-up (see pic below). The intent was for when the “enjoy spa” is turned on the spillway activates for 1min, or whatever time length I decide to set it for, in this case it’s the 1 min. When activated, the pump is delayed for 30 seconds while the spillway return valve rotates. After the valve completes rotation the pump turns on at 3450 rpm. This will allow the spa to completely fill and also skim whatever leaves/debris happens to be on the surface of the water pushing it over and through the spillway for the skimmer to get later. After the “enjoy spa” circuit group times out (1min) the pump automatically shuts down (30 second delay) and turns on the spa mode which rotates the intake valve to spa, fires up the heater etc. I know, the delays aren’t necessary, but I just like them (I think rstrouse laughs because I always want to implement a delay every time a valve moves…Lol.)

I’ve used this set-up before and it’s nice especially when children are playing in the spa splashing out lots of water, getting in/out and tracking all sorts of misc. debris in with them. Then, when it’s time for the adults to get in I just simply hit the “enjoy spa” and the water is replenished, the top skimmed off and ready to go.

"delay doesn't work" scenario - the group is trying to turn on the spillway with the spa on, the command will get rejected. But the next command will turn off the spa, so the spillway could subsequently be turned on.

The spa is never on, if you look at the same picture again below, you will see that the spa is set to off/on and the spillway set to on/off.

Like I said before, this is working just fine for me, I was just wondering why the other configuration omitted the delay.

enjoy spa group
tagyoureit commented 1 year ago

I fixed a place in the code where we run run some of the commands for changing the state of a body even if it was already in that state. EG when you were turning off the spa but the spa was already off we were ending all of the delays. Now I am checking to make sure the desired state of the body isn't already the current state before running the logic. Both of your scenarios should now function the same.

[edit] Annnd, my dyslexia got the best of me. I referenced 316 in the commit instead of this discussion, 361. Commit for this fix: https://github.com/tagyoureit/nodejs-poolController/commit/d2bd07fbdb05f79e3f482d7c2cdca981008b5f7f

rock-crusher commented 1 year ago

Hi tagyoureit… Lol Awesome!

Just tried it out and she works great! No more confusion here, THANKS!!

I really appreciate you guys (tagyoureit/rstrouse) taking the time helping me understand all this madness.

Cheers!

beer