Pool Controller with nodejs-poolController via MQTT

I have the WiFi adapter hooked up and I can access it but I am having issues receiving data from my SWG. I have the A/B terminals connected but I am not sure if it’s right. Does the A to the A on the SWG and the B goes to the B on the SWG or is it switch switched. I am getting voltage on the A/B connections but I am not getting any data showing up on the WiFi adapter.

Not sure what SWG A/B are in your case, but in my Easytouch controller box (which has a wiring diagram on the backside of the door to help locate the following), the wifi-rs485 is wired to the “EasyTouch Screw Terminal COM PORT (J20)” which has 4 terminals: GND, -DT, +DT, +15. I correspondingly connected these 4 terminals to GND, B-, A+ , VCC on the wifi-rs485 device.

Thanks so much for posting this! I moved from using the nodes-poolController REST interface to MQTT this weekend. First time installing the MQTT broker.

Your guide, plus MQTT Explorer, was very helpful. I pretty much have everything working, including adding the climate configs for the pool and spa.

Everything is much snappier with a messaging system instead of polling. Also, I’m hoping that this will cut down my history database size (which is huge now due I think to all the polling I was doing with the REST interface).

The only problem I’m running into is that if I use the header toggle to turn all entities in a Lovelace card on or off, it only affects the first entity. For example, I have an entity card with the pool and spa lights. When I click the toggle in the header, it only affects the first entity.

But I don’t think this is an MQTT issue. I saw the same thing with REST.

In any case, I’ve enabled MQTT debug logging and see the messages being sent. Looks like the poolController is ignoring the second one (or perhaps not serializing simultaneous commands).

I’ve posted this issue on the nodejs-poolController gitter lobby. They’ve been very responsive in the past.

But if anyone else has run into this issue and has a solution, please let me know.

Again thanks so much for this thread. It was a real time saver.

@loopy1
I also want to say thanks for this. I installed the EasyTouch system this weekend and got the EW11 installed and communicating with the nodejs-poolController running on a raspberry pi 3B+. For the most part everything was smooth. I had to enable MQTT from the poolController-dashPanel interface before home assistant was able to get sensor information. I must have missed something when I set up MQTT in the config.json file.

I also ran into an issue with the nodejs-poolController process being stopped when I backgrounded the task. Running the task in the foreground fixed that issue.

I ended up going with the EW11a and have the antenna protruding from one of the holes at the bottom of the low voltage compartment.

Here’s a screenshot of my HA pool controller UI

Here’s a pic showing the EW11a antenna protruding from the bottom of the low voltage compartment.

With the door to the EasyTouch closed and the EW11a antenna inside the enclosure I had a very weak wifi connection. Moving the EW11a so the antenna was outside of the bottom of the enclosure fixed that issue.

Regarding running the nodejs-PC process and backgrounding, I ended up using pm2 as suggested in gitter: https://gitter.im/nodejs-poolController/Lobby?at=5cda2be3bdc3b64fcf4158b7

Basically:

How to get PM2 installed and running poolController on RPi or Linux

  1. Install PM2 with npm sudo npm install -g pm2
  2. Quit nodejs-poolController if its running.
  3. Launch nodejs-poolController with PM2 pm2 start /home/pi/nodejs-poolController/src/index.js —name=“poolController” —watch
  4. Adding the —watch in the line above will auto restart the app if you make a change such as an update with git pull. If you don’t want that action to occur simply don’t include the watch flag.
  5. Run pm2 ls to see your app(s) running with pm2. It will show uptime of the app and reset counter.
  6. Type pm2 startup If you want pm2 to auto-start at boot (recommended). This command will give you a command based on your platform to run so pm2 starts on its own. pm2 unstartup will reverse this behavior.
  7. Finally run pm2 save to save what apps you have running so if your machine reboots or crashes, it when PM2 starts back up again it will launch your saved apps again.

pm2 logs is useful for looking at the console logs of your app(s) for troubleshooting.

I’m not using --watch and have a cron job doing pm2 restart all overnight for stability.

1 Like

I’m interested in adding UI to LoveLace that lets me select the intellibrite mode (i.e. Party, Caribbean, etc.) or fixed color. But since it’s 11 light show modes and 8 colors per light, I’d like it to be compact, like a popup menu.

Has anyone figured this out? If not, maybe I’ll look into general popup selection like hass-browser_mod.

@acronce - I don’t have intellibright lights yet, but I’d be interested to see what you come up with.

Just added a few iOS actions to be able to control the spa from my Apple Watch. It’s nice to have since the watch goes with me in the pool & the phone doesn’t.

@loopy1 - Thanks for the info. I added the npm start commands to my rc.local file and don’t have issues backgrounding there. Must be a user privilege level issue.

I recently had my mesh WIFI system do an automatic FW upgrade at 3 AM, and my network went down for a few minutes. When the network came back up, the nodeJS-poolController lost communication with EW11 module. After some searching, I’ve found information on a git issue that indicates this could be a problem. So, maybe a nightly reboot as you suggest is called for. I did find that if communication is lost, I can just toggle a button (or change the spa temp) and the connection will be reestablished after 10 seconds.

I’d be very interested in a followup if you’re able to make progress on this? I don’t have Intellibrites yet, but this would be suitable motivation to pick up a set!

You probably tracked it down already, but the relevant topic should be in:
easytouch2-8/state/lightgroups/192/intellibrite

Starting from the nodejs-poolController set up, it’s not too difficult to reverse engineer that code for changing colors into Home Assistant MQTT payloads (or at least this was my route in setting up pool and spa automations in my LoveLace UI). The syntax is what always gets me, but there are lots of people on the forums here that can read MQTT in their sleep :).

Are you able automate to set the pump speed of a VS pump with this setup?

Yes! See switch section of Home Assistant Setup Instructions · tagyoureit/nodejs-poolController Wiki · GitHub

i.e.

  - platform: mqtt
    name: Pool Pump Speed 1
    icon: mdi:pump
    state_topic: "pool/state/circuits/2/pumpsp1"
    command_topic: "pool/state/circuits/setState"
    payload_on: '{"id":2,"isOn":"on"}'
    payload_off: '{"id":2,"isOn":"off"}'
    optimistic: false
    retain: false
    qos: 0

  - platform: mqtt
    name: Pool Pump Speed 2
    icon: mdi:pump
    state_topic: "pool/state/circuits/3/pumpsp2"
    command_topic: "pool/state/circuits/setState"
    payload_on: '{"id":3,"isOn":"on"}'
    payload_off: '{"id":3,"isOn":"off"}'
    optimistic: false
    retain: false
    qos: 0

Thanks, didn’t even see that whole section.

Question… I have a heatpump with a cool mode built in and as such I have a heatsetPoint and a coolsetPoint. How can I control both of these with the temperature state topic?

I’m also having issues getting the button to change from ultratemp to off but I’m not sure what the command_template is doing.

off: val 1, name off, desc Off
ultratemp: val 5, name ultratemp, desc, UltraTemp

climate:
  - platform: mqtt
    name: "Pool Heatpump"
    min_temp: 40
    max_temp: 104
    modes:
      - "off"
      - "ultratemp"
    current_temperature_topic: "intellicenter-i8ps/state/temps/bodies/1/pool/temp"
    value_template: "{{ value_json.temp }}"
    mode_state_topic: "intellicenter-i8ps/state/temps/bodies/1/pool/heatMode"
    mode_state_template: >-
      {% if value_json.heatMode.val == 0 %}
        off
      {% elif value_json.heatMode.val == 1 %}
        off
      {% elif value_json.heatMode.val == 5 %}
        ultratemp
      {% endif %}
    mode_command_topic: "intellicenter-i8ps/state/body/heatMode"
    mode_command_template: >-
      {% set values = { 'ultratemp':'{"heatMode":5, "id":1}', 'off':'{"heatMode":1, "id":1}'} %}    
      {{ values[value] if value in values.keys() else '{"heatMode":1, "id":1}' }}
    action_topic: "intellicenter-i8ps/state/temps/bodies/1/pool/heatStatus"
    action_template: >-
      {% if value_json.heatStatus.val == 0 %}
        off
      {% elif value_json.heatStatus.val == 4 %}
        heating
      {% elif value_json.heatStatus.val == 8 %}
        cooling
      {% endif %}
    temperature_command_topic: pool/heatsetpoint #REQUIRES AN AUTOMATION - SEE BELOW
    temperature_state_topic: "intellicenter-i8ps/state/temps/bodies/1/pool/heatsetPoint"
    temperature_state_template: "{{ value_json.heatsetPoint }}"

I also have a Pentair Ultratemp that I’m trying to automate. Do you have any updates? Also for your code above on “modes”, would it not be more like?

    modes:
      - "off"
      - "pool"
      - "spa"

I’m working on custom integration for nodejs-PoolController. Right now it does not support cooling as I don’t have that equipment, but I was able to mock something up and should hopefully have it working tomorrow. You can find the repository here (install via HACS): https://github.com/Crewski/njsPC-HA

The heater will have 2 separate climate entities, one for the pool and one for the spa. The modes I think can only be “off”, “heat”, “cool”, “heat_cool”, etc.

1 Like

Thanks. I’m still planning my project… It’s hard to research as everyone has a different set up based on the layout and age of their pool. Here’s my incomplete plan as it stands.

Yep, everything is different and everyone has a different way of going about it. Whenever you finalize stuff, I have updated my custom component to support cooling. So if you decide to use it everything should be working. https://github.com/Crewski/njsPC-HA

I only have a pool (no spa) so mine in much simpler than yours. One question, what’s the need for the two raspberry pis? I only have one, but needed to get a RS485 hat that had two ports on it. Only reason for the two ports is that my Hayward pump and SWG use different baud rates.

Not two Raspberry pi. Two Node-Red units… it handles the RS485 functions where you used the IntelliComm II Interface Adapter. I’m not sure, but looking at the adapter, it seems to interface with only one device?
I know the Intelliflo needs an RS485 adapter, so I am assuming that the UltraTemp unit needs one as well since it too uses RS485 comms. That’s where I can’t find any reliable information. Comms between Raspberry Pi and the UltraTemp.

The RS485 uses a bus topology, so you should only need one port (assuming they both use the same baud rate, typically 9600 I think). It utilizes an address to talk to certain devices. The raspberry pi will be the server and the pool equipment will be clients. Both of your equipment just run to the same RS485 port.

If you use nodejs-PoolController (which I highly recommend, they’ve done an awesome job with it) then you don’t need to use Node-Red or write any of your own code.