parnic / node-screenlogic

Pentair ScreenLogic Javascript library using Node.JS
https://www.npmjs.com/package/node-screenlogic
MIT License
52 stars 14 forks source link

Get Circuit State (on, off, etc.) #38

Closed Spencer1O1 closed 4 years ago

Spencer1O1 commented 4 years ago

We are trying to get the circuit state of something like the waterfalls so we know if they are on or off. We read all the documentation and couldn't figure out how to do this. Did we miss something or is this impossible?

We tried getCircuitByDeviceId(), but it said the function is not defined. We also tried looking at ...}).on('controllerConfig', function (config) { config.bodyArray[<index of circuit>]..., but it didn't give us the information we need.

parnic commented 4 years ago

This is the PoolStatus message. Inspect circuitArray for the circuit id you want, then look at its state to see if it's on or off.

https://github.com/parnic/node-screenlogic#properties-2

ControllerConfig shows you metadata about the circuits installed in your system, not their current state.