Announcement

Collapse
No announcement yet.

New OpenSprinkler Plugin

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

    Matt -- here's the log output:

    Sep-27 12:35:03 PM OpenSprinkler All zones are off
    Sep-27 12:35:00 PM OpenSprinkler Zone 10 off successfully set
    Sep-27 12:35:00 PM OS-Debug URL: /cm?pw=a6d82bced638de3def1e9bbb4983225c&sid=9&en=0
    Sep-27 12:35:00 PM OS-Debug Zonestring integer: 10, CC.Controlvalue: 0
    Sep-27 12:35:00 PM OS-Debug Zonestring worked out to be10
    Sep-27 12:35:00 PM OS-Debug Specific debug - we should have definitely got here
    Sep-27 12:35:00 PM OS-Debug SetIOMulti called for: OS-Station10, Command:0
    Sep-27 12:35:00 PM Event Deleting event after run: "Delayed Actions Master Driveway Trees (Delayed Action)"
    Sep-27 12:35:00 PM Device Control Device: OpenSprinkler OpenSprinkler Master Driveway Trees to Off (0)
    Sep-27 12:35:00 PM Event Event Trigger "Delayed Actions Master Driveway Trees (Delayed Action)"
    Sep-27 12:33:10 PM OpenSprinkler Master Driveway Trees is currently on
    Sep-27 12:33:10 PM OS-Plugin Failed to send out to Controller
    Sep-27 12:33:10 PM OS-Debug SetIOMulti Exception - Input string was not in a correct format.
    Sep-27 12:33:00 PM OS-Debug URL: /cm?pw=a6d82bced638de3def1e9bbb4983225c&sid=14&en=0
    Sep-27 12:33:00 PM OS-Debug Zonestring integer: 15, CC.Controlvalue: 0
    Sep-27 12:33:00 PM OS-Debug Zonestring worked out to be15
    Sep-27 12:33:00 PM OS-Debug Specific debug - we should have definitely got here
    Sep-27 12:33:00 PM OS-Debug SetIOMulti called for: OS-Station15, Command:0
    Sep-27 12:33:00 PM Event Deleting event after run: "Delayed Actions North Driveway Trees (Delayed Action) - 1"
    Sep-27 12:33:00 PM Device Control Device: OpenSprinkler OpenSprinkler North Driveway Trees to Off (0)
    Sep-27 12:33:00 PM Event Event Trigger "Delayed Actions North Driveway Trees (Delayed Action) - 1"
    Sep-27 12:17:27 PM OpenSprinkler Master Driveway Trees and North Driveway Trees is currently on
    Sep-27 12:03:03 PM OpenSprinkler Master Driveway Trees and Drip: Grasses and North Driveway Trees is currently on
    Sep-27 12:03:00 PM OpenSprinkler Zone 15 on successfully set
    Sep-27 12:03:00 PM OS-Debug Seconds: 21660
    Sep-27 12:03:00 PM OS-Debug If we got here, then theres your problem!
    Sep-27 12:03:00 PM OS-Debug Zonestring integer: 15, CC.Controlvalue: 361
    Sep-27 12:03:00 PM OS-Debug Zonestring worked out to be15
    Sep-27 12:03:00 PM OS-Debug Specific debug - we should have definitely got here
    Sep-27 12:03:00 PM OS-Debug SetIOMulti called for: OS-Station15, Command:361
    Sep-27 12:03:00 PM Event Deleting event after run: "Delayed Actions North Driveway Trees (Delayed Action)"
    Sep-27 12:03:00 PM Device Control Device: OpenSprinkler OpenSprinkler North Driveway Trees to On (361)
    Sep-27 12:03:00 PM Event Event Trigger "Delayed Actions North Driveway Trees (Delayed Action)"
    Sep-27 12:00:02 PM OpenSprinkler Master Driveway Trees and Drip: Grasses is currently on
    Sep-27 12:00:00 PM OpenSprinkler Zone 10 on successfully set
    Sep-27 12:00:00 PM OS-Debug Seconds: 21660
    Sep-27 12:00:00 PM OS-Debug If we got here, then theres your problem!
    Sep-27 12:00:00 PM OS-Debug Zonestring integer: 10, CC.Controlvalue: 361
    Sep-27 12:00:00 PM OS-Debug Zonestring worked out to be10
    Sep-27 12:00:00 PM OS-Debug Specific debug - we should have definitely got here
    Sep-27 12:00:00 PM OS-Debug SetIOMulti called for: OS-Station10, Command:361
    Sep-27 12:00:00 PM Device Control Device: OpenSprinkler OpenSprinkler Master Driveway Trees to On (361)
    Sep-27 12:00:00 PM Event Event Trigger "Drip Driveway Trees Master On"

    You will notice that the input strings to SetIOMulti are identical except for the station number. Note that turning a station on sets the run time to 6 hours, which is the HS default. The actual string sent by OpenSprinkler to the OSBee sets run time to one hour. "Off" sends a string that sets the run time to 0.

    I don't understand the message :If we got here, there's your problem!"

    Thank you for your very kind and generous assistance!

    Rog

    Comment


      Originally posted by rloeb View Post

      I don't understand the message :If we got here, there's your problem!"

      Rog
      That comment was only relevant for the switching off, and that was when i was guessing what the problem was which it isnt.

      Anyway, this is a tricky one, we will have to try it again. Attached is a new version, if you can do the same steps again - overwrite with this new version and send me the logs again. I think i know the offending line of code, but I need to see the value it was trying to work with, which i didn't have in my first debug code.

      What i think is happening, if usually when HS writes a command to the OS using HTTP, it gets a response which looks like this: {"result":1} - i have some code which grabs the number and writes the translation to the log (eg. Zone 1 on successfully set), but if it doesnt get any response my code will fail as per what we are seeing - I think thats what's happening. If so, the real question is why your OS isn't responding to this particular command at this exact time. I also notice a 10 second delay between sending the command and getting the error - thats the timeout setting so it all fits - i have increased this to 15 for this debug version to see if this helps.

      Cheers.
      Attached Files

      Comment


        Sure enough, it's timing out. However, the command was actually executed and the zone turned off (at the time the command was sent). Then I sent a manual off (from the devices page) and it did not time out (although the zone was already off). Very curious!

        Rog
        Sep-28 12:40:10 PM OpenSprinkler All zones are off
        Sep-28 12:40:06 PM OpenSprinkler Zone 15 off successfully set
        Sep-28 12:40:06 PM OS-Debug Debug Setter= {"result":1}
        Sep-28 12:40:06 PM OS-Debug URL: /cm?pw=a6d82bced638de3def1e9bbb4983225c&sid=14&en=0
        Sep-28 12:40:06 PM OS-Debug SetIOMulti called for: OS-Station15, Command:0
        Sep-28 12:40:06 PM Device Control Device: OpenSprinkler OpenSprinkler North Driveway Trees to Off (0) by/from: CAPI Control Handler
        Sep-28 12:39:45 PM OpenSprinkler All zones are off
        Sep-28 12:39:41 PM OpenSprinkler Zone 10 off successfully set
        Sep-28 12:39:41 PM OS-Debug Debug Setter= {"result":1}
        Sep-28 12:39:41 PM OS-Debug URL: /cm?pw=a6d82bced638de3def1e9bbb4983225c&sid=9&en=0
        Sep-28 12:39:41 PM OS-Debug SetIOMulti called for: OS-Station10, Command:0
        Sep-28 12:39:41 PM Event Deleting event after run: "Delayed Actions Master Driveway Trees (Delayed Action)"
        Sep-28 12:39:41 PM Device Control Device: OpenSprinkler OpenSprinkler Master Driveway Trees to Off (0)
        Sep-28 12:39:41 PM Event Event Trigger "Delayed Actions Master Driveway Trees (Delayed Action)"
        Sep-28 12:37:56 PM OpenSprinkler Master Driveway Trees is currently on
        Sep-28 12:37:56 PM OS-Debug Code Failed, Setter and result= ERROR: The operation has timed out. 0
        Sep-28 12:37:56 PM OS-Debug Debug Setter= ERROR: The operation has timed out.
        Sep-28 12:37:41 PM OS-Debug URL: /cm?pw=a6d82bced638de3def1e9bbb4983225c&sid=14&en=0
        Sep-28 12:37:41 PM OS-Debug SetIOMulti called for: OS-Station15, Command:0
        Sep-28 12:37:41 PM Event Deleting event after run: "Delayed Actions North Driveway Trees (Delayed Action) - 1"
        Sep-28 12:37:41 PM Device Control Device: OpenSprinkler OpenSprinkler North Driveway Trees to Off (0)
        Sep-28 12:37:41 PM Event Event Trigger "Delayed Actions North Driveway Trees (Delayed Action) - 1"
        Sep-28 12:27:43 PM OpenSprinkler Master Driveway Trees and North Driveway Trees is currently on
        Sep-28 12:27:41 PM OpenSprinkler Zone 15 on successfully set
        Sep-28 12:27:41 PM OS-Debug Debug Setter= {"result":1}
        Sep-28 12:27:41 PM OS-Debug SetIOMulti called for: OS-Station15, Command:361
        Sep-28 12:27:41 PM Event Deleting event after run: "Delayed Actions North Driveway Trees (Delayed Action)"
        Sep-28 12:27:41 PM Device Control Device: OpenSprinkler OpenSprinkler North Driveway Trees to On (361)
        Sep-28 12:27:41 PM Event Event Trigger "Delayed Actions North Driveway Trees (Delayed Action)"
        Sep-28 12:24:42 PM OpenSprinkler Master Driveway Trees is currently on
        Sep-28 12:24:41 PM OpenSprinkler Zone 10 on successfully set
        Sep-28 12:24:41 PM OS-Debug Debug Setter= {"result":1}
        Sep-28 12:24:41 PM OS-Debug SetIOMulti called for: OS-Station10, Command:361
        Sep-28 12:24:41 PM Device Control Device: OpenSprinkler OpenSprinkler Master Driveway Trees to On (361)
        Sep-28 12:24:41 PM Event Event Trigger "Drip Driveway Trees Master On"
        Sep-28 12:24:41 PM Event Event Drip Driveway Trees Master On triggered by the event page 'Run' button.

        Comment


          So on both of those examples it looks like it successfully set the north driveway trees to off, but then never actually received the correct response saying that it did (I'm deducing this because the very next log entry after the failure is always 'Master driveway trees is currently on" - this log entry is set simply because the status changed, the last status being "Master Driveway Trees and North Driveway Trees is currently on). And this status is read from the Opensprinker, it has no knowledge of the command you just sent.

          There's not much I can do I'm afraid, but perhaps you can experiment with adding short 1 sec delays in your events so that HS isn't trying to do two things at once (I am suspicious of the "deleting event after run" in the same timestamp as our failed read).

          Attached is a cleaned up version of the code (just deleted all the temporary debug log entries and fixed the initial problem of getting the misleading error message). But this doesn't have any magic fix for you unfortunately. I'm unable to replicate this error on my system. If it is indeed still always setting the zone off, perhaps just ignore the log entry saying it failed - it is simply just a log entry and won't affect the rest of the plugin functionality.

          Let me know how you go with the event delays. Cheers.
          Attached Files

          Comment


            Thanks for looking into this. I have no control over the "deleting event after run." That's how HomeSeer handles an event that has multiple actions with time delays, i.e., HS expands the event into multiple events and puts them in a "delayed events" queue. When they execute, it also deletes them from that queue. I'm looking into writing an HS script that does all this, because I can add some other features (such as modifying the run times based on OpehSprinkler's "water level" calculation). I did note that there seems to be a difference in whether the command is sent directly using SetIOMulti or indirectly using the CAPI control handler. Shouldn't make a difference, but the actual result is consistently different.

            Comment


              New problem...upgraded hardware to OS 3 (hardware 3.2-AC), firmware 2.19, and I'm the HS OpenSprinkler Plugin version 2.1.8.25 (the one you sent me on Sunday, and the log is full of these messages (every minute):
              Oct-02 5:06:17 PM OS-Debug Error info: bits= 0 0 0 0 0 0
              Oct-02 5:06:17 PM OS-Debug Error info: jc={"devt":1570035975,"nbrd":2,"en":1,"sn1":0,"sn2":0,"rd":0 ,"rdst":0,"sunrise":416,"sunset":1122,"eip":2147483647,"lwc" :1570032860,"lswc":1570032860,"lupt":1570039867,"lrbtc":99," lrun":[0,0,0,0],"RSSI":-74,"loc":"39.43015,-104.70552","jsp":"https://ui.opensprinkler.com/js","wsp":"weather.opensprinkler.com","wto":{"h":100,"t":100 ,"r":100,"bh":40,"bt":70,"br":0.1,"key":"2201e1c333fe4e9781e 1c333fede9712"},"ifkey":"","wtdata":{"h":85.92,"p":0,"t":49. 9,"raining":0},"wterr":0,"curr":358,"sbits":[0,2,0],"ps":[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[99,40185,1570032960],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]}
              Oct-02 5:06:17 PM OS-Debug Error: Failed in attempt to write to Flow Sensor device - Input string was not in a correct format.
              Oct-02 5:06:17 PM OS-Debug Error info: rs=0
              Oct-02 5:06:17 PM OS-Debug Error info: jc={"devt":1570035975,"nbrd":2,"en":1,"sn1":0,"sn2":0,"rd":0 ,"rdst":0,"sunrise":416,"sunset":1122,"eip":2147483647,"lwc" :1570032860,"lswc":1570032860,"lupt":1570039867,"lrbtc":99," lrun":[0,0,0,0],"RSSI":-74,"loc":"39.43015,-104.70552","jsp":"https://ui.opensprinkler.com/js","wsp":"weather.opensprinkler.com","wto":{"h":100,"t":100 ,"r":100,"bh":40,"bt":70,"br":0.1,"key":"2201e1c333fe4e9781e 1c333fede9712"},"ifkey":"","wtdata":{"h":85.92,"p":0,"t":49. 9,"raining":0},"wterr":0,"curr":358,"sbits":[0,2,0],"ps":[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[99,40185,1570032960],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]}
              Oct-02 5:06:17 PM OS-Debug Error: Failed in attempt to write to Rain Sensor device - Input string was not in a correct format.
              I don't have either a flow sensor or a rain sensor, so I'm unclear what's happening.

              Rog

              Comment


                2.1.9 is a new firmware - most likely they've changed something existing (like every other time they update firmware) which I will need to update in the plugin. The first three numbers of the plugin version correspond to the latest OS firmware its been built/tested for. I note the absence of "rs":x in the jc= text string which is usually 0=not used, 1=rain sensor, 2=flow sensor, I'm guessing they've moved or renamed it - I also see one called "raining" - so i'm guessing they renamed it.

                I hate it when they change existing stuff instead of just adding new functionality. Also makes it hard to keep the plugin working for both new and old versions - I'm still on 2.1.6 firmware.

                I'll take a look tonight.

                Comment


                  Yep, they've changed the API in 2.1.9. Things that I don't think are compatible between current plugin and new firmware:
                  1) Rain sensor
                  2) Flow sensor
                  3) Ability to set watering percentage
                  4) Enable/disable a program should still work but not 100% sure.

                  I can update, but will take me longer than i first thought. I won't get to it tonight, will do it some time over the weekend or early next week.
                  I also can't test it so you'll have to be my guinea pig.

                  Cheers.
                  Matt.

                  Comment


                    Happy to be your guinea pig. -- Rog

                    Comment


                      Rog - I replied to your PM...

                      Comment


                        I'm also running firmware 2.1.9 (2) on Hardware 3.2 AC and willing to help test.

                        Comment


                          Originally posted by integlikewhoa View Post
                          I'm also running firmware 2.1.9 (2) on Hardware 3.2 AC and willing to help test.
                          Sorry, I got this working ages ago, just never got around to submitting it to the formal updater. I've just done it, it should appear in the next day or two.

                          Comment


                            New version 2.1.9.2 should now be available which is designed to support firmwares 210 through to 219 inclusive. Let me know if you have any issues.

                            Comment


                              Upgraded to 2.1.9.2 and everything seems to be working. However, from the very beginning of your plugin when HS3 closes, I get this window:

                              Click image for larger version

Name:	0AFAD5F2-3C1A-4045-A555-135FAC9B77D5.jpeg
Views:	580
Size:	73.4 KB
ID:	1338239

                              Any ideas?

                              Thanks!

                              Michael

                              Comment


                                Originally posted by Rvtravlr View Post
                                However, from the very beginning of your plugin when HS3 closes, I get this window:
                                Sorry, I'm not quite following. Is this when HS3 is starting up? Or when HS3 is shutting down? Or when plugin in starting up? etc...

                                Comment

                                Working...
                                X