[New Addon] Pentair Screenlogic

In order to set the salt level you need to published the following topics to MQTT:

pentair/salt/spa/set
pentair/salt/pool/set

The payload should be a value 0-100.

If you tend to set it to the same levels you can set up scripts in HA to make it easier. You can then create lovelace buttons to trigger the scripts.

script:
  pentair_pool_salt_50:
    sequence:
      - service: mqtt.publish
        data_template:
          topic: pentair/salt/pool/set
          payload: 50
   pentair_spa_salt_50:
    sequence:
      - service: mqtt.publish
        data_template:
          topic: pentair/salt/spa/set
          payload: 50

So I went into my router settings and found that the IP addresses were listed as follows:
Pentair - 10.0.0.x
Hassio - 10.0.0.xx

By changing the values in the Pentair config to the values above, I get the following log errors:

MQTT Log: (which repeats)
1595435999: New client connected from 172.30.32.1 as mosq-w5OFuqqZr6PB18mIbs (p2, c1, k60, u’Pentair’).
1595435999: Client mosq-w5OFuqqZr6PB18mIbs disconnected.

Pentair Log:
Connection error: Connection Refused: not authorised.
Error: The connection was lost.

If I add my normal IP address from my modem, 192.168.1.x, I am able to return the following results:

Pentair Logs:
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
version=POOL: 5.2 Build 738.0 Rel
pool ok=1
pool active=true
pool temp=84
pool settemp=89
pool heatStatuse=0
pool heatStatuse=off
spa active=false
spa temp=86
spa settemp=100
spa heatStatuse=off
salt ppm=3750
pH=0
orp=0
saturation=0
air temp=87
freezeMode=0
alarms=0
Number of circuitArray Objects=7
calcium=0
cyanuric acid=0
alkalinity=0
controller is in celsius=false
controllerId=100
pumpCircArray=70,0,0,0,0,0,0,0
Number of bodyArray Objects=7
bodyArray=
circuitId: 500
name: Mist
circuitId: 501
name: Pool Light
circuitId: 502
name: Aux 2
circuitId: 503
name: Aux 3
circuitId: 505
name: Pool
circuitId: 510
name: Feature 1
circuitId: 511
name: Feature 2
numPumps=1
pumpID 0 watts=720
pumpID 0 rpms=2250
pumpID 0 gpms=50
salt cell installed=false
salt cell satus=129
salt cell level 1=100
salt cell level 2=5
CLOSING CONNECTION
Error: Connection refused
MQTT Client exited with non-zero status

HOWEVER, if I refresh the Pentair Log I get:
Error: Connection refused
MQTT Client exited with non-zero status

The MQTT Logs now show:
[12:55:11] INFO: Setup mosquitto configuration
[12:55:11] INFO: No local user available
[12:55:13] INFO: Initialize Hass.io Add-on services
[12:55:13] INFO: Initialize Home Assistant discovery
[12:55:13] INFO: Start Mosquitto daemon
1595436913: mosquitto version 1.6.3 starting
1595436913: Config loaded from /etc/mosquitto.conf.
1595436913: Loading plugin: /usr/share/mosquitto/auth-plug.so
1595436913: |-- *** auth-plug: startup
1595436913: ├── Username/password checking enabled.
1595436913: ├── TLS-PSK checking enabled.
1595436913: └── Extended authentication not enabled.
1595436913: Opening ipv4 listen socket on port 1883.
1595436913: Opening ipv6 listen socket on port 1883.
1595436913: Opening websockets listen socket on port 1884.
1595436913: Opening ipv4 listen socket on port 8883.
1595436913: Opening ipv6 listen socket on port 8883.
1595436913: Opening websockets listen socket on port 8884.
1595436913: Warning: Mosquitto should not be run as root/administrator.
1595436915: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1595436917: New client connected from 172.30.32.1 as Pentair (p2, c1, k60, u’homeassistant’).

Refreshing the MQTT logs does not change anything.

The only other thing that I can think of would be the MQTT info listed in my yaml.config file which is:

mqtt:
broker: 192.168.1.x
port: 1883
client_id: Pentair
username: xxxxxxxxxxxxx
password: xxxxxxxxxxxx

OTHER NOTES:
I don’t know if it matters but I am somewhat limited on making adjustments to my ISP settings as I am forced to get internet through an AT&T Unlimited iPad Plan via SIM + Netgear Nighthawk M1. Furthermore, I am unable to do any port forwarding whatsoever with this setup due to AT&T restrictions.

Thoughts?

It looks like the IP address you used for the ScreenLogic is working now, but the IP you have for the MQTT broker is not. Try using the 192.168.x.x IP for the MQTT config for the addon

Still getting the following error at the end (after it lists all the values):
CLOSING CONNECTION
Error: Connection refused
MQTT Client exited with non-zero status

Perhaps I’m missing something here on the IP for MQTT. Where exactly am I supposed to locate this address?

Perfect thanks!

It would be the local IP of the machine you have your MQTT server running on.

Great add-on, it is exactly what I needed! But I have a total noob question here! I have everything set up, but I am only seeing one switch and one sensor. The light scripts show up without any issues. Looking at MQTT Explorer and I can see all of the sensors and switches from the add-on. I have everything in my configuration.yaml pointing to sensor.yaml, switch.yaml, and script.yaml with the proper setup in them. It is strange that it is the last sensor and switch in those files are the ones that are showing up in states. If I move them to the my configuration.yaml I get the same issue with the last sensor and switch showing up. Any recommendations on how to fix this?

Hello, I would love to use the bridge you created, However I am not using any containers, I have my HASSIO instance running in virtualbox on my mac, any guidance on how to get started?

Thanks

If you are running HASSIO you should be able to add the repository and install the addon just like any other addon

Actually, I was running ver 1.12 and just upgraded to ver 1.24 and now my switches are not working, any ideas

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
version=POOL: 5.2 Build 738.0 Rel
pool ok=1
pool active=true
pool temp=81
pool settemp=87
pool heatStatuse=0
pool heatStatuse=off
/node_modules/node-screenlogic/messages/SLPoolStatusMessage.js:106
return this.circuitData(SPA_CIRCUIT_ID).state === 1;
^
TypeError: Cannot read property ‘state’ of undefined
at SLPoolStatusMessage.isSpaActive (/node_modules/node-screenlogic/messages/SLPoolStatusMessage.js:106:44)
at UnitConnection. (/node_modules/node-screenlogic/initialize.js:34:43)
at UnitConnection.emit (events.js:315:20)
at UnitConnection.onClientMessage (/node_modules/node-screenlogic/index.js:319:14)
at Socket. (/node_modules/node-screenlogic/index.js:155:15)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)

I really appreciate your help, it appears what is happening is that when i click a switch

The command will be sent to mqtt

2020-08-21 13:26:34 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on pentair/circuit/501/command: ON

But it will never cause the desired effect

Thanks

Sam

It looks like there is an error in the log you posted. Do you have a spa?

Brian

I could really use your help. I do not have a spa. I am no longer getting that error.

Since upgrading I am not able to turn on/off switches, I am no longer getting any error messages from the pentair log, however turning circuits on/off is no longer working from upgrading to latest version.

Sam

please post the full log when you start the addon

My pentair log is currently blank. My mqtt log is has no errors

If the addon log is blank there is something wrong. When you start the addon there is nothing in the log at all?

Where do i find the log file itself - nothing is dispaying on the log in the ui

I turned debug on in for mqtt

2020-08-21 18:05:15 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: online
2020-08-21 18:05:15 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/pooltemp/state
2020-08-21 18:05:15 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/pooltemp/state
2020-08-21 18:05:15 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/airtemp/state
2020-08-21 18:05:15 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/saltppm/state
2020-08-21 18:05:15 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/status: b’online’
2020-08-21 18:05:16 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/circuit/501/state
2020-08-21 18:05:16 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/circuit/502/state
2020-08-21 18:05:16 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/circuit/503/state
2020-08-21 18:05:16 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/circuit/505/state
2020-08-21 18:05:16 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/circuit/500/state
2020-08-21 18:05:16 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to pentair/heater/pool/setpoint/state

When i try and turn my pool light on

:37:12 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on pentair/circuit/501/command: ON

I just refreshed the add-on log again and this is back

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
version=POOL: 5.2 Build 738.0 Rel
pool ok=1
pool active=true
pool temp=85
pool settemp=87
pool heatStatuse=2
pool heatStatuse=heat
/node_modules/node-screenlogic/messages/SLPoolStatusMessage.js:106
return this.circuitData(SPA_CIRCUIT_ID).state === 1;
^
TypeError: Cannot read property ‘state’ of undefined
at SLPoolStatusMessage.isSpaActive (/node_modules/node-screenlogic/messages/SLPoolStatusMessage.js:106:44)
at UnitConnection. (/node_modules/node-screenlogic/initialize.js:34:43)
at UnitConnection.emit (events.js:315:20)
at UnitConnection.onClientMessage (/node_modules/node-screenlogic/index.js:319:14)
at Socket. (/node_modules/node-screenlogic/index.js:155:15)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)

I do not have a spa

Ok, so that error is still happening. I think it is because you don’t have a spa. It is failing at the spot where it tries to get info about the spa. I have made a change and pushed 1.25. Please give it a try.