mikemucc / screenlogic-api Goto Github PK
View Code? Open in Web Editor NEWAPI to control a pentair Screenlogic. Built on top of parnic's screenlogic-node library.
License: Apache License 2.0
API to control a pentair Screenlogic. Built on top of parnic's screenlogic-node library.
License: Apache License 2.0
Refactor to use addClient so I'm not constantly opening/closing clients.
Hi, I helped add schedule support to parnic's library but I'm not skilled enough to do it for the UI, can I request the UI side be implemented?
If you need any help figuring out the new commands let me know, i did a fair bit of reverse engineering the protocol.
Thanks in advance!
#parnic/node-screenlogic#24 and ##parnic/node-screenlogic#25 (waiting on merge of the second one)
Break this massive server.js file into smaller files. My node.js skills don't seem to be up to the task as of yet.
When firing up docker container I get the following:
% docker run -e SL_IP_ADDRESS=192.168.1.15 -it pent
Connecting to ScreenLogic at 192.168.1.15 on port 80...
Got Screenlogic IP address and Port from the Environment.
Pool data update interval is 5 seconds.
Express server listening on port 3000
/usr/src/app/server.js:324
poolSpaInfo.controllerConfig.equipPresent.intellichem;
^
TypeError: Cannot read property 'intellichem' of undefined
at UnitConnection.<anonymous> (/usr/src/app/server.js:324:51)
at UnitConnection.emit (events.js:315:20)
at UnitConnection.onClientMessage (/usr/src/app/node_modules/node-screenlogic/index.js:279:14)
at Socket.<anonymous> (/usr/src/app/node_modules/node-screenlogic/index.js:148: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)
Thanks for the great idea and implementation.
I'm very excited and interested in using the Screenlogic API.
Managed to install and run it. Console output attached below at the bottom
However none of the HTTP GET end points is accessible from a browser.
192.168.1.149:82/api/all
I did setup the IP address 192.168.1.149 and port :82 as requested at the description
Help will be greatly appreciated.
Thanks,
Ivan
[email protected] start
node server.js
Finding Screenlogic Units...
Express server listening on port 3000
Found ScreenLogic unit at: 192.168.1.203:80
Poll for full ScreenLogic update at 1671161361740
Logged In...
Pump ID: 0
Pump SenderID: 30
Pump ID: 1
Pump SenderID: 31
Pump ID: 2
Pump SenderID: 32
Pump ID: 3
Pump SenderID: 33
Pump ID: 4
Pump SenderID: 34
Pump ID: 5
Pump SenderID: 35
Pump ID: 6
Pump SenderID: 36
Pump ID: 7
Pump SenderID: 37
Requesting Schedule Type: daily
Schedule SenderID: 50
Requesting Schedule Type: runOnce
Schedule SenderID: 51
Got Version �8POOL: 5.2 Build 733.0 Rel
/home/ivan/screenlogic-api/server.js:316
poolSpaInfo.controllerConfig.equipPresent.heater;
^
TypeError: Cannot read properties of undefined (reading 'heater')
at /home/ivan/screenlogic-api/server.js:316:53
at Array.forEach ()
at UnitConnection. (/home/ivan/screenlogic-api/server.js:314:33)
at UnitConnection.emit (node:events:513:28)
at UnitConnection.onClientMessage (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:385:14)
at UnitConnection.processData (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:175:12)
at Socket. (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:145:13)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
Node.js v18.12.1
I'm getting this response
Cannot GET /api/pool/on
when trying
/api/pool/on
at the same time
/api/all
does work, which means that the IP address and port are correct and the app is running.
Trying this using "Postman" software for Windows 10
HTTP PUT
192.168.1.149:3000/api/pool/on
Payload: none
Getting the response below. Also tried putting payload=1 and also 192.168.1.149:3000/api/pool without the suffix on and put "on" as payload. Every time same response
<title>Error</title>Cannot POST /api/pool/on
I'm thrilled to find this and can hardly wait to dig in. It's been almost a year since I took a crack at learning node.js to get an early version of parnic working.
Are you able to set a custom color now or are the hex values just for rendering the preset color button on a UI? Thanks.
Everything was working fine for a long time and now I'm getting the error below as a response to my HTTP PUT command.
I did not change anything. I did update/upgrade/reboot of the server at 192.168.1.149:3002 after the problem emerged but it didn't help. I see a bunch of errors in the log of the same machine (attached at the very bottom here).
Same machine serves two Screenlogic/Pentairs both responsive at their respective IP addresses.
Here is the situation
192.168.1.149:3002 PUT doesn't work produces the error below
192.168.1.149:3002 GET does work
192.168.1.149:3001 PUT does work
192.168.1.149:3001 GET does work
Pls help
Thanks,
Ivan
PUT http://192.168.1.149:3002/api/circuit/543/1
Error: connect ECONNREFUSED 192.168.1.149:3002
Request Headers
User-Agent: PostmanRuntime/7.29.0
Accept: /
Host: 192.168.1.149:3002
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Oct 29 21:24:11 raspberrypi rc.local[637]: /usr/lib/node_modules/npm/lib/cli.js:35
Oct 29 21:24:11 raspberrypi rc.local[637]: throw err
Oct 29 21:24:11 raspberrypi rc.local[637]: ^
Oct 29 21:24:11 raspberrypi rc.local[637]: TypeError: Class extends value undefined is not a constructor or null
Oct 29 21:24:11 raspberrypi rc.local[637]: at Object. (/usr/lib/node_modules/npm/node_modules/fs-minipass/lib/index.js:136:4)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Module._compile (node:internal/modules/cjs/loader:1256:14)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Module.load (node:internal/modules/cjs/loader:1119:32)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Module._load (node:internal/modules/cjs/loader:960:12)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Module.require (node:internal/modules/cjs/loader:1143:19)
Oct 29 21:24:11 raspberrypi rc.local[637]: at require (node:internal/modules/cjs/helpers:121:18)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Object. (/usr/lib/node_modules/npm/node_modules/cacache/lib/content/read.js:4:13)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Module._compile (node:internal/modules/cjs/loader:1256:14)
Oct 29 21:24:11 raspberrypi rc.local[637]: at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
Oct 29 21:24:11 raspberrypi rc.local[637]: Node.js v18.17.1
Oct 29 21:24:11 raspberrypi rc.local[639]: /usr/lib/node_modules/npm/lib/cli.js:35
Oct 29 21:24:11 raspberrypi rc.local[639]: throw err
Oct 29 21:24:11 raspberrypi rc.local[639]: ^
Oct 29 21:24:11 raspberrypi rc.local[639]: TypeError: Class extends value undefined is not a constructor or null
Oct 29 21:24:11 raspberrypi rc.local[639]: at Object. (/usr/lib/node_modules/npm/node_modules/fs-minipass/lib/index.js:136:4)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Module._compile (node:internal/modules/cjs/loader:1256:14)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Module.load (node:internal/modules/cjs/loader:1119:32)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Module._load (node:internal/modules/cjs/loader:960:12)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Module.require (node:internal/modules/cjs/loader:1143:19)
Oct 29 21:24:11 raspberrypi rc.local[639]: at require (node:internal/modules/cjs/helpers:121:18)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Object. (/usr/lib/node_modules/npm/node_modules/cacache/lib/content/read.js:4:13)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Module._compile (node:internal/modules/cjs/loader:1256:14)
Oct 29 21:24:11 raspberrypi rc.local[639]: at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
Oct 29 21:24:11 raspberrypi rc.local[639]: Node.js v18.17.1
@parnic has release version 2 of the node-screenlogic library.
At some point this API needs to be ported to use that version of the library.
Need to add Swagger to this so it's self-documenting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.