Announcement

Collapse
No announcement yet.

Question re: Flume Water Integration

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

    #61
    Originally posted by Michael McSharry View Post
    Note the longer duration intervals have the time at the end while the Hour one does not. Try a suffix 00:00:00 to pattern like the others.

    Another suggestion on the NOW query is to request the last 60 seconds rather than requesting the amount since the start of the current minute. This will give more consistent results. It requires use of embedded expression to compute the start time being 60 seconds less than the current time.
    Okay. Cool. I'll give that a try. I will also look at the modification to the "Now" query when my next window of time opens. As always thanks!

    Is your suggestion for the Now query what I should use to modify it?
    Code:
    Flumetech.pub likely contains {"request_id":"Now","bucket":"MIN","operation":"MAX","since_ datetime":"$$YEAR:-$$MONTH:-$$DAY: $$HOUR::$$MINUTE::00"}.
    Or does it require more tinkering? If it's something else "embedded expression" would you mind helping me with that? I'm not sure where to go with that...

    Comment


      #62
      Originally posted by Michael McSharry View Post
      Note the longer duration intervals have the time at the end while the Hour one does not. Try a suffix 00:00:00 to pattern like the others.

      Another suggestion on the NOW query is to request the last 60 seconds rather than requesting the amount since the start of the current minute. This will give more consistent results. It requires use of embedded expression to compute the start time being 60 seconds less than the current time.
      Okay. Solved the Hourly query. Looks like you have to use the same format as "Now" just instead use the "HR" bucket.

      Code:
      {"request_id":"Hour","bucket":"HR","operation":"MAX","since_datetime":"$$YEAR:-$$MONTH:-$$DAY: $$HOUR::$$MINUTE::00"}

      Comment


        #63
        When an association is made and the Control/Status UI type is numeric, mcsMQTT will look at the precision of the number in the payload and use that for the precision in HS status. With a value of 0 reported in the NOW query at the time the association was made it looks like no decimal precision is being reported.

        I do not know what approach is being taken by Flume to populate the Minute bucket. It could be rolling or it could be a snapshot since the start of the current minute. If it is rolling and you want to get the report for the last 60 seconds vs. a report for the seconds since the start of the current minute then the following can be used for the query. I had to add the DateAdd function to do math on dates. It is available in version 6.0.1.0. This version also contains the fix for the Floor & Room on the Edit tab.

        The Format_DateTime is another Date function that can be used in lieu of the $$YEAR:, $$MONTH:, etc. The << and >> are used to enabled the embedded functions in the template.

        Code:
        {"request_id":"Now","bucket":"MIN","operation":"MAX","since_ datetime":"<<Format_DateTime("<<DateAdd("second",-60,Now)>>","yyyy-MM-dd HH:mm:ss")>>"}
        Attached Files

        Comment


          #64
          Originally posted by Michael McSharry View Post
          When an association is made and the Control/Status UI type is numeric, mcsMQTT will look at the precision of the number in the payload and use that for the precision in HS status. With a value of 0 reported in the NOW query at the time the association was made it looks like no decimal precision is being reported.

          I do not know what approach is being taken by Flume to populate the Minute bucket. It could be rolling or it could be a snapshot since the start of the current minute. If it is rolling and you want to get the report for the last 60 seconds vs. a report for the seconds since the start of the current minute then the following can be used for the query. I had to add the DateAdd function to do math on dates. It is available in version 6.0.1.0. This version also contains the fix for the Floor & Room on the Edit tab.

          The Format_DateTime is another Date function that can be used in lieu of the $$YEAR:, $$MONTH:, etc. The << and >> are used to enabled the embedded functions in the template.

          Code:
          {"request_id":"Now","bucket":"MIN","operation":"MAX","since_ datetime":"<<Format_DateTime("<<DateAdd("second",-60,Now)>>","yyyy-MM-dd HH:mm:ss")>>"}
          Thanks Michael. Makes sense re: the precision. Also, thanks for the code regarding the "Now looking back 60 seconds" I have a feeling that is gonna work better, but I'll play with it and see. I'll make sure to update to 6010. I'm assuming I'll have to side-load it again?

          Comment


            #65
            Yes side load the attached into \bin\mcsMQTT or use updater override process with file http://mcsSprinklers.com/HSPI_mcsMQTT_6_0_1_0.zip

            The same approach for rolling vs. start of time interval calculation can be used with any of the queries. http://mcsSprinklers.com/mcsMQTT.pdf Table 3 contains the interval parameters available in the DateAdd function.

            I did not look, but another consideration is if Flume is reporting in local time or if in GMT time. Based upon seeing data updates for test water usages such as shower I would guess it is local time such as currently being used in the queries.

            Comment


              #66
              Originally posted by Michael McSharry View Post
              Yes side load the attached into \bin\mcsMQTT or use updater override process with file http://mcsSprinklers.com/HSPI_mcsMQTT_6_0_1_0.zip

              The same approach for rolling vs. start of time interval calculation can be used with any of the queries. http://mcsSprinklers.com/mcsMQTT.pdf Table 3 contains the interval parameters available in the DateAdd function.

              I did not look, but another consideration is if Flume is reporting in local time or if in GMT time. Based upon seeing data updates for test water usages such as shower I would guess it is local time such as currently being used in the queries.
              Okay. Sounds good. I think only the "Now" query is the one I'm going to play with, the others seem to work fine as is (but good to know!), and I also believe that the times are in local time. I created some charts using Jon00's charting utility and they seem to align with what I expect (time-wise).

              Comment


                #67
                I have not used Jon00's charting utility, but I suspect the charting capability in mcsMQTT would be easier to use for quick visualization of data. This implies the History tab has been setup to save history in either short term or long term database storage. As is usually the case, simplicity of use implies limitations on customization. mcsMQTT has taken simplicity as the choice in this continuum. It is also the case that no matter how simple something is, any change is a learning curve that may not be worth the effort.

                Comment


                  #68
                  Originally posted by Michael McSharry View Post
                  When an association is made and the Control/Status UI type is numeric, mcsMQTT will look at the precision of the number in the payload and use that for the precision in HS status. With a value of 0 reported in the NOW query at the time the association was made it looks like no decimal precision is being reported.

                  I do not know what approach is being taken by Flume to populate the Minute bucket. It could be rolling or it could be a snapshot since the start of the current minute. If it is rolling and you want to get the report for the last 60 seconds vs. a report for the seconds since the start of the current minute then the following can be used for the query. I had to add the DateAdd function to do math on dates. It is available in version 6.0.1.0. This version also contains the fix for the Floor & Room on the Edit tab.

                  The Format_DateTime is another Date function that can be used in lieu of the $$YEAR:, $$MONTH:, etc. The << and >> are used to enabled the embedded functions in the template.

                  Code:
                  {"request_id":"Now","bucket":"MIN","operation":"MAX","since_ datetime":"<<Format_DateTime("<<DateAdd("second",-60,Now)>>","yyyy-MM-dd HH:mm:ss")>>"}
                  Looks like the latest version .zip file you posted only has two files in it. The .dll and .pdb. It doesn't contain the updater_override.json file or can I use the same one from the previous version you posted? Or is this a full update and I should just swap out the files?

                  Edit: Sorry re-read your previous post. You already answered my questions...good times being tired all the time.

                  Comment


                    #69
                    Michael McSharry I tried using your offset expression for "Now" but for some reason, it was returning a 400 error. I went ahead and just created a chart using "Now" without the expression to see how it would work (to be fair I hadn't tried it that way first), and it seems to be working pretty well. I had a good test this morning. I was up early waiting for my baby daughter to get up and the sprinklers were running. Since they use the most water for the longest time it was a good benchmark. The data seems to return as they are running and for my use acceptable. I'm okay if you want to still debug the offset, but I have limited free time right now, so it might not be a quick thing for me to jump into. As always thanks for your help, patience and support! Now I just have to update my smart home tablet with the water usage charts. :-)

                    Comment


                      #70
                      Since you have all you need for now there is no need to go further. It is not clear how Flume is bucketing data so it is just a guess as to the best way to write the query. If you happen to have the mcsMQTT debug file for the error code 400 return I would like to look at it, but if you do not then don't take the time the reproduce it.

                      Comment


                        #71
                        Originally posted by Michael McSharry View Post
                        Since you have all you need for now there is no need to go further. It is not clear how Flume is bucketing data so it is just a guess as to the best way to write the query. If you happen to have the mcsMQTT debug file for the error code 400 return I would like to look at it, but if you do not then don't take the time the reproduce it.
                        No problem. Just emailed it to you. I think you'll want to look at late afternoon yesterday. That's when I tried to swap out the versions of FlumeTech.pub. Hopefully it's there.

                        Comment


                          #72
                          Hey Michael McSharry. I happened to get a usage alert on my Flume app, but when I checked HomeSeer it doesn't appear that the notifications are updating. They are still reading from when I first installed the API via mcsMQTT. I'll email you the log. Thanks!

                          Comment


                            #73
                            The debug contains notification queries for type 1, 4 and 16.

                            Normal response for type 16 and 4 without anything to report.

                            Usage alert provided for type 1 with HS Device Feature 4372 being updated in the Device String.

                            I believe Last Update times are updated on Device Value change and since it was text the Last Update property was not changed. If you want the Last Update done on any message received, then use Edit tab for Device Ref 4372 and assure the MISC property of Set Does Not Change Last Change does not have a checkbox. The same would be done for other notification Device Ref that have text being stored.

                            It looks to me as if the "message" key would be more informative to associate to HS device. It looks like "title" is being associated with 4372.

                            To get rid of this usage alert you can consider getting rid of the kids.

                            Click image for larger version  Name:	0x.png Views:	0 Size:	17.6 KB ID:	1578844

                            Code:
                            https://api.flumewater.com/me/notifications?limit=1&offset=0&type=16  
                            
                            {"success":true,"code":602,"message":"Request OK","http_code":200,"http_message":"OK","detailed":null,"data":[],"count":0,"pagination":null}  
                            
                            -----------------------
                            
                            https://api.flumewater.com/me/notifications?limit=1&offset=0&type=4  
                            ​
                            {"success":true,"code":602,"message":"Request OK","http_code":200,"http_message":"OK","detailed":null,"data":[],"count":0,"pagination":null}  
                            
                            ----------------------
                            
                            https://api.flumewater.com/me/notifications?limit=1&offset=0&type=1
                            
                            {"success":true,"code":602,"message":"Request OK","http_code":200,"http_message":"OK","detailed":null,"data":[{"id":xxx,"device_id":"xxx","user_id":xxx,"type":1,"message":"Kids Shower Alert triggered at Begun Family Home. Water has been running for 10 minutes averaging 2.25 gallons every minute.","created_datetime":"2022-12-02T19:36:00.000Z","title":"Usage Alert!","read":true,"extra":{"advanced_low_flow":false,"query":{"request_id":"SYSTEM_TRIGGERED_USAGE_ALERT","until_datetime":"2022-12-02 11:36:00","tz":"America/Los_Angeles","bucket":"MIN","since_datetime":"2022-12-02 11:26:00"},"event_rule_name":"Kids Shower Alert"}}],"count":1,"pagination":null}  
                            ​
                            12/3/2022 12:05:24 AM    316236    | Update Accepted 4372 to Usage Alert! StatusType=3 Payload=Usage Alert!

                            Comment


                              #74
                              Originally posted by Michael McSharry View Post
                              The debug contains notification queries for type 1, 4 and 16.

                              Normal response for type 16 and 4 without anything to report.

                              Usage alert provided for type 1 with HS Device Feature 4372 being updated in the Device String.

                              I believe Last Update times are updated on Device Value change and since it was text the Last Update property was not changed. If you want the Last Update done on any message received, then use Edit tab for Device Ref 4372 and assure the MISC property of Set Does Not Change Last Change does not have a checkbox. The same would be done for other notification Device Ref that have text being stored.

                              It looks to me as if the "message" key would be more informative to associate to HS device. It looks like "title" is being associated with 4372.

                              To get rid of this usage alert you can consider getting rid of the kids.

                              Click image for larger version Name:	0x.png Views:	0 Size:	17.6 KB ID:	1578844

                              Code:
                              https://api.flumewater.com/me/notifications?limit=1&offset=0&type=16
                              
                              {"success":true,"code":602,"message":"Request OK","http_code":200,"http_message":"OK","detailed":null,"data":[],"count":0,"pagination":null}
                              
                              -----------------------
                              
                              https://api.flumewater.com/me/notifications?limit=1&offset=0&type=4
                              ​
                              {"success":true,"code":602,"message":"Request OK","http_code":200,"http_message":"OK","detailed":null,"data":[],"count":0,"pagination":null}
                              
                              ----------------------
                              
                              https://api.flumewater.com/me/notifications?limit=1&offset=0&type=1
                              
                              {"success":true,"code":602,"message":"Request OK","http_code":200,"http_message":"OK","detailed":null,"data":[{"id":xxx,"device_id":"xxx","user_id":xxx,"type":1,"message":"Kids Shower Alert triggered at Begun Family Home. Water has been running for 10 minutes averaging 2.25 gallons every minute.","created_datetime":"2022-12-02T19:36:00.000Z","title":"Usage Alert!","read":true,"extra":{"advanced_low_flow":false,"query":{"request_id":"SYSTEM_TRIGGERED_USAGE_ALERT","until_datetime":"2022-12-02 11:36:00","tz":"America/Los_Angeles","bucket":"MIN","since_datetime":"2022-12-02 11:26:00"},"event_rule_name":"Kids Shower Alert"}}],"count":1,"pagination":null}
                              ​
                              12/3/2022 12:05:24 AM 316236 | Update Accepted 4372 to Usage Alert! StatusType=3 Payload=Usage Alert!
                              That's weird. I had associated the message before. Something must have broken perhaps? See the included screenshot as I do have a device for message and title. When I go to your plugin association's table, you're right the message isn't associated with a device and it does show the latest message/alert. Strange.
                              Attached Files

                              Comment


                                #75
                                Okay. I did find the association I used and it is displaying the old usage alert. It's type-2 which the most update one reads from type-1. Does that mean I should associate both messages? Or switch to using type-1 and ignore type-2? So confusing!
                                Attached Files

                                Comment

                                Working...
                                X