Pentair ScreenLogic

The pool controller runnjng node.js.

Awesome work here guys. I got the nodejs-poolcontroller working (using that $8 USB-RS485 dongle connected to my ScreenLogic2 wireless controller running on Ubuntu).

Trying to start up the nodejs-poolcontroller with the modified config.json and having issues with the outputToSmartThings.js script - it’s clearly looking for config.json items that aren’t there (e.g. poolController.https.enabled). I’ve added the missing items to have it choose ‘http’ but not sure what to put for expressPort?

if (configFile.poolController.https.enabled) {
    serverURL = 'https://localhost:' + configFile.poolController.https.expressPort
    secureTransport = true
} else {
    serverURL = 'http://localhost:' + configFile.poolController.http.expressPort
    secureTransport = false
}

@bradsileo, I currently have all Pentair equipment, but controlled by a Hayward Prologic 8 system. Is there any way to put your system to work on my pool? I followed the Gitter link, but there’s a bit too much for me to swallow, so thought I would ask here. Is there a link somewhere that explains the controller in newbie speak? :slight_smile:

You need to be able to have the nodejs-poolcontroller run against your controller for this SmartThings device to operate. So the question would be if that can run in your environment but I think no because it is not compatible with the Hayward controller as far as I know.

I think the default settings will work there. This is normally port 3000.

Seems you made some recent commits. I updated but none seemed to have helped. I updated the code so that the io.connect call uses http://localhost:3000 and as far as I can tell (added a few log messages) it’s integrated with nodejs-poolcontroller and getting events and attempting to relay those to my ST Hub. However, the ST app is not able to complete configuration as it’s now stuck at the ‘searching’ for UPnP devices. From my phone I can open the webpage from NodeJS and that seems to work fine so I think it must have something to do with the ST App (device/handler) that isn’t working right for me. I haven’t looked into creating a ST app yet so the code seems a bit cryptic to me.

Any help/insight you could provide would be useful. Also - any chance you could update your example-config.json so I can make sure I’m not doing something stupid there?

Thanks
Eric

I made a few updates there which might be the root of your problem? This is the relevant change:

          "socketISY": 0,
          "outputSocketToConsoleExample": 0,
		  "outputToSmartThings":1
          }
		  
         "outputToSmartThings": {
		"address": "*", (Address of the HUB is dynamically detected)
		"port": "39500"
	    }

That said I still think something lower level is wrong, as the problem in finding your poolController via SSDP should be able to occur regardless. To be certain, are you using the latest 4.x-DEV code in your poolController? Things will not work if you just took the code from the master.

Thank you! I missed the 4.x branch in the instructions.

It all appears to be working now - thank you very much!

I still have some customization that I need to do - update the icons and remove the unused AUX circuits but it looks like it’s working really well.

Also - most things seem to be working through Google Home too if you give them nicknames within Google Home (otherwise Google is confused since everything starts with “Pool” and the names are in parenthesis and not normally very voice-friendly).

1 Like

would you be kindly able to walk me through th installation of the node.js step by step. this a great integration thanks in advance

can you please advise, if I connect the serial connection to the USB port on my server machine, that means I will not be able to connect to the Pentair protocol device that hooks up to the modem? so I will not be able then to use the screenlogic app correct?

You can use both at the same time as it is possible to connect multiple devices to the Rs-485 bus. You do this by running separate cables to the main Pentair box.

Please see the instructions published with the Nodjs-poolcontroller and follow those to get going. Once that is up and running you can install the Smarthings SmartApp and devices to provide control within the ST environment.

thank you
I have installed the node server
I am able to control the pool via bootstrab ip_address:3000 for a few seconds then I get the following message and it stops working
FTDI chip adapter on COM4

21:24:13.639 ERROR Error opening port: Opening COM4: Access denied. Will retry in 10 seconds
Unhandled rejection TypeError: Cannot read property ‘toJSON’ of null
at Object.push (C:\Users\ragai\pool\src\lib\comms\inbound\packet-buffer.js:30:30)
at SerialPort. (C:\Users\ragai\pool\src\lib\comms\sp-helper.js:74:44)
at emitNone (events.js:106:13)
at SerialPort.emit (events.js:208:7)
at emitReadable_ (_stream_readable.js:513:10)
at emitReadable (_stream_readable.js:507:7)
at addChunk (_stream_readable.js:274:7)
at readableAddChunk (_stream_readable.js:250:11)
at SerialPort.Readable.push (_stream_readable.js:208:10)
at binding.read.then (C:\Users\ragai\pool\node_modules\serialport\lib\serialport.js:374:10)
at tryCatcher (C:\Users\ragai\pool\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\ragai\pool\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\Users\ragai\pool\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\ragai\pool\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\ragai\pool\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (C:\Users\ragai\pool\node_modules\bluebird\js\release\async.js:133:16)

21:24:23.637 ERROR Error opening port: Opening COM4: Access denied. Will retry in 10 seconds
21:24:33.639 ERROR Error opening port: Opening COM4: Access denied. Will retry in 10 seconds

please help thanks

I am not familiar with that error. Best bet is to go to the Gutter group for nodejs pool controller to look for help. Lots of knoedge there.

I think I figured it out. I connected the FTDI adapter to the wireless receiver not directly to the panel, once I changed that and connected the FTDI adapter to the Pentair Panel I am not getting that error.
Now to the fun part. Brad I saw the modification that need to be added to the config file, where exactly do you insert those mods? do I have to remove “(Address of the HUB is dynamically detected)” from the code. and should I leave the * where the hub address line is?
Thanks for your help

“socketISY”: 0,
“outputSocketToConsoleExample”: 0,
“outputToSmartThings”:1
}

     "outputToSmartThings": {
	"address": "*", (Address of the HUB is dynamically detected)
	"port": "39500"
    }

Yes remove that comment and yes leave the star. It will locate this with SSDP protocol.

thank you and sorry to keep bugging you
I am able to run the server from the boostrab and control the pool
I followed the directions to add integration to ST but with no luck. ( I updated the integration folder in pool_controller, then added the lines in the config file). I am getting the following error when I run the server
13:39:00.169 INFO Virtual chlorinator controller not starting because it is set to default and another controller (Intellitouch/Intellicom) is present.
13:39:00.527 ERROR uncaughtException: configurationFileContent is not a function
{“date”:“Sat May 26 2018 13:39:00 GMT-0400 (Eastern Daylight Time)”,“process”:{“pid”:4480,“uid”:null,“gid”:null,“cwd”:“C:\Users\ragai\pool”,“execPath”:“C:\Program Files\nodejs\node.exe”,“version”:“v8.9.4”,“argv”:[“C:\Program Files\nodejs\node.exe”,“C:\Users\ragai\pool\src\index.js”],“memoryUsage”:{“rss”:51515392,“heapTotal”:36855808,“heapUsed”:21107728,“external”:966755}},“os”:{“loadavg”:[0,0,0],“uptime”:12733.2218544},“trace”:[{“column”:40,“file”:“C:\Users\ragai\pool\src\etc\settings.js”,“function”:“Object.getConfig”,“line”:611,“method”:“getConfig”,“native”:false},{“column”:41,“file”:“C:\Users\ragai\pool\src\integrations\outputToSmartThings.js”,“function”:“GenericProvider.module.exports [as $get]”,“line”:5,“method”:“exports [as $get]”,“native”:false},{“column”:89,“file”:“C:\Users\ragai\pool\node_modules\bottlejs\dist\bottle.js”,“function”:“Object.getService [as outputToSmartThings]”,“line”:205,“method”:“getService [as outputToSmartThings]”,“native”:false},{“column”:33,“file”:“C:\Users\ragai\pool\src\etc\integrations.js”,“function”:null,“line”:71,“method”:null,“native”:false},{“column”:17,“file”:“C:\Users\ragai\pool\src\etc\integrations.js”,“function”:null,“line”:45,“method”:null,“native”:false},{“column”:null,“file”:null,“function”:“Array.forEach”,“line”:null,“method”:“forEach”,“native”:false},{“column”:15,“file”:“C:\Users\ragai\pool\src\etc\integrations.js”,“function”:null,“line”:41,“method”:null,“native”:false},{“column”:15,“file”:“fs.js”,“function”:“FSReqWrap.oncomplete”,“line”:135,“method”:“oncomplete”,“native”:false}],“stack”:[“TypeError: configurationFileContent is not a function”," at Object.getConfig (C:\Users\ragai\pool\src\etc\settings.js:611:40)"," at GenericProvider.module.exports [as $get] (C:\Users\ragai\pool\src\integrations\outputToSmartThings.js:5:41)"," at Object.getService [as outputToSmartThings] (C:\Users\ragai\pool\node_modules\bottlejs\dist\bottle.js:205:89)"," at C:\Users\ragai\pool\src\etc\integrations.js:71:33"," at C:\Users\ragai\pool\src\etc\integrations.js:45:17"," at Array.forEach ()"," at C:\Users\ragai\pool\src\etc\integrations.js:41:15"," at FSReqWrap.oncomplete (fs.js:135:15)"]}
nodejs-poolController has closed successfully.

please help, I truly appreciate it

Hi I am trying to get the integration to work but running into trouble as mentioned in the above post. Do you think you can help me? Greatly appreciate it

I do not know what is the specific cause of that error but it looks like a problem with the contents of the config file. Best place for this type of help will be on https://gitter.im/nodejs-poolController/Lobby