Comments (9)
FYI from your code snippet - you can, if you want, leave the client connected and react to the events returned instead of just waiting a half-second (setup an "on" for 'circuitStateChanged'
, like the example script does). This will get you both a faster program (the pool equipment returns a response much faster than 500ms) and less overhead waiting on logins to happen again the next time you want to query the pool status or set a circuit.
from node-screenlogic.
I don't know that it matters all that much, honestly. It's possible that someone trying to connect with the ScreenLogic app on their phone or pc would interrupt your app if you held the connection, or maybe they would both work together. In this case I haven't done enough research to answer that, but if it's working for you, feel free to stick with what you have.
from node-screenlogic.
Looks like we need to implement the MSG_POOL_SETHEATSP
message which has query ID 12528 and consists of 3 ints: bodyType
, controllerIndex
, temp
. For the spa it looks like bodyType
is always 1 and controllerIndex
is always 0. The pool's bodyType
is 0. I assume temp
is in whatever temperature units you have the equipment set to.
from node-screenlogic.
Thanks I'm giving it a test this weekend. Really appreciate the guidance.
from node-screenlogic.
Wow. You already implemented. Major thanks. This is great (and I'm learning from what you did). Thanks twice.
from node-screenlogic.
Works! Was able to set the setPoint for both Pool (bodyType 0) and Spa (bodyType 1) by passing a static value. Next, I need to extend this to pass a value from an MQTT message and pass that as the SetPoint variable. It shouldn't be hard.
I also need to refactor my code. Based on your comment above, I'm doing a lot of unnecessary work, connects, etc.
Would this be in line with your recommendation (above)?
function connect(client) {
client.on('loggedIn', function() {
this.setSetPoint(0, 1, 75)
}).on('setPointChanged', function() {
this.getPoolState()
})
client.close();
client.connect();
}
instead of "getPoolState()" I could publish to MQTT directly or any other function I've created.
from node-screenlogic.
Sure. I don't know that the client.close()
needs to be there, but that's up to you. You'd probably want to listen to the 'poolStatus'
event to get the response from getPoolState()
as well. Once you've done all the operations you want to do, that would be the time to close the client.
from node-screenlogic.
@parnic I'm monitoring for and then publishing changes 24x7. Currently, I open and close connection for just about every discrete action. I likely consume a lot more resource on open and closing connections vs the actual work I do.
Is it bad practice to leave a connection open until the app closes? Thanks.
from node-screenlogic.
@pgregg88 So I see you got the setPoint set, but were you able to figure out how to set the Heater to Active/Inactive on a per circuit basis?
from node-screenlogic.
Related Issues (20)
- Unable to set salt level for pool or spa individually HOT 2
- Differentiate the callback event for getScheduleData(0) vs (1) HOT 4
- Schedule Create/Delete is a very long operation (15-20 seconds) HOT 23
- Calling getPumpStatus() is timing out. HOT 4
- SenderID's don't work with an old version of the library ... duh. HOT 3
- History messages HOT 2
- Can Intellibrite "save" and "recall" functionality from the mobile app be leveraged to store and set custom light colors? HOT 12
- Uncaught Exception crashing node-red HOT 13
- ECONNREFUSED on connect HOT 3
- Can you tell if a scheduled event is running or not? HOT 2
- CoolSetpoint on Spa tracks outdoor air temp? HOT 2
- getNumPumps() returns number of available pump slots, not actual number of pumps HOT 8
- feature request: Access "history" data HOT 1
- Integration with nodejs-poolController HOT 54
- Set pump speeds HOT 7
- Unit is found but remote connection is hanging?
- SLSetHeatSetPoint not parsing API response HOT 4
- FEATURE: Set Timeout HOT 4
- Timeout / Parameter Failure on setCircuitAsync HOT 3
- Is UDP Broadcast the same as mdns/dns service discovery? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-screenlogic.