Announcement

Collapse
No announcement yet.

EZsnsRF (dakota motion sensor) external script

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Gotcha. I'll put the callback function back in.

    Thanks.

    David

    Comment


      #17
      This is exactly what I was hoping for when I put in the external device support. Since SmartHome didn't actually make any sort of generic device support part of their spec it was virtually impossible to support these devices internally without continuously re-writing the plug-in.

      I'm glad to see that it is getting used. I would have preferred to be able to have some sort of generic device support in the plug-in itself for users but that sort of magic just wasn't possible without SmartHome defining something up front.

      The external device support is very low-level at the moment (as you well know) but it does allow you to cooperate with the built-in device support so that things work properly together. The one thing I was think about was adding a call to allow the script to register a link on a compliant remote device (one that supports standard link databases). This would be somewhat difficult since the plug-in would have to download the existing database each time it needed to be updated, but it could be done.

      If there are additional suggestions for additional calls or needed functions from the plug-in itself just let me know and I'll see what I can do.


      Jon




      Originally posted by baudi View Post
      Gotcha. I'll put the callback function back in.

      Thanks.

      David
      Jon Ort
      JonOrt@The--Orts.com
      (Remove the dashes in the address, spam is getting out of hand)

      Comment


        #18
        Jon,

        Is there any documentation of the Insteon plug-in's exposed methods and callbacks, or is what we see in the script the only ones that exist?

        David

        Comment


          #19
          That's it. Register a device, send it some data, get data from it.

          Jon


          Originally posted by baudi View Post
          Jon,

          Is there any documentation of the Insteon plug-in's exposed methods and callbacks, or is what we see in the script the only ones that exist?

          David
          Jon Ort
          JonOrt@The--Orts.com
          (Remove the dashes in the address, spam is getting out of hand)

          Comment


            #20
            Jon,

            A received-raw Insteon data callback would be very helpful. Not just for externally-registered devices, but for devices the plug-in handles itself. The callback should be ByRef instead of ByVal, so we can change what the plug-in sees. Something like:

            Code:
            Function RawInsteonNotification(ByRef InsteonData as Data) as Boolean
                ' process data, make changes, return True or False
                RawInsteonNotification = True
            End Function
            If the callback returns FALSE, the plug-in ignores the packet. If it returns TRUE, the plug-in does whatever it normally does (but the callback may have changed the packet's data).

            HomeSeer's design of only providing notifications on changes is quite limiting for detecting things like double-clicks or triple-clicks. A raw Insteon callback would also let us distinguish FAST OFF from OFF. FAST ON/OFFs get consumed by the plug-in right now, and by the time a notification gets to HomeSeer and thence to an external script, it's reduced to ON/OFF (and only if it's a change).

            I have a little program running in the background now that just samples the stream off the PLC every couple of seconds, looking for FAST OFFs. This is horribly inefficient, and relies on the PLC's buffering between calls, so it's also unreliable.

            Comment


              #21
              That's beyond the scope of external device support, but I do have a system for Insteon specific message triggers.

              Jon
              Originally posted by JeffryD View Post
              Jon,

              A received-raw Insteon data callback would be very helpful. Not just for externally-registered devices, but for devices the plug-in handles itself. The callback should be ByRef instead of ByVal, so we can change what the plug-in sees. Something like:

              Code:
              Function RawInsteonNotification(ByRef InsteonData as Data) as Boolean
                  ' process data, make changes, return True or False
                  RawInsteonNotification = True
              End Function
              If the callback returns FALSE, the plug-in ignores the packet. If it returns TRUE, the plug-in does whatever it normally does (but the callback may have changed the packet's data).

              HomeSeer's design of only providing notifications on changes is quite limiting for detecting things like double-clicks or triple-clicks. A raw Insteon callback would also let us distinguish FAST OFF from OFF. FAST ON/OFFs get consumed by the plug-in right now, and by the time a notification gets to HomeSeer and thence to an external script, it's reduced to ON/OFF (and only if it's a change).

              I have a little program running in the background now that just samples the stream off the PLC every couple of seconds, looking for FAST OFFs. This is horribly inefficient, and relies on the PLC's buffering between calls, so it's also unreliable.
              Jon Ort
              JonOrt@The--Orts.com
              (Remove the dashes in the address, spam is getting out of hand)

              Comment


                #22
                That's probably just as good. Is this system going to be in the PLM plug-in eventually? Any chance it'll get folded back into the PLC plug-in?

                Comment


                  #23
                  I have more work to do but essentially you can trigger on incoming Insteon messages. This allows things like snap-on, etc. to be used to fire events. It will be in the PLM plug-in, right now there are no plans for changes to the PLC version.
                  Jon


                  Originally posted by JeffryD View Post
                  That's probably just as good. Is this system going to be in the PLM plug-in eventually? Any chance it'll get folded back into the PLC plug-in?
                  Jon Ort
                  JonOrt@The--Orts.com
                  (Remove the dashes in the address, spam is getting out of hand)

                  Comment


                    #24
                    I'll have to go to the PLM someday, I suppose, but I'd much rather wait for the next firmware revision (or two).

                    Thanks for working on this stuff for us.

                    Comment


                      #25
                      Originally posted by baudi View Post
                      Tom and Jonathan,

                      I've taken the liberty of generalizing the ExtDevSupport script to make it easier to handle new device types. I've tested the revised version with EZSnsRf, EZX10RF, and RemoteLinc. David
                      First, I am not a programmer and do not want to be one......

                      In laymans terms, are you saying that I can install this script and receive x10 rf via the ezx10rf which will trigger events in HS? Does the ezx10rf send a Insteon signal that the script changes to x10 on/off? I installed the script and when I restarted HS it created devices XXX thru XZZ. Then I commented out all but the EZX10RF in the script and restarted HS again.. This time it created only the X10RF devices. However, those devices never change state/status. ????

                      Comment


                        #26
                        Please read this part of my note.
                        By the way, it turns out not to be necessary to link the EZ devices with another Insteon device to make them visible to HomeSeer. All that's needed is to link the Dakota or X10 devices as broadcast devices. To do that, press and hold the link button on the EZ device for 4 seconds. Then make the RF device fire, then wait for the RF device to time out so that it will fire again, then fire it again. That will make the EZ LED stop blinking. Then press and hold the EZ LED for 4 seconds.
                        Did you do that? If you did, when you cause the RF device to fire, the Homeseer event associated with that device will fire.

                        Comment


                          #27
                          Originally posted by baudi View Post
                          Please read this part of my note.
                          By the way, it turns out not to be necessary to link the EZ devices with another Insteon device to make them visible to HomeSeer. All that's needed is to link the Dakota or X10 devices as broadcast devices. To do that, press and hold the link button on the EZ device for 4 seconds. Then make the RF device fire, then wait for the RF device to time out so that it will fire again, then fire it again. That will make the EZ LED stop blinking. Then press and hold the EZ LED for 4 seconds.
                          Did you do that? If you did, when you cause the RF device to fire, the Homeseer event associated with that device will fire.
                          Yes

                          Comment


                            #28
                            Originally posted by baudi View Post
                            Gotcha. I'll put the callback function back in.
                            1. What is the latest rev of the "Generalized" version? The one I downloaded still has the callback functionality commented out.
                            2. What function can I use to check to see if the 'ExtDev_RegisterExternalDeviceSupport' method has already been called for a given DevAddr? I need to be able to call "CreateDevice" more than once to create multiple ranges of EZX10RF sensors (I need three different HouseCodes); but as it is, calling it more than once throws an exception error stating that '... Duplicate key value supplied ...'. So, I am trying to modify the script to allow multiple calls to the "CreateDevice" method, but only invoke the 'ExtDev_RegisterExternalDeviceSupport' method once per DevAddr. I need to know how to test for the existence of a registered external device, at a given device address.

                            Comment


                              #29
                              Creating the device in HomeSeer and registering device support are completely separate issues. For each separate device ID you need to call Register each time the plug-in starts. CreateDevice is needed to create the HomeSeer device that you see on the status screen. The HomeSeer devices stay once they are created, the Register call *has* to be made each time the plug-in starts.

                              The Register call will not let you register a device twice, rather it will refuse the registration if the device has already been registered. It doesn't throw an exception in that case rather it just doesn't do anything.

                              Jon


                              Originally posted by Tim.Vargo View Post
                              1. What is the latest rev of the "Generalized" version? The one I downloaded still has the callback functionality commented out.
                              2. What function can I use to check to see if the 'ExtDev_RegisterExternalDeviceSupport' method has already been called for a given DevAddr? I need to be able to call "CreateDevice" more than once to create multiple ranges of EZX10RF sensors (I need three different HouseCodes); but as it is, calling it more than once throws an exception error stating that '... Duplicate key value supplied ...'. So, I am trying to modify the script to allow multiple calls to the "CreateDevice" method, but only invoke the 'ExtDev_RegisterExternalDeviceSupport' method once per DevAddr. I need to know how to test for the existence of a registered external device, at a given device address.
                              Jon Ort
                              JonOrt@The--Orts.com
                              (Remove the dashes in the address, spam is getting out of hand)

                              Comment


                                #30
                                Second the callback request.

                                Originally posted by Tim.Vargo View Post
                                1. What is the latest rev of the "Generalized" version? The one I downloaded still has the callback functionality commented out.
                                2. What function can I use to check to see if the 'ExtDev_RegisterExternalDeviceSupport' method has already been called for a given DevAddr? I need to be able to call "CreateDevice" more than once to create multiple ranges of EZX10RF sensors (I need three different HouseCodes); but as it is, calling it more than once throws an exception error stating that '... Duplicate key value supplied ...'. So, I am trying to modify the script to allow multiple calls to the "CreateDevice" method, but only invoke the 'ExtDev_RegisterExternalDeviceSupport' method once per DevAddr. I need to know how to test for the existence of a registered external device, at a given device address.
                                I am also looking for the callback functions back in. I am trying to put it back myself, I will post it if it works.

                                Comment

                                Working...
                                X