rstrouse / nodejs-poolController-dashPanel

A dashboard panel for tagyoureit/nodejs-poolController
38 stars 20 forks source link

Problems with Nixie to control only Intellichlor #52

Closed mzuniga51 closed 2 years ago

mzuniga51 commented 2 years ago

So I have implemented another instance of njsPC apart from the one for my Intellicenter, in order to control my second Intellichlor. I'm having the following issues:

-Chlorine percentage sometimes appear as zero although the set point is currently in 16%. Sometimes 16% does appear but it randomly disappears.
-Schedules are not working. I need Pool to be on all the time for the cell to be controlled per tagyoureit's advice but schedules don't seem to take. I have tried 3:00 am to 2:59 and also two schedules of 12 hours. In both cases I have tried from hour to hour as well as from hour to hour minus 1 min. -This is not a problem with njsPC per se but also I can't seem to make the two instances of njsPC to be seen by Influx. Both are correctly configured (at least are configured exactly the same) and I get info on the Intellicenter but not on the Nixie. Any thoughts will be appreciated.

Here is the logging packet. Thanks! replay.zip

rstrouse commented 2 years ago

Ok so it looks like you do not have any comms on the RS485 port. There appears to not be an RS485 adapter at 192.168.68.173:9811

rstrouse commented 2 years ago

If you want the aux njsPC to turn on the circuit whenever the circuit changes in the IntelliCenter njsPC then there are a couple of easy steps to make this happen.

  1. Shut down the IntelliCenter copy of njsPC
  2. Rename the file included in this post to njsPCAux.json
  3. Copy the renamed file to the web/bindings directory
  4. Open the config.json file located in the root of the IntelliCenter nodejs-PoolController directory
  5. Scroll down to interfaces section and insert the following json just after the line "interfaces: { please make sure you include the comma at the end of the njsPCAux section.
      "njsPCAux": {
        "name": "njsPC Aux Controller",
        "type": "rest",
        "fileName": "njsPCAux.json",
        "enabled": false,
        "options": {
          "host": "",
          "port": 4200,
          "path": "",
          "protocol": "http://"
        },
        "uuid": "7219E27B-6D19-42A6-9A82-03FA9884BF26"
      },

Now that you have installed the interface you can configure it from the config pages Controller Tab > Interfaces Tab. First put in the ip address of your njsPC instance where the IntelliChlor is installed and check the enabled box. Finally, press the Save Interface button. njsPCAux.json.txt

mzuniga51 commented 2 years ago

Thank you Robert. I have implemented your solution and works like a charm. Many thanks.

Is there any way at all to see the second Intellichlor on the Intellicenter dashPanel?

All the best!

MZ

On Tue, Mar 8, 2022 at 10:26 AM rstrouse @.***> wrote:

If you want the aux njsPC to turn on the circuit whenever the circuit changes in the IntelliCenter njsPC then there are a couple of easy steps to make this happen.

  1. Shut down the IntelliCenter copy of njsPC
  2. Rename the file included in this post to njsPCAux.json
  3. Copy the renamed file to the web/bindings directory
  4. Open the config.json file located in the root of the IntelliCenter nodejs-PoolController directory
  5. Scroll down to interfaces section and insert the following json just after the line "interfaces: { please make sure you include the comma at the end of the njsPCAux section.

    "njsPCAux": { "name": "njsPC Aux Controller", "type": "rest", "fileName": "njsPCAux.json", "enabled": false, "options": { "host": "", "port": 4200, "path": "", "protocol": "http://" }, "uuid": "7219E27B-6D19-42A6-9A82-03FA9884BF26" },

Now that you have installed the interface you can configure it from the config pages Controller Tab > Interfaces Tab. First put in the ip address of your njsPC instance where the IntelliChlor is installed and check the enabled box. Finally, press the Save Interface button. njsPCAux.json.txt https://github.com/rstrouse/nodejs-poolController-dashPanel/files/8207898/njsPCAux.json.txt

— Reply to this email directly, view it on GitHub https://github.com/rstrouse/nodejs-poolController-dashPanel/issues/52#issuecomment-1061961973, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2HSS6DPCKGDRJTNKNFLMLU655S3ANCNFSM5QBVR23Q . You are receiving this because you authored the thread.Message ID: @.***>

rstrouse commented 2 years ago

Let me stew that around a bit

rstrouse commented 2 years ago

Which body has the spare IntelliChlor. I assume it is the spa body (body 2) is that correct?

mzuniga51 commented 2 years ago

It is actually the Pool (body 1). My thought was that the spa would benefit more from a potential automation through the Intellichem as the need for chlorine would fluctuate more. Not the case in the end, but it is still there.

On Sun, Mar 13, 2022 at 2:39 PM rstrouse @.***> wrote:

Which body has the spare IntelliChlor. I assume it is the spa body (body 2) is that correct?

— Reply to this email directly, view it on GitHub https://github.com/rstrouse/nodejs-poolController-dashPanel/issues/52#issuecomment-1066178049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2HSS6S7JH7HLMPWOX3RNDU7ZN77ANCNFSM5QBVR23Q . You are receiving this because you authored the thread.Message ID: @.***>

rstrouse commented 2 years ago

Ok so here is what I want you to do. First shut down both instances of njsPC. Then do a git pull and npm i for both of them.

  1. On the IntelliCenter instance of nsjPC I would like you to rename the file below to njsPCAux.json then copy it to the web/bindings directory. This should overwrite the existing file there. njsPCAux.json.txt
  2. Copy the file below to the 'web/bindings` directory for the Nixie instance of njsPC njsPCMaster.json.txt
  3. Open the config.json for the Nixie instance and add the following to the interfaces section
      "njsPCMaster": {
        "name": "njsPC Master Controller",
        "type": "rest",
        "fileName": "njsPCMaster.json",
        "enabled": false,
        "options": {
          "host": "",
          "port": 4200,
          "path": "",
          "protocol": "http://"
        },
        "uuid": "98517B8C-320A-42F1-8737-E263E34D9209"
      },
  4. Restart both instances of njsPC and navigate to the Interfaces tab in dashPanel for the Nixie instance. Enable the njsPC Master Controller interface and set the ip address for the IntelliCenter njsPC.

After you do this it may take a little bit of time but it will add another Chlorinator into your IntelliCenter dashPanel with the information from the Nixie instance.

rstrouse commented 2 years ago

Oh also update dashPanel for both of these.

mzuniga51 commented 2 years ago

Amazing. Do you want me to update afterwards?

On Sun, Mar 13, 2022 at 3:17 PM rstrouse @.***> wrote:

Oh also update dashPanel for both of these.

— Reply to this email directly, view it on GitHub https://github.com/rstrouse/nodejs-poolController-dashPanel/issues/52#issuecomment-1066183760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2HSS5CWVBHTBK6HV6VVLDU7ZSQZANCNFSM5QBVR23Q . You are receiving this because you authored the thread.Message ID: @.***>

rstrouse commented 2 years ago

I want you to update the software right away. Then update me on your results after you do it.

mzuniga51 commented 2 years ago

I'm trying to implement your solution but I hit a snag with my Elfin adapter. I guess you are not even using an Elfin but I trust on your amazing knowledge to this stuff so I want to describe what's happening and see if you can think of something other than the adapter being corrupted. So this has happened to me a few times: I configure the adapter to work with the nixie and the cell, exact same configuration than the other adapter that works perfectly fine, and everything goes correctly for a day or two. After that, the adapter suddenly get stuck with no traffic being received and all outbound traffic with errors. When that happens I can't also access the adapter neither through its assigned IP nor through direct wifi connection to the device. Then no matter how many times I reset the device or leave it disconnected for hours nothing happens. The "solution" I have found is to factory reset the device. Also I have found that if I break the physical connection between the cell and the adapter by disconnecting the wires it eventually start responding again. This makes me doubt that the device has gone completely bad but its firmware might be corrupt somehow.

Now, I also don't have REM active since I have no relays in my auxiliary instance. Would that might have to do with the problem at all? Any other things you could think so that could be causing this behavior? Otherwise I'll might have to hit Amazon again. The adapter is fortunately cheap but I'll have two wait almost two weeks to be delivered here in Costa Rica.

rstrouse commented 2 years ago

REM does not communicate on RS485 or with the Elfin adapter. However, my reaction to a hang up on a device that communicates with TCP is that another device on your network is trying to use its IP address. I had a situation would take down one of my home automation hubs. This happened every time one of my in-laws would visit. Turns out they had a laptop with a static IP address that would choose the hub as a deadlock. Since the hub was based upon a router design (both server and client) it would engage in shenanigans until it stopped working.

I assume you made a DHCP reservation for that Elin adapter in your router. Also, since this device is also a server double check the settings to make sure it does not have its own DHCP server enabled. Most of the time these devices use router firmware to control their comms so it come with access point and sever modes that allow clients to connect to them directly. Do not assign a static IP to it rather use a reservation in your main router so that your router can control the handing out of these IP addresses. You should do this for every device that is not a guest on your network.

The other thing that can cause hardware like this to go stupid is power. Low power can affect communication timing and given the sophistication of the device, I can't imagine there is any power conditioning on it.

mzuniga51 commented 2 years ago

So, I have managed to somewhat stabilize the adapter. I changed my power source from a wart wall to the RS485 bus in the main Intellicenter. Also I disable dhcp and managed the adapter to take another IP. The former one was reserved and not fixed but who knows if my modem was making a mess for some reason.

I run the files you suggested and bam, there there is the aux intellichlor appearing in the main dashPanel. So success on that. I can also change the auxiliary cell set point from the main dashPanel. Now, what I'm still missing is the salt ppm and chlorine output percentage. Apparently the main dash is not getting that info yet. I have yet to change the names to make it more legible but the second intellichlor instance is the auxiliary one. Please see image.

Screen Shot 2022-03-15 at 17 16 02

.

rstrouse commented 2 years ago

You must first get the other IntelliChlor to report the salt level. This only happens when it is started and starts generating. Btw you can rename the IntelliChlor so you can tell them apart.

EDIT: Turn the circuit off wait a good 10 seconds then fire it back up.

mzuniga51 commented 2 years ago

Actually, the aux IntelliChlor is in fact reporting salt and percentage, but it is not reporting those levels on the other side. I already turn off the circuits off and on. Also reset both instances but is not happening yet

Screen Shot 2022-03-15 at 18 03 17 Screen Shot 2022-03-15 at 18 03 23

.

rstrouse commented 2 years ago

Did you do a hard reset on dashPanel to clear the cache?

mzuniga51 commented 2 years ago

I did. Nothing yet

rstrouse commented 2 years ago

Are you sure you updated both dashPanels and both njsPCs?

mzuniga51 commented 2 years ago

Sorry, it though you said update dashPanel only. Done and working. Thanks a lot.

A couple of additional points that I have discovered: -I'm not able to activate trigger superchlorination for either of the IntelliChlors. The button appear but does nothing. I don't know it should work or not.
-I'm connecting njsPC to Influx Cloud and Grafana Cloud. It works beautifully. Only thing is I had to modify influxinterfaces.ts (line 36) to eliminate the : between the URL and the port. Influx Cloud does not require a port and will return an error if the : is maintained so it would be good to have that option or create a separate integration for Influx Cloud. Maybe this is more in tagyoureit's domain.

rstrouse commented 2 years ago

I traced through the code and the only way this doesn't work is that either of the njsPC instances are not up to date. Shut them both down again and run. cd ~/nodejs-poolController git pull npm i

then restart them both.

mzuniga51 commented 2 years ago

I was super careful this time. Shut down njsPC and dashPanel (both instances). Ran git pull and npm I and restarted. Tried to empty caches. Tried on another browser I had not used before. Nothing. Here is a capture replay.zip .

rstrouse commented 2 years ago

I will look at it tomorrow. I believe it should trim the : off if there is no port.

mzuniga51 commented 2 years ago

Yep. Thats what i did and works ok. Thanks again Robert.

On Tue, Mar 15, 2022 at 7:17 PM rstrouse @.***> wrote:

I will look at it tomorrow. I believe it should trim the : off if there is no port.

— Reply to this email directly, view it on GitHub https://github.com/rstrouse/nodejs-poolController-dashPanel/issues/52#issuecomment-1068626653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2HSS4N4ORU7OUQUXUFTVTVAEZBLANCNFSM5QBVR23Q . You are receiving this because you authored the thread.Message ID: @.***>

rstrouse commented 2 years ago

Ok pull njsPC for both. I fixed the reset for superChlor but I do not have a scenario to allow two chlorinators like this so it is a bit of a shot in the dark. I also fixed the port setting for InfluxDB.

mzuniga51 commented 2 years ago

Thank you . I can super chlorinate from dashPanel on my main cell. Unfortunately, my aux Elfin adapter finally fail completely so I don't know if I can super chlorinate the aux cell. I'll let you know as soon as I get it from Amazon.RS

Just a final question. I understand the RS485 protocol is bidirectional. I would love to be able to clear the CO2 limit in my Intellichems (as in how much is the maximum CO2 applied in a 24 h period) as well as manually dose whenever it is needed. The screen that allows you to do that on Intellichem looks like the image below. Would there be a way to do that? Even a way to take full control of all Intellichems menus? I know it is a stretch but I know you are quite resourceful and curious. If it is at all possible and it is something you would like to work with me I'll open another issue. IMG_2357

rstrouse commented 2 years ago

I wish I had better news for you but IntelliChem only allows changing setpoints and tank levels from automation.

mzuniga51 commented 2 years ago

Well, it is what it is. Thank you for al, the help and i'm closing the issue.