Closed tagyoureit closed 1 year ago
Hey, I'm real close. Curiosity got the best of me and I got proficient at using Wireshark to help decode some more packets. I couldn't just leave the configuration side alone so I've been adding a few more API's (get circuit name, set circuit names, and more). I've also decoded quite a bit more of the Equipment Configuration packet (12566) and the final part is setting the equipment configuration (12568) back to the controller
Awesome, sounds super useful!
Can you give the latest code a try? Specifically the "set equipment" message. Pull both njsPC and the new node-screenlogic code with the method I outlined above (https://github.com/parnic/node-screenlogic/issues/61#issuecomment-1356326406)
I have it set so it's not actually wired up to change anything on the OCP, yet. I just have a flag set because I don't want to mess anything up due to a lack of testing. (See below.)
If you startup the app with the DEBUG=sl*
you will see the same types of debug code that you previously used.
The following are the items which can be set via ScreenLogic and the config packet. Some of them we don't really handle today in njsPC and I'll note that below:
When you run the code you'll see the debug statements as below. It is indicating which bit in which array is changing.
sl:unit Difference at miscData[4]. prev: 0 (00000000)-> new: 1 (00000001) +0ms
If/when you want to try changing actual values, do the following:
let ready=false;
to be true
; This will send the command to the screenlogic unit. (This file is the compiled version.)lmk if you have any questions.
I think we're all set here? Let me know if that's not the case.
Hey @parnic! This is long overdue, but I'm finally at a place where I can integrate direct Screenlogic control into nodejs-poolController. I've been wanting to dig into this for quite a while.
To that end, I've gone through and converted all of your code to Typescript + Promises. It still supports the events, too. I've published this up to my repo at https://github.com/tagyoureit/node-screenlogic/tree/typescript. I've changed quite a bit (event names, data structure, return values, etc etc). I can keep this as a separate repo if that makes more sense. I haven't updated the docs yet but the example.ts shows how to use all of the methods.
First question is whether or not you are ok with moving to Typescript + Promises or you would rather keep the plain 'ole Javascript.
Second question is do you have any bandwidth to flush out more of the commands?
I'll also be able to help debugging/decoding many of the other aspects as I've got in-depth knowledge of how the RS485 packets work.
I've got a short list of items that I've compiled so far, but haven't gone through everything to validate it yet. Need to put it through a fine tooth comb.