tagyoureit / nodejs-poolController

An application to control pool equipment from various manufacturers.
GNU Affero General Public License v3.0
326 stars 95 forks source link

Next build 909 mqtt.json, alt and original block chemcontroller data #263

Closed miamijerry closed 3 years ago

miamijerry commented 3 years ago

Updated to next build 909, and lost chemcontroller data by mqtt,

Tried all three mqtt.json files; (mqttAlt.json, and mqttoriginal.json) and these each block the chemcontroller data. (PH level and setpoint, ORP level and setpoint, etc)

Used the modified mqtt.json I had from earlier build (attached), and the chemconroller communication works again.

mqttoriginal.json gives me 191 mqtt items attached mqtt.json gives me 348 mqtt items

mqtt.zip

tagyoureit commented 3 years ago

Did you upgrade from master to next?

miamijerry commented 3 years ago

Was previously on working "Next" version dated 1-7-2021, before experiencing this issue. But every time I re-install, I start with Master.

Then "git branch -r" and "git checkout next"

tagyoureit commented 3 years ago

Sounds like you might not be on the latest version. You don't need to reinstall everything. If you are on the next branch you only need to do git pull followed by npm run build. The bundled mqtt.json should work with the currently published branch. Because you went back to an older version and it worked it makes me believe you aren't on the latest...

miamijerry commented 3 years ago

Same result only 191 mqtt items found.

git pull says "Up to date". git reflog show install at be35d9a

reflog

tagyoureit commented 3 years ago

Are there actual items missing? We moved a lot of data/topics around and so if you had the old mqtt.json + the new mqtt.json you would have old data mixed in with new data. What's missing that you are expecting to be there?

miamijerry commented 3 years ago

348 - 191 = 157 missing mqtt items,

most missed are ph level, ph setpoint, orp level, and orp setpoint.

maybe I can create a list??

miamijerry commented 3 years ago

I am clearing the database between runs of poolController build 909. One with the normal mqtt.json found in 909 and then again with the mqtt.json from build 905

Build 905 mqtt json in build 909 MQTT Topics with chemcontroller items.txt Build 909 MQTT Topics missing chemcontroller levels and setpoints.txt

rstrouse commented 3 years ago

I assume you mean you are pruning the tree in mqtt explorer. I don't have IntelliChem but I do have a REM Chem device defined that uses the same chemistry controller structures. Here are the steps I took to try to duplicate your issue. I have both the mqttAlt.json and mqtt.json interfaces defined in the config.json.

  1. Stopped njspc then pruned both topics from mqtt explorer. image
  2. I then restarted njspc and gave it some time to finish initializing. Two new topics showed up in MQTT explorer with all the relevant items attached to the pool image
  3. Drilling down on the topic from mqtt.json here is the structure. image
  4. Drilling down on the topic from mqttAlt.json here is the structure. image
miamijerry commented 3 years ago

I am using mcsMQTT a homeseer automation MQTT broker plugin.

I clear the database of previously received topics in mcsMQTT, upgrade poolController Next to the latest, and then copy the list of topics found from the SQlite database to a txt file for you.

Let me try MQTT Explorer... With build 909 mqtt.json (or mqttALT or mqttoriginal) 909 mqtt json

and with the mqtt.json from build 905 905 mqtt json

miamijerry commented 3 years ago

Reinstalled poolcontroller from nothing again, same problem with the later mqtt.json files...

rstrouse commented 3 years ago

That is so very strange. There aren't even units on the temps object. Do you see any errors in the njspc console?

miamijerry commented 3 years ago

build 905 mqtt json console silly.txt build 909 mqtt json console silly.txt

miamijerry commented 3 years ago

I was able to get the 909 build mqtt.json to provide orp and ph data by making the attached mqtt edits...

Edits to 909 mqtt json to get PH and ORP working.docx 909 mqtt json items which appear to have a period that prevents data.txt

rstrouse commented 3 years ago

This is insightful. Can I get you to run a replay on your njspc. The issue is likely because of structural differences between IntelliChem and REMChem. If what I suspect is true this will be a pretty short fix. There is a difference with the REM devices as the probes report at a higher frequency regardless of whether a dose is being calculated. The difference between data.pHLevel and data.ph.level is exactly that difference.

For IntelliChem I assume there should be no differentiation since I believe it only reports the probe data when it is eligible to dose. This is when there are no lockouts, no alerts, and it has a reported flow.

miamijerry commented 3 years ago

dumb it down for me...

Replay instructions? Does it matter which mqtt.json I use?

rstrouse commented 3 years ago

Doesn't matter which json file you use. If you are using dashPanel simply click on the burger menu on the upper right, choose the capture replay button. A screen will come up with an option to capture the reload of the configuration and simply press the begin capture and it will interrogate your system. image

After the system goes back to ready in the upper right then press the cancel capture button and it will download a zip file to your browser. Upload that zip file here. image

There is a similar function in webClient.

miamijerry commented 3 years ago

replay (1).zip

rstrouse commented 3 years ago

Ok so I went through the MQTT publish code and cleaned a few things up. Before I post this up can I get a copy of all of the mqtt json files you are using. There is clearly a publish in at least one of them where the alarms data is getting written incorrectly.

miamijerry commented 3 years ago

905mqtt.zip 909.zip

rstrouse commented 3 years ago

Grab a new njspc. I made several mods to the mqtt processing.

miamijerry commented 3 years ago

Solid, thank you