Pool Controller with nodejs-poolController via MQTT

As far as I can tell that is mostly correct. I think those valve actuators would be 24VAC and not 120VAC. Also you should be able to just use one of the RS485 adapters, just run the A/B wires in series and not parallel. The only missing item would be a temp sensor, otherwise njsPC won’t be able to control the heater.

I saw someone in another thread suggest this hat for the the raspberry pi and it seems it might be a good fit for you. It has the relays and rs485 built in. I have no experience with this unit. 4 Relays, 4 Inputs, RS485, 8-Layer Stackable Card for Raspberry Pi – Sequent Microsystems

@spifftek70 if you want nodejs-PoolController to control the heating/cooling of the UltraTemp you’ll need a separate temp probe. It can’t use the one internal to the Ultra-Temp.

Great thanks. Would be nice to change SWG settings remotely too, so will give a look at adding this at some point.

Randy

So more like this? LOL. We’re getting there.

Ha…looks good to me!!! I saw you posted over on njsPC, they’ll be able to help you way more than I can.

Out of curiosity, what is the single speed pump for?

@randytsuch yeah, it comes in handy for when the pool has the solar cover on. When its on my SWG is around 25%, when its off I have the SWG set at 85%. It would be a pain to walk over to the pad to change that all the time.

Here is what I pull out of njsPC for the SWG. I probably should add the ability to change the super chlorinate duration at some point.
image

Do you get no flow/flow status?

Guess I need to figure it out how to get this working. Have a rs-485 board I can connect to a pi to try this.

@randytsuch doesn’t look like it. I just turned my pump down to as low as I can and the SWG status stayed at OK, both in Home Assistant and Dashpanel.

I have two single speed pumps. One is for the spa filters and the other is for the spa jets. The jets are controlled by the turn timer as is the spa aerator. Both are old, but I don’t see a real advantage to replacing either with a variable speed pump as yet. Doing so is a min of $1400 each.

Seems strange the status stayed at ok, thanks for checking.

Did a little research, looks like I want to setup in what they call nixie standalone mode.
I’m planning to setup a pi3 with a ttl to rs-485 converter on the pi’s RXD0 and TXD0 pins.

For now, just want to connect the aquarite swg to the pi, and use poolcontroller for the aquarite.

I have a esp8266 and a 4 relay board and a ds18b20 temp sensor running esphome to control my pump and get the pool temp. Interfaces via MQTT to HA and Node Red to get status and send commands. Have it working well now. I even have alexa integrated with NR, so I can tell alexa to turn the pool pump on or off.

When I recently installed the aquarite, I put it on an outdoor smart plug to control on and off.
I was planning to use run time instead of changing the swg percentage to control chlorine levels, but then I figured out the swg wants to run equal time and both polarities, so it really wants to run an even number of 3 hour cycles. I run it for 6 hours and it can keep up for my pool.

Started this pool setup over 5 years ago, if I was starting today I’d just use poolcontroller for everything.

Randy

@randytsuch yeah, stand alone single body sounds like what you would use (just a pool, right?).

When I started to build mine, I had it all setup with an esp32, db18s20’s, and a 4-module relay. Didn’t work as planned when I first hooked it up. I quickly pivoted to njsPC when I found it and am so glad I did. Definitely made it easier on me.

Just a pool, so I’ll give it a go.
I have a completely separate spa with its own equipment and controls.

I may migrate to poolcontroller over time, but right now it all works so I don’t need to.
Just need control of the SWG and I’ll be a happy camper.

@randytsuch this was posted over at njs-PC, but it looks like low flow is one of the options. Maybe I didn’t give mine enough time to spit out that data. I didn’t actually check on the unit to see what it said.

0 = Ok
1 = Low Flow
2 = Low Salt
3 = Very Low Salt
4 = High Current
5 = Clean
6 = Low Voltage
7 = Low Temp
8 = Comm Lost (this isn't actually reported by the cell cuz it cannot tell us that is cannot speak to us)

So I setup a pi3 with njsPC, connected to my aquarite 485 port, and all working well.

Made a page with instructions for what I did here.
Instructions for my setup

Like njsPC, was pretty simple to get it going, easier than I expected. Had a few minor problems that were my fault, and had to swap the serial port rx and tx which is a standard thing.

I think I installed the njsPC HA addon from HACS, its now in my custom components directory. I enabled both the MQTT and the HA MQTT interfaces in njsPC.

Most of this was done yesterday. In the HA MQTT devices page, I see a Pool Controller - njsPC device. But it only has air temp Sensor and heater Controls, nothing for SWG.
So not sure what to do now.

I’m using the njsPC webpage for now, its working fine for me.

Randy

@randytsuch Nice…I love tutorials!!! Especially when they are as detailed as yours. It really helps other people, so thanks for taking the time to put that together.

Recently there was a drive and some development to get Home Assistant to automatically discover njsPC via MQTT (which you enabled). I know that tagyoureit started working on it, but haven’t seen anything else about it…hence the SWG not being there. That is what you are seeing now in HA.

For my component, once you have it installed (like you do) and have rebooted, you’ll need to add it as an integration. On the settings > integrations page, click the new integration button in the bottom right, then search for njsPC-HA. You’ll input the IP address of your njsPC instance (port defaults to 4200 which is standard for njsPC). You should be good to go from there.

The reason you need the IP address is because njsPC-HA communicates via sockets and RESTful commands, same as the web interface does. I didn’t go the MQTT route to make it more “native”.

Thanks for the help, I added the integration and can see njsPC entities now.
But I can only see the SWG output, can’t set it?
Maybe I need REM?

Randy

@randytsuch What version of Home Assistant are you running. There was a change in 2022.7 for the number entity, which is what is used to set the output. If you are running an older version than that, you probably see an error in the logs saying that SWGNumber has not attribute _attr_value. I got some help in another thread as a work around for it, but I didn’t add it into njsPC-HA.

So if you are running an older version, try updating Home Assistant. If there is a reason you are hesitant to, I can put those changes into njsPC-HA. Just let me know!

Thanks for the hint.
I was running the 2022.6 version, upgraded this morning to 2022.8 and I see the number entities now.
Didn’t get a change to add to my screen yet, but that’s easy now.

Randy

1 Like

I’m trying to setup my wifi-to-RS485 (Elfin EW11) adapter. What do I set in RS485port on my config.json?

This is what I have in the relevant part of config.json with my EW11 which has been solid since I started this post 2 years ago (but you should make sure the netHost is your IP/hostname your EW11 device and the netPort is set correctly):

  "controller": {
    "comms": {
      "portId": 0,
      "enabled": true,
      "rs485Port": "/dev/ttyUSB0",
      "mockPort": false,
      "netConnect": true,
      "netHost": "hf-ew11",
      "netPort": 9801,
      "inactivityRetry": 10,
      "portSettings": {
        "baudRate": 9600,
        "dataBits": 8,
        "parity": "none",
        "stopBits": 1,
        "flowControl": false,
        "autoOpen": false,
        "lock": false
      }
    },