Announcement

Collapse
No announcement yet.

poolController Homeseer interface with mcsMQTT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    poolController Homeseer interface with mcsMQTT

    I have poolController installed and working on a Raspberry PI computer following this guide;
    https://www.troublefreepool.com/thre...-guide.218514/

    The github link for poolController is;
    https://github.com/tagyoureit/nodejs-poolController

    poolController has a built in MQTT client which I have enabled per;
    https://github.com/tagyoureit/nodejs...ns-in-2.0#mqtt

    mcsMQTT lists 240 associations for this pool/state/

    Click image for larger version

Name:	mcsMQTT.JPG
Views:	151
Size:	79.5 KB
ID:	1425620

    Asking for help setting this up properly. I would like to have this auto-configure, so that this becomes a simple pool automation add on for Homeseer.

    I do have a bribe, of a preconfigured ready to go, (RPI, PS, SD Card, RS485 Adapter and case) for someone to step forward ??

    #2
    I did a quick look at your first reference and it looks to me as if the controller application runs on a RPi and contains its own UI. MQTT is used to allow certain parameters to be monitored or controlled by an external automation system such as Homeseer. What is it that you want Homeseer to do to make it a simple pool automation?

    Comment


      #3
      Autelis used to make a IP interface for the Pentair equipment, Spud wrote a plugin to bring all these items into Homeseer

      Click image for larger version  Name:	Autelis.JPG Views:	0 Size:	112.3 KB ID:	1425657

      Problem is that these interfaces (PC100PL) are not being make and I have had one fail.
      So I looking for a replacement method to get this information / controls into Homeseer, I am sure there are many people interested in this...

      I would like for the; "poolController and mcsMQTT", combination to replicate the a PC100PL interface and the Autelis plugin.

      Comment


        #4
        Other than seeing there are about 40 or 50 devices the screenshot it to small to recognize. If the poolController makes available 240 items then it is likely that 40 or 50 of these are equivalent to the Autelis. What other capabilities does the Autelis provide beyond making the 40 or 50 devices? Is there a link to the Autelis plugin manual?

        Comment


          #5
          Spud's plugin guide
          https://forums.homeseer.com/forum/po...guide?t=172099

          Autelis Wiki
          http://autelis.com/wiki/index.php?ti...ouch/EasyTouch

          Yes, if you could help me configure the poolController items to show properly with mcsMQTT, I believe that it will be a working alternative to the non existence Autelis PC100PL device.

          Comment


            #6
            The question does not appear to be what can be done, but is what you are actually doing with Autelis. What events have you setup? What status items do you view for monitoring or have exposed on your custom interface. It looks like Spud makes 26 devices available. Which of these do you actually use or care about? It appears poolController makes 240 available so the menu is larger, but you do not need to order everything on the menu.

            Comment


              #7
              These are what I am monitoring on a HSTouch display page...

              Air Temperature
              Pool Temperature
              Chlorinator on off
              Aux 1 to 7 on off
              ORP level
              PH level
              Heater off heater solar
              spa on off
              pool on off
              pump hi on off
              pool cleaner on off
              pool lights choice of color
              ORP setpoint
              PH setpoint
              pool Heater setpoint
              spa heater setpoint
              pump gpm
              pump RPM
              pump watts
              Salt level
              heater status

              Events are to control pool light, pool cleaner, and send email when ORP and PH levels need attention.

              Comment


                #8
                What mcsMQTT sees is saved in /Data/mcsMQTT/mcsMQTT.db. Can you post this file zipped up or email to mcsSolutions at CenturyTel dot net. That should give me a good idea of how to bridge the plugins.

                Comment


                  #9
                  Here you go... mcsMQTT.zip

                  Comment


                    #10
                    I believe I found most topics that correspond to your list. You have most of these in your original post.
                    Code:
                     Air Temperature               pool/state/temps/air:temp Pool Temperature              pool/state/temps/bodies/1/pool/temp:temp Chlorinator on off            pool/state/chlorinators/1/intellichlor--60:isOn Aux 1 to 7 on off ORP level                     pool/state/chemControllers/1/intellichem/orpLevel:orpLevel PH level                      pool/state/chemControllers/1/intellichem/pHLevel:pHLevel Heater off heater solar       pool/state/temps/bodies/1/pool/heatMode *** spa on off                    pool/state/temps/bodies/1/spa/heatMode *** pool on off                   pool/state/temps/bodies/1/pool:isOn pump hi on off pool cleaner on off pool lights choice of color   pool/state/lightgroups/192/intellibrite/lightingTheme *** ORP setpoint                  pool/state/chemControllers/1/intellichem/orpSetpoint:orpSetpoint PH setpoint                   pool/state/chemControllers/1/intellichem/pHSetpoint:pHSetpoint pool Heater setpoint          pool/state/temps/bodies/1/pool/setPoint:setPoint spa heater setpoint           pool/state/temps/bodies/2/spa/setPoint pump gpm                      pool/state/pumps/1/undefined/flow *** pump RPM                      pool/state/pumps/1/undefined/rpm *** pump watts                    pool/state/pumps/1/undefined/watts Salt level                    pool/state/chemControllers/1/intellichem/saltLevel:saltLevel heater
                    The MQTT reference identified the following to send commands. The publish topics that you have setup need to be modified to match this. For example to set the ph setpoint the following likely should be used pool/state/chemControllers/1/intellichem/pHSetpoint/setPoint In essence the publish topic is the same as the subscribe topic with /setPoint, /setState, /heatMode, or /setTheme suffix. I'm guessing that any topic that is received with JSON payload will use JSON payload for the command. This means that the mcsMQTT Payload Template text box will need to be in JSON format. For example the subscribed topic pool/state/temps/bodies/1/pool:isOn showing in the mcsMQTT association table has a colon in the name so it was received as JSON. The publish topic is setup as pool/state/temps/bodies/1/pool/SetState. The Payload Template as {"isOn":$$LABEL:}. The $$LABEL: is the mcsMQTT substitution variable from the On or Off that is the button label in the HS Devices UI. rootTopic/state/+/setState,
                    Code:
                       * rootTopic/state/+/setState,   * rootTopic/state/+/setstate,   * rootTopic/state/+/toggleState,   * rootTopic/state/+/togglestate,   * rootTopic/state/body/setPoint,   * rootTopic/state/body/setpoint,   * rootTopic/state/body/heatMode,   * rootTopic/state/body/heatmode,   * rootTopic/state/+/setTheme,   * rootTopic/state/+/settheme,   * rootTopic/state/chlorinator (both camelCase and lowercase are simply for compatibility)  Payload/message should follow the same format as the api. Turn turn off circuit 9 you can send:  topic: easytouch2-8/state/circuits/setState payload: {"id": 9, "isOn": true}
                    For the themes the associated device Edit tab Control/Status UI will be of type List. You will cycle through all the lighting schemes so mcsMQTT will see the theme name reported or you can use the Edit tab VSP row to manually enter them. The HS UI selector will be populated based upon the VSP list. I realize this is not a total description, but something simple should be tried to confirm that two way communication exists. For example, focus on commanding a setpoint and seeing that the commanded setpoint is echoed back and HS device updated with the new setpoint. I also do not fully understand why you have so many topics in the association table without checkboxes to make associations. If you enable History collection from the General tab for 1 (or whatever) day and collect all received and published topics then there will be a second .db file (mcsMQTT History.db) in the same location as mcsMQTT.db. This will show the full MQTT messages and will be easier to work with when trying to format the publish syntax and understand the checkbox observation.

                    Comment


                      #11
                      Up to 304 associations with history DB mcsMQTT.zip

                      Of the items which I created yesterday, first post, none of the commands get a response. Setpoint, on , off, etc...


                      From Tagyoureit's instructions;

                      "Payload/message should follow the same format as the api. Turn turn off circuit 9 you can send:
                      https://github.com/tagyoureit/nodejs...ns-in-2.0#mqtt
                      https://tagyoureit.github.io/nodejs-poolcontroller-api/
                      • topic: easytouch2-8/state/circuits/setState
                      • payload: {"id": 9, "isOn": true}
                      Set values with MQTT


                      The MQTT binding will also listen for:

                      * rootTopic/state/+/setState, * rootTopic/state/+/setstate, * rootTopic/state/+/toggleState, * rootTopic/state/+/togglestate, * rootTopic/state/body/setPoint, * rootTopic/state/body/setpoint, * rootTopic/state/body/heatMode, * rootTopic/state/body/heatmode, * rootTopic/state/+/setTheme, * rootTopic/state/+/settheme, * rootTopic/state/chlorinator
                      Attached Files

                      Comment


                        #12
                        The mcsMQTT setup for controlling the pool was not correct in the mcsMQTT.db. The publish topic and the payload template need to be updated to comply with the requirements shown in post #10 and 11. I used your history data as a message source and worked with a setpoint and a theme device to illustrate what needs to be done.

                        For the setpoint note the HS Device Publish Topic textbox and the Publish Payload Template textbox below. The Topic contains the suffix /setPoint to indicate a setPoint command is being provided to the pool controller. The Template is using JSON format for the key setPoint and substitution variable of $$VALUE: to indicate that it is the commanded value from HS.
                        Click image for larger version

Name:	Capture.PNG
Views:	116
Size:	59.0 KB
ID:	1425897

                        The created HS device 5655 and feature 5656 look as below. Your Ref number will be different than the one in my test.
                        Click image for larger version

Name:	Capture3.PNG
Views:	75
Size:	124.6 KB
ID:	1425898

                        When the Submit button is clicked the following message is sent to the pool controller
                        Topic: pool/state/temps/bodies/1/pool/setPoint/setPoint
                        Payload: {"setPoint":84}

                        For the color theme I setup mcsMQTT as below. Note the Publish Topic, Control/Status UI, VSP List, and Payload Template. The publish topic uses the /setTheme suffix to indicate a command to the pool controller. The Control/Status is set to list so a pulldown selector is created in HS. I manually added alloff,allon,colorsync,colorswim in the VSP text box to match the start of what is in Spud's plugin. The payload template is based upon the JSON format of the received topic that I got from the history database. In this case the substitution variable is $$LABEL: because the text and not the value are to be sent.

                        The created HS device 5657 and feature 5658 are shown above as well as the selection being for colorset. When selected the following MQTT message was sent
                        Topic: pool/state/lightgroups/192/intellibrite/lightingTheme/setTheme
                        Payload: {"lightingTheme":{"name":"colorset"}}

                        Click image for larger version

Name:	Capture2.PNG
Views:	76
Size:	388.2 KB
ID:	1425899

                        In the theme topic from history database the following was the actual message I used for format consideration.

                        Code:
                        {"lightingTheme":{"val":128,"name":"colorsync","desc":"Color Sync","type":"intellibrite"}}
                        I am assuming that either "val" or "name" could be used. It may or may not be necessary to include the type. If it is needed then the temmplate would be
                        Code:
                        {"lightingTheme":{"name":"$$LABEL:","type":"intellibrite"}}
                        It may also be the case that "desc" could have been used and likely would be preferred if the pool controller will recognize it. In this case the VSP entries would look just like Spud's name rather than the all lowercase used for "name"

                        Looking at the following from the references there may be cases where the id is moved from the topic to the payload when publishing commands. The subscribed topic for circuits looks like "pool/state/circuits/2/poolhigh" while the publish topic does not contain the "2". This may apply to others such as features, lightgroups, bodies, etc where there is a numeric component in the topic.


                        Payload/message should follow the same format as the api. Turn turn off circuit 9 you can send:
                        • topic: easytouch2-8/state/circuits/setState
                        • payload: {"id": 9, "isOn": true}
                        I did notice there may be an an issue with HS4 version of mcsMQTT on List selector selection sending the correct label. I will look into that.

                        There is a discovery prototocol that allows devices/features to be automatically created. This is normally the responsibility of the publisher (e.g. pool controller author) to publish the discovery topics so that the clients (e.g. mcsMQTT/HS, homeassistant) know how to create devices. This discovery data can be published using a mcsMQTT publist, but would be as much work to generate the publist as it would be to manually create the 20 or so devices/features manually as I have illustrated above. It would have a time payback if other users wanted the MQTT solution to the pool controller interface.

                        Comment


                          #13
                          Tried just something simple;

                          {"setPoint":&&VALUE:}

                          Click image for larger version  Name:	Pool Setpoint.JPG Views:	0 Size:	143.2 KB ID:	1425952

                          Setpoint was at 80

                          Enter 85, press submit

                          Got nothing

                          Comment


                            #14
                            They should be dollar signs and not ampersands for replacement variables.

                            Comment


                              #15
                              Changed the && to $$

                              Click image for larger version

Name:	Pool Setpoint.JPG
Views:	70
Size:	142.8 KB
ID:	1426076
                              Still does not respond.

                              Comment

                              Working...
                              X