Announcement

Collapse
No announcement yet.

Plugin does not allow correct counter value changes via script

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

    Plugin does not allow correct counter value changes via script

    I have the latest plugin: 3.0.6319.33899. Just noticed a problem. I use a counter (01) in the Elk as a flag to set watering values for my my sprinkler system.

    I use immediate scripts in HSTouch that sets the value to either 0 or 1 or 2.

    Here is the immediate script used in HSTouch:

    [$SCRIPT=&n(hs.PluginFunction("UltraM1G3", "", "WriteCounterValue", New Object() {"01", "0"}))]

    This throws an error in the log: No response/improper response from Elk M1 to command 'cx010000000' error message repeat in groups of three.

    Setting it to any other value other than 0 works:
    [$SCRIPT=&n(hs.PluginFunction("UltraM1G3", "", "WriteCounterValue", New Object() {"01", "1"}))]
    [$SCRIPT=&n(hs.PluginFunction("UltraM1G3", "", "WriteCounterValue", New Object() {"01", "2"}))]

    Both work fine and the counter device both Elk and in HS updates accordingly. Setting it to 0 consistently throws up that error and the device and Elk does not update the counter value.

    What Am I doing wrong or is the plugin messing up counter value of 0?

    #2
    Hi srodgers,

    I tested your script commands on both of my system and they worked fine. I set counter 09 on my system to 0, 1, 2, 1, 0 and they all updated within issue. I also set the counter to 0 in an event and didn't see any errors. The command you posted is the proper command to send to the Elk M1 to set counter 1 to value 0.

    I think what's going on is that there is counter polling going on while you're setting that counter and the command to query those counter values appar to be failing. Can you confirm your seeing something like:

    Code:
    Apr-23 9:11:57 PM         Warning    No response/improper response from Elk M1 to command 'cv0100'   
    Apr-23 9:11:57 PM         Warning    No response/improper response from Elk M1 to command 'cv0100'   
    Apr-23 9:11:53 PM         Warning    No response/improper response from Elk M1 to command 'cv0100'
    Please also check again to confirm the counter isn't being sent, because I cannot find any reason why that command would fail.

    Regards,
    Ultrajones
    Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

    Comment


      #3
      Will do so testing. I use the counter value in HSTouch to display some graphics conditionally based on counter value.

      Would that constantly poll the value as you describe?

      I can click the three seperate buttons in HSTouch that fire off one of the three scripts that updates the counter values of 0,1,2 and 1 and 2 work and graphics status changes but not the zero. I use them as a flag for running sprinkler cycles:0=AM , 1=PM, 2=AM/PM or both run times for twice daily sprinkler cycle.

      Just check again and it only throws the error for the zero.

      Code:
      Apr-23 8:58:24 PM	 	Warning	No response/improper response from Elk M1 to command 'cx010000000'
      Apr-23 8:58:23 PM	 	Warning	No response/improper response from Elk M1 to command 'cx010000000'
      Apr-23 8:58:21 PM	 	Warning	No response/improper response from Elk M1 to command 'cx010000000'
      Apr-23 8:58:18 PM	 	Info	Running immediate script: C:\Program Files (x86)\HomeSeer HS3\Temp\K2.vb
      K2.vb is the temp file created from the immediate script in HSTouch:

      Code:
      Function Main(parm as object)
      dim result as object
      result=(hs.PluginFunction("UltraM1G3", "", "WriteCounterValue", New Object() {"01", "0"}))
      return(result)
      End Function

      Comment


        #4
        Updateed to latest plugin and still have the same problem. I even confirmed it throws the same error when setting a Elk counter via HS Events as well.

        Code:
        Apr-26 8:12:14 PM	 	Event	Event Trigger "Sprinkler ChangeElkCounter_2"
        Apr-26 8:12:14 PM	 	Event	Event Sprinkler ChangeElkCounter_2 triggered by the event page 'Run' button.
        Apr-26 8:11:58 PM	 	Event	Event Trigger "Sprinkler ChangeElkCounter_1"
        Apr-26 8:11:58 PM	 	Event	Event Sprinkler ChangeElkCounter_1 triggered by the event page 'Run' button.
        Apr-26 8:11:24 PM	 	Warning	No response/improper response from Elk M1 to command 'cx010000000'
        Apr-26 8:11:22 PM	 	Warning	No response/improper response from Elk M1 to command 'cx010000000'
        Apr-26 8:11:21 PM	 	Warning	No response/improper response from Elk M1 to command 'cx010000000'
        Apr-26 8:11:19 PM	 	Event	Event Trigger "Sprinkler ChangeElkCounter_0"
        Apr-26 8:11:19 PM	 	Event	Event Sprinkler ChangeElkCounter_0 triggered by the event page 'Run' button.
        Not sure what else I can try. I don't have anything polling the counter values. There is a HS device created for it that displays the counter value and have some custom graphics there for values 0,1,2 to display a AM,PM,AM/PM icon for display in web page of Device page of HS.
        Attached Files

        Comment


          #5
          Hi,

          Please enable debug following https://forums.homeseer.com/showthread.php?t=130803, then run your script, then send me the debug output.

          Regards,
          Ultrajones
          Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

          Comment


            #6
            Debug Log sent.

            Comment


              #7
              Here are the Elk firmware versions in case that helps:
              Attached Files

              Comment


                #8
                For reasons unknown, your Elk M1 is not sending a response to the command. You'll notice in the logs that when you send cx010000100, the response 0DCV01000010041 is received (we are waiting for the CV response). However, when you send cx010000000, your Elk M1 is not responding with anything. The plug-in waits 1.5 seconds, then sends the command again, but doesn't response the CV response. It sends the command 1 more time, but never gets the CV response.

                Regards,
                Ultrajones
                Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

                Comment


                  #9
                  Originally posted by srodgers View Post
                  Here are the Elk firmware versions in case that helps:
                  I have the following firmware loaded:

                  M1 Firmware: 5.3.10
                  M1XEP Firmware: 2.0.42

                  In order to get to 5.3, I had to replace my GE wireless receiver with the newly updated version.

                  You may want to contact Elk Tech Support to see if that's a known issue with the firmware you are running.

                  Regards,
                  Ultrajones
                  Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

                  Comment


                    #10
                    What do I ask Elk support? Sending Elk command XXXXXXXX results in xxxxxxxx?

                    Comment


                      #11
                      I just noticed tis in the log:

                      Code:
                      4/26/2017 8:32:56 PM...Debug~~!~~Sending command: 'cx010000000' to Elk M1, attempt # 3
                      4/26/2017 8:32:56 PM...Debug~~!~~Sending 0Dcx0100000000
                      There is an extra zero vs what is logged from what is sent. Is that a problem or just an extra zero in debug coding?

                      Custom Value 1:
                      Code:
                      4/26/2017 8:32:47 PM...Debug~~!~~WriteCounterValue() is writting custom value 01 1.
                      4/26/2017 8:32:47 PM...Debug~~!~~Sending command: 'cx010000100' to Elk M1, attempt # 1
                      4/26/2017 8:32:47 PM...Debug~~!~~Entered SendToM1G() function.
                      4/26/2017 8:32:47 PM...Debug~~!~~Sending 0Dcx010000100FF
                      Is there a checksum or something on the end or do the commands have different lengths?

                      Comment


                        #12
                        I have been testing with counter 9 on my system because I had counter 1 in use. I just switched to counter 1 and I am now seeing the same issue. When I switch to counter 2, I am not seeing any issues. Switched back to counter 1 and I am seeing the errors again. It appears to be an issue isolated to counter 1 and setting the value to 0.

                        Can you duplicate my findings?

                        Regards,
                        Ultrajones
                        Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

                        Comment


                          #13
                          Originally posted by srodgers View Post
                          I just noticed tis in the log:

                          Code:
                          4/26/2017 8:32:56 PM...Debug~~!~~Sending command: 'cx010000000' to Elk M1, attempt # 3
                          4/26/2017 8:32:56 PM...Debug~~!~~Sending 0Dcx0100000000
                          There is an extra zero vs what is logged from what is sent. Is that a problem or just an extra zero in debug coding?

                          Custom Value 1:
                          Code:
                          4/26/2017 8:32:47 PM...Debug~~!~~WriteCounterValue() is writting custom value 01 1.
                          4/26/2017 8:32:47 PM...Debug~~!~~Sending command: 'cx010000100' to Elk M1, attempt # 1
                          4/26/2017 8:32:47 PM...Debug~~!~~Entered SendToM1G() function.
                          4/26/2017 8:32:47 PM...Debug~~!~~Sending 0Dcx010000100FF
                          Is there a checksum or something on the end or do the commands have different lengths?
                          Yes, the 2 leading ASCII characters are the length and the last 2 characters are the checksum.
                          Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

                          Comment


                            #14
                            Originally posted by Ultrajones View Post
                            Yes, the 2 leading ASCII characters are the length and the last 2 characters are the checksum.
                            The one that fails is one digit shorter than the ones that works.

                            Sending 0Dcx0100000000 for setting counter 01 to value 0
                            vs
                            Sending 0Dcx010000100FF for setting counter 01 to value 1
                            vs
                            Sending 0Dcx010000200FE for setting counter 01 to value 2


                            I am not a programmer but just noticed this and thought maybe that was a problem.

                            Will try a different counter to try and duplicate what you said earlier then gotta wrap up till tomorrow.

                            Comment


                              #15
                              Thank you for bringing that to my attention again. It looks like a checksum of 00 is being truncated to just 0. I'll look into this tomorrow and will report back.

                              Regards,
                              Ultrajones
                              Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

                              Comment

                              Working...
                              X