tagyoureit / nodejs-poolController

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

Intellicenter Messages #116

Closed rstrouse closed 4 years ago

rstrouse commented 5 years ago

Tag,

Here are the files from the capture. replay.zip

theRealMCQwerty commented 4 years ago

@rstrouse Good news is that fixed it and I am now able to see the gear icon and view the valves. image

As you can see I assigned the valves to featue circuits so I could attempt to control them from the home screen.

Unfortunately toggling the feature circuits assigned to these 'extra' valves does nothing, no movement of the connected IntelliValves 😢 😞 As you can see from the screenshot I tried a combination of Standard and IntelliValve but neither made a difference.

Are we sunk on this one or do you have other genius plans? 😄

Regarding this:

On another note I went out and hooked up a valve last weekend to start trying out various messages to see if I can get it to talk back. While I have managed to get the valve to echo, I can't seem to assign an id to it yet.

I doubt there is anything i can help with now that you have your valves hooked up but let me know if there is. According to a pretty reliable source in this thread, Pentair don't even plan on starting work on the promised firmware update to control IntelliValves until Q2 2021!!! So at this rate the IC will be obsolete before they actually give us full control of their expensive valve actuators! 😠

rstrouse commented 4 years ago

Bummer. I was afraid of that. This is probably a physical hardware limitation. Any suggestions on your end? My next plan of action will be to send random messages to the valves to see if I get any response. A long shot for sure.

Reading the TFP post it amazes me regarding the product roadmap. Wanna bet the called out enhancement for circuit grouping is the notion of on/off/ignore for the related circuits (ix+3). The IntelliCenter firmware needs some love and so did all of the prior Touch firmware. But it was stable enough to operate a pool. That being said as a user of both systems the IntelliCenter is at least at the level of IntelliTouch + ScreenLogic. Where it blows past it is that the warts can actually be healed. That my friend is the promise and if I went through all the issues with Touch, IntelliCenter would still come out on top.

The crazy part is that the focus seems to be on things outside of the core. For instance, if you let the mobile controller sit in its cradle it won't be available to operate the pool for minutes when you first wake it up (red dot). Gonna get in the pool.. walk by pick it up and tap the screen. Come back later to turn on the waterfall. This was not the experience for MobileTouch but then again it didn't cost $1,500 and require a $500 battery change every 2 years.

Schedules on the pool circuit override the heater settings even when you have it set to Don't Change. The work around is to set it to Solar and increase the temperature so it doesn't run the solar at 78 all week. In my area that means frigid pool for a 100 degree day. There's a bunch of little things like that. Even the expansion of the macros and IntelliValve support should take a back seat to making what is there solid.

These things are firmware related and directly related to the pool operation. Those other things have a dependency on said firmware. Besides, you know that cabinet in everybody's house where electronics get abandoned? I wonder how often Alexa ends up there to lord over the original XBox and the DVD player. It can only answer what a fox says so many times until the novelty wears off. If you dig deep enough in there you might find even a 4head Hi-Fi VCR.

In the end there are two things that Pentair will always be chasing but won't keep locked up for longer than 12 months at a time. This will be the Amazon Skill and their hosting platform. Their mobile apps and web mirror the stability of the hosting platform. If they venture into HA it will be three things.

I can see a world where IntelliCenter will still be in the wild and these other things will go the direction of AOL, Compuserve, and MySpace. The current life cycle is one where it goes to a paid subscription model to satisfy the investors for the cash infusion, then it will simply fade away.

In the end, I wish they would focus in finishing out the functions in the firmware. The other things need not be abandoned but they shouldn't be the cornerstone either. It should have at least the lifespan of an Intermatic timer. The special place where things like this go to retire are in the garage attic to lord over the holiday decorations.

rstrouse commented 4 years ago

Btw I read through the TFP thread and I am going to fix the schedule issue this weekend by editing the config through dashPanel. I didn't realize that while it was changing the data on the web it wasn't reflecting it to the OCP correctly. I suppose I should try it using the thousands of dollars I spent on control panels before I assume it is a firmware issue. I almost exclusively use dashPanel to control the pool and when I get time I throw a new function into it. When there is something I haven't coded, I use the web or mobile client. I suppose I should have learned this from the issues with the light groups.

Schedule edits just got a boost even though I do have a bunch of functions on Vera using the plethora of triggers that I sent to the HA side. Everything from schedules, chlorinator, pump, and heater operation to group, circuit, virtual circuit, and feature states. From what I understand that automation is now being ported to SmartThings, Hubitat, and ISY as well.

theRealMCQwerty commented 4 years ago

@rstrouse sorry for the delayed response.

I agree with everything you said, I designed my equipment pad in such a way that it relies on incremental control of some of the IntelliValves. I don't want to cut wire and rig up some Arduino based relay setup just to have to tear it all down and rewire (probably 2 years!) later if Pentair eventually get their act together.

If you dig around on the TFP forum you will see that I created a software bridge to emulate and extend the web app and bridge it to MQTT for control by my home automation system. I snooped the calls the web app made to the IC direct then extrapolated the rest. It works pretty well but I paused development of that when I found this project as direct control via RS485 will be superior and offers greater control. I want to cut out the IC as much as possible and run everything from my home automation system but also have the IC in the mix as a backup.

Anyway, not being able to control the valves is no bueno especially since it seems like it could be done pretty easily if we just knew the protocol.

Any suggestions on your end? My next plan of action will be to send random messages to the valves to see if I get any response. A long shot for sure.

I am up for that. I think I could rig up some contraption to make a turning intellivalve trip a switch and log a timestamp. If you were up for the software side of it, do you think it would be feasible to cycle though all possible commands and write to a log including a timestamp? My plan would be to set it up on my bench, run your software and just leave it for a few days, weeks, months, whatever it took to cycle through all commands. If the valve moves and trips the switch then I would be alerted and I could isolate the approximate timestamp then replay the block of commands to pinpoint the winning sequence.

Basically brute-force reverse engineering :-D

Wodyathink?

rstrouse commented 4 years ago

If you dig around on the TFP forum you will see that I created a software bridge to emulate and extend the web app and bridge it to MQTT for control by my home automation system.

What are you using for HA? You know there is the ability to emit HTTP directly off the websocket. There are also plans to create an MQTT client (not sure if it will include a broker yet) to publish states to a broker on the roadmap.

I am up for that. I think I could rig up some contraption to make a turning intellivalve trip a switch and log a timestamp.

Actually, we need it to respond to a hail before we can move the valve. This means that we need to address it. That string of bytes that it is sending out over the broadcast is some sort of identifier for the valve. I am writing a message manager to send it bulk queues that you will find in the dashpanel directory. To access it get the most recent version of dashpanel and navigate to MessageManager.html. It needs a bit of explanation to operate but basically, if you select only the messages for IntelliValve and click the rightmost button on the list it will start showing you the messages from the valve. Hovering over the icons tells you what each of them do. If you copy one of the messages to the outbound queue you can edit it and send it back to the valve. If we can get the valve to respond with something different... anything different that will be a bonus.

theRealMCQwerty commented 4 years ago

What are you using for HA?

Big question! :-) I'm using a mix of Home Assistant, OpenHAB and a homebrew C# app for most of it with some Insteon-specific automation handed off to an ISY 994.

You know there is the ability to emit HTTP directly off the websocket.

I am connecting to the IC websocket (port 6681) via a C# telnet library. Is there a better way to do it?

There are also plans to create an MQTT client (not sure if it will include a broker yet) to publish states to a broker on the roadmap.

I'm assuming you mean this is on the PoolController product roadmap? If so that is a nice to have for me but I would also be happy with the raw API. I only implemented MQTT because it was easier than writing my own API. If the PoolController API surfaced all of the available functionality, including intellivalve control I would have what I need to get going I think.

I am writing a message manager to send it bulk queues that you will find in the dashpanel directory.

I need to carve out some time to devote to this, sounds very interesting. I am eyeballs deep in my pool build atm but this is a critical part so will get to it soon. I haven't look at it at all yet but is there any way to automate sending messages to the valve? If sending random messages to the valve to see if anything changes is the game then I could write something to cycle through a set of messages to send then listen for a change in response. You have probably already done something like that so I should just go and check in out first....

rstrouse commented 4 years ago

Big question! :-) I'm using a mix of Home Assistant, OpenHAB and a homebrew C# app for most of it with some Insteon-specific automation handed off to an ISY 994.

Sounds like a bunch of fun. I am currently running everything through Vera. I have a plugin already that does the whole enchilada. Everything developed in poolController is exposed through the Vera plugin. I may at some point abandon Vera though as the company has always been a bit of a hack.

I am connecting to the IC websocket (port 6681) via a C# telnet library. Is there a better way to do it?

Yes first there is a websocket in poolController that emits all the states. You can connect to this today and it will notify you of the changes. There is also an HTTP API to poolController. When the IntelliValve is figured out you can bet that it will be exposed as well. While we are lagging behind in documentation, the endpoints are all in the /web/services directory. If that isn't enough we also created an HTTP emitter that will reflect the socket to HTTP POST, GET, PUT, NOTIFY your choice. That is how poolController talks to hubitat, vera, and smartThings. I imagine it wouldn't be too far of a stretch to talk to an ISY device as Vera and ISY are animals of the same species.

I haven't look at it at all yet but is there any way to automate sending messages to the valve?

While not random it allows you to queue up message to the valve and ship them off. These will appear in the message list as well as any responses should the valve report a change. I need to virtualize the list which is what I am currently working on to alleviate the reflow on the browser when several hundred thousand messages get queued up.

tagyoureit commented 4 years ago

There is a ISY integration that exists in v5.3: https://github.com/tagyoureit/nodejs-poolController/blob/master/src/integrations/socketISY.js

We had to do some interesting mappings in the config file... would need to think about the best way to integrate this into the current bindings model but shouldn't be terribly difficult.

In the config below, each of the numbers in the variables section relates to an ID on the ISY side.

"socketISY": {
        "username": "blank",
        "password": "blank",
        "ipaddr": "127.0.0.1",
        "port": 12345,
        "Variables": {
            "chlorinator": {
                "saltPPM": 16
            },
            "pump": {
                "1": {
                    "watts": 25,
                    "rpm": 24,
                    "currentprogram": 13,
                    "program1rpm": 10,
                    "program2rpm": 11,
                    "program3rpm": 12,
                    "program4rpm": 13,
                    "power": 14,
                    "timer": 15
                }
            },
            "circuit": {
                "1": {
                    "status": 8
                },
                "2": {
                    "status": 3
                },
                "3": {
                    "status": 2
                }
            },
            "temperatures": {
                "poolTemp": 17,
                "spaTemp": 18,
                "airTemp": 19,
                "spaSetPoint": 20
            }
        }
rsnodgrass commented 4 years ago

@rstrouse after reading this thread, I was forced to buy an IntelliCenter to replace my existing old system. LOL

rstrouse commented 4 years ago

Good luck. Architecturally it really is much better. If you can though I would recommend you hard wire the network at the pad if you can. While the wifi works, the location where people put their pool equipment is typically on the outer perimeter of wifi coverage and the wifi operates on a wifi bridge. Spotty coverage on a bridge is an exercise in humility. At the very least plan on an AP out near the pad and not through 3 stucco walls.

rsnodgrass commented 4 years ago

@rstrouse Thanks, I've got good WiFi coverage at the pool house, but also pulled two CAT6 cables (since I might also put a WiFi mesh node or switch in the pool house...the spare will likely PoE a camera).

rstrouse commented 4 years ago

Yeah I run AiMesh with 4 nodes and get great coverage everywhere inside and out. You can try the WiFi but if it gives you any grief I'd blame the bridge as the culprit. This is because it maintains two connections. Pentair included an enGenius bridge but I think they all are pretty fragile. Interruptions in the signal on either side can take them down. It's annoying to have it work for weeks only to have it go down in the middle of a rain storm.

rerouted commented 4 years ago

I have a RPi with the PoE hat that sits in my Pentair panel behind the IO board at the top. It’s so far lasted 1.5 years with it being 100°+ outside. This solved all my problems. Gave the RPi a Gig connection not that it needs it and also powers it. I got rid of my USB brick and can also power-cycle the RPi remote if needed. The Pi says it’s hot but so far so good.

pi@poolpi:~ $ ./temp Tue Jun 16 13:14:33 EDT 2020 @ poolpi

GPU => 61.2°C (142.1°F) CPU => 61.2°C (142.1°F)

rstrouse commented 4 years ago

Yeah I eliminated the problem by running another cat6 to the pad. For me I have all kinds of stuff running outside. RS485, Ethernet, RG6, audio, and even two DMX universes. However, some of it terminates in the comms closet in the garage and not all the way to the big media closet in the house. Clearly a case of coulda, shoulda, woulda.

thumbnut commented 4 years ago

Hey guys, I have been sort of following this on troublefreepool. I just bought an Intellicenter with i10PS personality module and valve expansion module. I am maxed out on valve actuators (13 actually). I have not installed the pumps, filters, and equipment but have set up the Intellicenter Motherboard Panel on my bench with LEDs on breadboards to test out operation of relays and valves. I also ordered up one of these to spy on RS-485: https://www.commfront.com/products/232analyzer-bundle-s3?_pos=3&_sid=9839d714f&_ss=r&variant=8987231555

I also have a 2 channel DSO

I am not a software engineer or electrical engineer but I do my best.

I would like to contribute data if you think you will find it useful. I don't have any chemistry automation. I will have two Intelliflo pumps, Hybrid ETI heater, and multitudes of Intellivalves (once I get them ordered and installed). In the meantime I may be able to interrogate the Intellicenter. My goal is to break the 10 valve limit and find a way to make the Intellicenter control them all.

thumbnut commented 4 years ago

Forgot to mention that I already have a few Intellivalves that I can play with on the bench. I have two valve expansion modules so I can duplicate what theRealMCQwerty is doing. Here's a photo of the setup: IMG_1014

I am just getting started so the LEDs are not yet wired to the IC. Thr red/green will be plugged into valve connectors and the blue/yellow will be for relay circuits. I have the 2 pin and 3 pin IST connector pigtails on order and should have this all hooked up and functional this weekend. Way cooler to do this in the workshop than out on the pad. 100+ out there. I was also planning on hacking an Intermatic controller to add a 3D printed third cam and switch so I could use it as a true 3-way valve with port A, port B, and port A&B. The plan was to use AUX relay circuits to achieve the additional stop point. My other option would be a timer relay module triggered by an AUX relay that stops valve travel by timing. That seems riskier in the event of a power reset.

rstrouse commented 4 years ago

If you hook up a pi to that board and install poolController and dashPanel there is a page called messageManager.html that will breakout all the communications including the comms from the IntelliValves. Most of the other bytes have already been decoded for the known equipment in the universe.

Right now they will be transmitting an 8 byte payload that looks like a valve identifier on action 82. If you send that payload back to the valve on action 81 it will immediately echo back.

This is typically what the Pentair devices do when you send them an action message that they recognize but there is something wrong with the format of the message. I have plans to write some script on the messageManager to send byte series to the valve to see if I can get it to respond back with anything but the default message. I believe we need to first address it so that it can then be controlled.

Ultimately, I believe the last 4-6 bytes are the valve identifier. Beyond that I have no idea until we can get the valve to respond with something other than "I am Groot".

thumbnut commented 4 years ago

Hopefully we can get to "I am Iron Man"

thumbnut commented 4 years ago

... but I would settle for "I am Valve 1 at position 22".

rstrouse commented 4 years ago

Yep all I seem to have been able to do is get the valve to not broadcast 82 anymore by sending it back a 210. It's not what I would consider progress but it is something. Maybe that is the self destruct sequence.

thumbnut commented 4 years ago

Let's hope not. I just did some crash course learning on Node-RED, JSON, and MQTT. This is all new to me. Last time I did a front end it was Visual Basic. Last time I programmed a microcontroller it was Arduino. I do catch on fast though, especially when I am motivated. I have a couple of pi boards laying around so I should be able to get up and running with poolController. I assume you guys using this adapter for the pi? If not, please let me know how you are interfacing the pi to the IC.

https://www.amazon.com/JBtek-Converter-Adapter-ch340T-Supported/dp/B00NKAJGZM/ref=pd_cart_rtpb_2_11?_encoding=UTF8&pd_rd_i=B00NKAJGZM&pd_rd_r=39e51f19-a01d-43b8-bfb3-cef74827d353&pd_rd_w=XauS8&pd_rd_wg=L0K6A&pf_rd_p=ef160443-36b9-4869-8653-47ba9bde84a0&pf_rd_r=GP9WMZCR450GWE9JJPN4&psc=1&refRID=GP9WMZCR450GWE9JJPN4

In the meantime if there is any thing I can do with my setup to help please let me know.

rstrouse commented 4 years ago

Yep that's the one. I have another 5 or so of these valves laying around. We'll see it may just be a lockout feature when you bombard it with stuff it doesn't understand.

rstrouse commented 4 years ago

It also could mean that I need to shake a chicken bone at it because I have the first part of the id ritual nailed.

rstrouse commented 4 years ago

Powering it down reset it. It is now saying I am Groot again.

thumbnut commented 4 years ago

Good to hear. Had me worried. I was playing around with my setup and noticed a couple of interesting things. First was the actuators turned automatically every so often by them selves. I have no schedules or egg timers set. I was using manual control. The other thing I noticed, and probably would never notice this in an outdoor setting, is that when you put the IntelliValve in setup mode and set the home position, it makes a lot of clicking noises as it is moving to the home position, as if it is setting pawls or switch levers as it is traveling. This leads me to believe the actuator is more electromechanical than I assumed. Once the setup is complete and the actuator is returned to auto mode, it does not make the clicking noises when being operated by the IC. I am so tempted to open one of them up (in the name of science , of course) to find out what makes them click.

rstrouse commented 4 years ago

The only time those valves should move is when they are moved with a circuit. If they are doing that on their own you have a problem. All of those clicking noises are actually the gears. When the actuator is installed on a valve spline, the resistance of the valve keeps the gears tight. You want some slop in the gears or the smaller/harder gears will chew up the larger more vulnerable ones.

While the it does have some similar parts as the old CV24 valves it doesn't use mechanical endpoints with micro-switches and cams. These used to drift all over the place for me with the old valves. The IntelliValve has been rock solid. I used to have to replace or rebuild a couple of CV24s every year. I have been running IntelliValve for a couple of years and they have been solid.

thumbnut commented 4 years ago

I will set up a schedule on a circuit. It may be because I have not set up anything and the time is not set yet. There may be a default of some kind or a lack of sensor input confusing the controller. I am glad to hear the new IntelliValve is reliable.

rstrouse commented 4 years ago

Nothing that fancy. There are 3 wires powering the valve on 24vac. One is neutral and the other 2 are hot. Only one hot is energized at a time and that will continue to run in one direction until it meets the set endpoint. If you energize the other hot it will run in that direction until that endpoint is met. The RS485 line will supposedly tell us the current position and what the endpoints are.

If you test the pins on IntelliCenter you will see that one pin is always energized and the DPDT relay controlling it simply says whether it wants the CW or CCW endpoint. We want to control those endpoints.

thumbnut commented 4 years ago

I am very familiar with the JVA and have rebuilt them as well. The IntelliValve probably uses encoders. I noticed that the actuators all have to home themselves after power interruption so they are not aware of their absolute position after they are power cycled. I am not sure if it is the IC doing that or the actuator.

tagyoureit commented 4 years ago

Closing this issue. Intellicenter is well supported now.