Giter Site home page Giter Site logo

mikemucc / screenlogic-api Goto Github PK

View Code? Open in Web Editor NEW
9.0 5.0 2.0 251 KB

API to control a pentair Screenlogic. Built on top of parnic's screenlogic-node library.

License: Apache License 2.0

JavaScript 98.47% Dockerfile 0.71% Shell 0.82%
pentair screenlogic nodejs expressjs expressjs-api pool spa

screenlogic-api's People

Contributors

bhlowe avatar dependabot[bot] avatar mikemucc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

screenlogic-api's Issues

Schedule Support Request

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)

Intellichem not present?

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)

Please help

@mikemucc

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

Cannot GET /api/pool/on

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.

Can't start the pool by PUT command

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

Are you actually able to set a customer color by passing in a hex value?

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.

Getting error ECONNREFUSED

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

Add Swagger

Need to add Swagger to this so it's self-documenting.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.