Announcement

Collapse
No announcement yet.

ADIOcelot Plugin

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

    Thanks guys for your help.

    At first, finally, I noticed that only relays (Secu16 outputs) has been troubled by the HS 2.3 upgrade. All secu 16 inputs were still OK. Strange ...

    As suggested by Jim S., I deleted and recreated for test only one output on a secu16. It solved the problem for this output only (great !!). I opened the MDB file and check the change at the line of this output. The only one change in this file was in the column "misc". The value changed from -32768 to 32768. All the outputs has the same value. I just replaced -32768 to 32768 for all outputs manually into the MDB file ... and now all outputs are working fine !!!

    If someone understood what's wrong with it, congratulations !!!! Anyway it works ... but ... next time, I would appreciate an upgrade without any surprises like this ... :-)

    Thanks again for your help.
    Last edited by ; November 24, 2008, 10:26 AM.

    Comment


      Problems with Secu16 relay outputs

      Thanks for information regarding why relays weren't working with the HS 2.3. I was not able to get any relays to work without going into the mdb file and changing -32768 to 32768 in the misc column. Even if I created new relay variables using the interface panel, they were created with the -32768. I had to go in and change all of the relay misc values, both existing ones, and new ones. Is there any intention to fix this problem in a new release of the ADIOcelot plugin?

      This isn't the most obvious fix, and if others are like me, I need these relays working to control things like heat pumps, fireplaces, HVAC duct valves. Things that cause grief if they don't work. I hope this very simple change could be made soon and an updated plugin provided to us.

      Thanks again for everyone's input on this problem. I sure would have never figured it out on my own!

      Comment


        Hmmm... I almost never turn my SECU16 or RLY8 devices ON/OFF from the HS web page. Everything on those units is controlled via scripts. Anyway, I just checked it (on HS 2.3.0.9), and found that it certainly does NOT work from the HS web page. I can press the ON and OFF buttons all I want, it updates the page, but nothing happens to the devices. I can do an immediate script command from the Control page and it works fine.

        I'm fairly certain that Michael has no intention of ever upgrading this plug-in again, or at least that has been the indication in the past.

        It sounds more likely to be something wrong with HS. I honestly don't remember the last time I used the HS web pages to try and turn ON or OFF any of these relays, so it may have been something that wasn't working in 2.2 for all I know.

        I'll post a help desk ticket and see what HST says.

        Steve

        Comment


          I have no problem updating the plugin, but I really have no basis to make an update. I did the analysis at http://board.homeseer.com/showthread.php?t=132396. It does seem that HS is handling the misc property differently now even though the interface definition has not changed.

          Comment


            Michael,

            I posted a help desk ticket after my earlier post in this thread. Rupp replied that he didn't know about this thread, so I pointed him to it.

            Steve

            Comment


              Long ago, we added bits to the MISC property that exceeded the number of bits that a short integer will hold. Back in the early days of HomeSeer, that meant using a Long Integer so that you would have enough bits. With today's HomeSeer (.NET platform) the former Integer is now a Short Integer, and the former Long Integer is now an Integer.

              The former integer was 16 bits. 15 bits were used for the numerical value, and the 16th bit was used to indicate positive or negative. The result was a range from 32767 to -32768.

              If bit 15 (16th bit) is turned on and the value is read into a Short Integer (former Integer) then it will be interpreted as -32768. When it is read into an Integer (former Long Integer) then it will be interpreted as 32768.

              It would appear that the MISC property is being moved through an Integer variable in a plug-in developed on a 16 bit platform. If that is changed to a Long Integer, the problem should go away.
              Regards,

              Rick Tinker (a.k.a. "Tink")

              Comment


                So Micheal, what do you think about Rick's response? It certainly seems to sound plausible. 32768/-32768 certainly fits a short Int, and the device class now shows bits in the misc flags above the 16th bit. Is is possible you just need to re-build the misc entry on devices redefined as a long?

                For what it is worth I did put in a help desk ticket, but it's had no response at all other than asking for a link to this discussion. If I were to give HST credit here, I would say they are waiting for you to weigh in.

                Steve

                Comment


                  The development platform is a Vista x64. Device object is obtained through late binding so the target storage area will be whatever HS returns through hs_compatibility.

                  The actual function used to create an output device and the associated dependencies is shown below. It really does seem to me that the plugin is using 32 bit for .misc

                  Code:
                  Public MISC_SETVALUE_NOTIFY As Long
                  
                  100       HS2 = (val(Left(hs.Version, 1)) > 1)
                  110       If HS2 Then
                  120           MISC_SETVALUE_NOTIFY = &H8000&
                  130       Else
                  140           MISC_SETVALUE_NOTIFY = &H0
                  150       End If
                  
                  
                  Public Function CreateOutput16(sDC As String, iUnit As Integer, iInvert As Integer) As Long
                  10        On Error GoTo Error_Exit
                  
                            Dim index As Long
                            Dim sUnit As String
                            Dim sOne As String
                            Dim dv As Object
                  
                  20        index = hsDeviceExists(sDC)
                  30        sUnit = Trim(CStr(iUnit))
                  40        sOne = CStr(CInt(Mid(sDC, 2)) - 8)
                  50        If index = -1 Then
                  60            index = hsNewDevice("Relay Output " + sOne)
                  70            Set dv = hsGetDevice(index)
                  80            With dv
                  90                .location = "Secu16 Unit " + sUnit
                  100               .hc = Left(sDC, 1)
                  110               .dc = Mid(sDC, 2)
                  120               .iotype = IOTYPE_OUTPUT
                  130               .iomisc = sUnit & "!" & CStr(SECU16) & "!" + CStr(CInt(sOne) - 1) & "!" & CStr(iInvert)
                  140               .interface = gInterfaceName
                  150               .Status = NO_X10
                  160               .misc = 0 Or MISC_SETVALUE_NOTIFY            ' On/Off only, no dim
                  170               .dev_type_string = "Interface Output"
                  180           End With
                  190           Set dv = Nothing
                  200       Else
                  210           hsGetDevice(index).iomisc = sUnit & "!" & CStr(SECU16) & "!" + CStr(CInt(sOne) - 1) & "!" & CStr(iInvert)
                  220       End If
                  
                  Normal_Exit:
                  230       CreateOutput16 = index
                  240       Exit Function
                  Error_Exit:
                  250       hsWritelog PLUGIN_NAME, "CreateOutput16"
                  260       Resume Normal_Exit
                  End Function

                  Comment


                    Michael,

                    Any update? There's been no action on my help desk ticket. It sounded like there might be some conversations between HST and you.

                    Steve

                    Comment


                      No activity to my knowledge. The code I posted does appear to comply with Rick's recommendation of using Long data type. I could change the ".misc = " expression to not perform the OR operation or to explicitly typecast the result as Clng, but that is just a guess.

                      Comment


                        Have you attempted to contact HST about it? I'm thinking as one of the real recognized developers you might get a quicker / better response than my help desk ticket.

                        On the other hand, I do virtually everything with my SECU16 / RLY8-XA via scripts, and that seems unaffected by all of this. It just seems broken when the ON/OFF on the web page don't actually do anything.

                        Steve

                        Comment


                          Michael would and did get the same response as you on this issue.

                          Apparently a change was made somewhere in the 2.3.0.0 development to cease the use of short integers. None of us can recall making it and it was too minor for it to have appeared in our check-in notes, and for a few reasons we are not going to go back through the history to see when and who made the change.

                          The change is needed because there are MISC values that exceed the size of a short integer. We have already established that we had very poor beta testing with this release, something we are working on to address with future releases, but if it had been brought to our attention earlier, we would have written a conversion program rather than reverse the change.

                          Furthermore, we have no control over 3rd party plug-ins, so even if we refer to MISC with an Integer now, a plug-in that still uses a Short Integer (Integer on a 16 bit plug-in) will continue to create and work with the devices incorrectly. The documentation on the DeviceClass shows that the MISC property is a Long Integer, which is an Integer in HomeSeer, so even that reflects what it should be.
                          Regards,

                          Rick Tinker (a.k.a. "Tink")

                          Comment


                            Originally posted by Rick Tinker View Post
                            Michael would and did get the same response as you on this issue.
                            Well, since I got no response at all (help desk ticket 18321) except for Rupp asking for the URL to this thread, I guess saying Michael gets the same response doesn't feel too good. If I read your message, you say developers should be using a long int for MISC, and if I read Michaels two messages earlier, it sounds like he thinks he IS using a long int. It sounds to me like everyone thinks its not their problem, so my guess is it stays the way it is. Oh well.

                            Steve

                            Comment


                              Delete the devices and have the plug-in re-create them. If there are no more problems with Integer(Long)-Short Integer(Integer) then it will work fine.
                              Regards,

                              Rick Tinker (a.k.a. "Tink")

                              Comment


                                While I do not think it will make any difference I did remove the "0 OR" from the expresssion where the .misc property is set. It is posted as V1.14.10. I dont know why the rev went from .4 to .10 as I do not recall activity on this plugin.

                                Even if there is an issue of FFFF8000 vs. 00008000 (short vs. long) I do not see why it would make any difference to the operation of the plugin as the "8" bit is the one that affects the SETIO call and it is set in both cases. The only rationalization I can come up with is that there are other undocumented bits in the upper 16 bits that would take priority or HS is not expecting a negative number and this results in unexpected behavior.

                                Comment

                                Working...
                                X