Announcement

Collapse
No announcement yet.

Lotsa problems with Plug-in for X10

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

    Lotsa problems with Plug-in for X10

    Adam,

    Yes, I have the latest version.

    Where to start?

    #1 I have an event that says to Pre-set Dim a light at 23%. The log of an other controller says it is receiving a pre-set dim for 45%. In fact, for all the pre-set dims, another controller is showing double what I specify in HS. Or half of what I specify! The lamps also look brighter/dimmer than they should.

    However, the Insteon log is unclear as to what it is setting the lamp to. Here are what I think are the relevant entries [with commentary]:

    Sep-04 2:53:27 PM CAPIControl: Label=Dim 23%, Value=23, ControlType=Values
    Sep-04 2:53:27 PM Immediate Send X10 Command: O5 Cmd:10 Pcnt:14 Data1: 0 Data2:0 [why is "Pcnt" saying 14?]
    Sep-04 2:53:27 PM Preset Dim level 14 [huh?]
    Sep-04 2:53:27 PM Sending command 02 63 41 00 to RF PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False [ACK=false .. start of more trouble?]
    Sep-04 2:53:27 PM ..Got RF PLM Response 02 63 41 00 06
    Sep-04 2:53:27 PM Sending command 02 63 7A 80 to RF PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
    Sep-04 2:53:27 PM ..Got RF PLM Response 02 63 7A 80 06
    Sep-04 2:53:28 PM Sending command 02 62 1B B9 21 0A 2F 0C to RF PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False

    #2 I'm often seeing PLM Ack=False .. not sure if that's normal behavior but it creates lots of log file entries.

    #3 Is there a way of seeing sent & received X10s -- a fairly routine type of info -- with having to turn on detail logging? I'm getting as much as 10,000 lines of logfile -- each day!

    Thanks....
    Tahl
    Last edited by tahl; September 4, 2017, 06:04 PM.

    #2
    1. whose x10 devices are you using? do they support preset dim? if so, make sure to set this option on the Insteon X10 tab for the hs device.

    2. the log entries you posted are normal

    3. try setting the logging level to debug. you should see the x10 cmds
    Mark

    HS3 Pro 4.2.19.5
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
    Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

    Comment


      #3
      Originally posted by mnsandler View Post
      1. whose x10 devices are you using? do they support preset dim? if so, make sure to set this option on the Insteon X10 tab for the hs device.

      2. the log entries you posted are normal

      3. try setting the logging level to debug. you should see the x10 cmds
      1. I'm doing no more than moving things over from an old system. If I do pre-set dim in your plug-in, it was because it was doing pre-set dim before. All the devices have pre-set dim checked if they support it. You'll note from the post that they _are_ doing pre-set dim just to the wrong level. The "wrong level" is not just visual (it looks wrong) but another controller is reading all X10 and is reporting that it is wrong and your log (appears) to say it is wrong. What is reported is consistent with what I see. To repeat, all the devices are pre-set dimming -- but to the wrong level.

      2. If the log is correct, then I'm not sure it is useful. I send a command for pre-set dim for 23% and it reports a pre-set dim for 14 in the log. I'm not clear on the math. 23 is 1.6x 14 but the math does not hold for other entries. If it says "Pre-set dim Level 14", what is the formula I should use to arrive at 23%?

      3. I can turn on logging level to debug. What should I do with it? I could look at it but I've already been working on the problem for hours and I'm not sure it'll be helpful to me. Do you want it?

      Comment


        #4
        There are actually 2 preset dim commands:

        Presetdim 1 (cmd = 10) gives you access to the first 16 levels (0 to 48%)
        Presetdim 2 (cmd = 11) gives you access to the second 16 levels (52 to 100%)

        Sep-04 2:53:27 PM Immediate Send X10 Command: O5 Cmd:10 Pcnt:14 Data1: 0 Data2:0
        This should equate to about 35%

        I only tested preset with smarthome x10 dimmers. if you have different devices, you may want disable preset options.
        Mark

        HS3 Pro 4.2.19.5
        Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
        Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
        Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

        Comment


          #5
          Originally posted by mnsandler View Post
          There are actually 2 preset dim commands:

          Presetdim 1 (cmd = 10) gives you access to the first 16 levels (0 to 48%)
          Presetdim 2 (cmd = 11) gives you access to the second 16 levels (52 to 100%)



          This should equate to about 35%

          I only tested preset with smarthome x10 dimmers. if you have different devices, you may want disable preset options.
          Huh?

          I said I pre-set dimmed it to 23%. You said I should get about 35%. That doesn't match. If I pre-set dim to 23%, I should actually get 23%.

          I can easily reproduce the problem with the Smarthome dimmer which you said you tested it with. As you dim it up -- using pre-set dim -- the light brightens and dims instead of getting continuously brighter. Pre-set dim does NOT work with Smarthome dimmers or Leviton or any other dimmer.

          In any case, I'm relatively familiar with X10 protocol. Here's likely the problem.

          The Function Code is indeed 10 for pre-set dim of 23%. However, the Number Code for 23 (or 23/3~=7) is NOT 7 which is what you are sending. Number Codes are USE A LOOK-UP TABLE. Are you familiar with this? So 1=0110 (or 6), 2=1110 (or 13), 3=0010 (or 2), etc. That's why as I dim up on the slider, the brightness goes up and down.

          If I set the lamp to 39% you are sending 12 which is incorrect, etc.

          SO if I want a pre-set dim for 23%, it should be:

          Cmd (actually Function Code)=10, NumberCode=2 (or 1110 translated).

          Bottom-line: You are logging FuncCode=10 and NumberCode=14 (the translated) which is correct .. but what you report and what you send are not the same thing. I have an X10 PROTOTYPE ANALYZER and can read what's on the wire.

          Please fix. If you need the translation table, please advise.

          Comment


            #6
            please post the preset lookup table you are referring to and i will review
            Mark

            HS3 Pro 4.2.19.5
            Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
            Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
            Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

            Comment


              #7
              Originally posted by mnsandler View Post
              please post the preset lookup table you are referring to and i will review
              I've included the pre-set dim scheme as well as the table. This comes from the manual for the official X10 signal analyzer. You can also look at the technical note on the PL513 or TW523 from X-10, Inc.

              An example:
              I want to pre-set dim O5 to 39%, it would look like O5 then KPD (house code K, pre-set dim) on the wire. Focusing on the 2nd transmission KPD:

              32 [number of levels] * .39 ~= 12
              Binary for 12 is 01100 [5 bits used for 32 possible levels]
              2nd transmission is L1 L2 L3 L4 1 0 1 L5 so therefore
              The 2nd transmission would be 0011 1010 which is K PD [using table for K]
              >>Note the reversal of the bits; i.e., L1 comes first <<

              Try it with this scheme. You'll note that as you click the slider in Dev Mgmt from 0 to 100, it should become increasingly brighter. Right now, the brightness goes up and down as you click from 0 to 100.
              Attached Files

              Comment


                #8
                I use the following code to convert the dim level 0-100 to the preset dim number (0-15)

                can you please review and post any recommended changes

                Select Case dimlevel
                Case 0, 51 To 52
                Result = 0

                Case 1 To 3, 53 To 55
                Result = 8

                Case 4 To 6, 56 To 58
                Result = 4

                Case 7 To 10, 59 To 61
                Result = 12

                Case 11 To 13, 62 To 65
                Result = 2

                Case 13 To 16, 66 To 68
                Result = 10

                Case 17 To 19, 69 To 71
                Result = 6

                Case 20 To 23, 72 To 74
                Result = 14

                Case 24 To 26, 75 To 77
                Result = 1

                Case 27 To 29, 78 To 81
                Result = 9

                Case 30 To 32, 82 To 84
                Result = 5

                Case 33 To 35, 85 To 87
                Result = 13

                Case 36 To 39, 88 To 90
                Result = 3

                Case 40 To 42, 91 To 94
                Result = 11

                Case 43 To 45, 95 To 97
                Result = 7

                Case 46 To 50, 98 To 100
                Result = 15

                Case Else
                Result = 0

                End Select
                Mark

                HS3 Pro 4.2.19.5
                Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                Comment


                  #9
                  I think I used the following table to develop the preset mapping

                  http://kbase.x10.com/wiki/Using_Pre-Set_Dim
                  Mark

                  HS3 Pro 4.2.19.5
                  Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                  Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                  Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                  Comment


                    #10
                    Originally posted by mnsandler View Post
                    I use the following code to convert the dim level 0-100 to the preset dim number (0-15)

                    can you please review and post any recommended changes
                    That Select structure looks correct but it is incomplete.

                    Here's what you need have as the second transmission after the original HouseCode-UnitCode:

                    2ndXmit = Result * 16 + 10 (for 0-50 dim levels) OR
                    2ndXmit = Result * 16 + 11 (for 51-100)

                    In other words, your Result var should be moved to the Most Sig Nibble (top 4 bits) and then add the Cmd code (for bottom 4 bits).

                    For example, for preset dim of 23% of O5 send this as 2nd transmission:
                    1110 or 14 from your select statement * 16 + 10 = 234
                    234 = 1110 1010

                    Comment


                      #11
                      I think I found my issue. I was re-encoding my 'Result' value instead of just converting it to Hex.

                      i'll post an update here for you to try before I put it in the updater.

                      thanks for identifying this. Funny how no one has noticed this; but most don't use x10 for dimmers anymore especially with this plugin
                      Mark

                      HS3 Pro 4.2.19.5
                      Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                      Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                      Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                      Comment


                        #12
                        Happy to test it and get this problem resolved.

                        Comment


                          #13
                          here you go, v3.0.6.20
                          shutdown the insteon plugin
                          from the zip: copy the .exe and insteon.dll to your homeseer root folder. restart plugin
                          Attached Files
                          Mark

                          HS3 Pro 4.2.19.5
                          Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                          Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                          Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                          Comment


                            #14
                            This new version appears to work.

                            Before you finalize it, it would be appreciated if you could make transmit or receipt of X10 a regular-level logging item vs. a detail-level logging item. Just a simple J5, for example, was received or sent, etc. At the detail level of logging, I'm getting up to 10,000 lines of log a day.

                            Thanks.

                            Comment


                              #15
                              Originally posted by tahl View Post
                              This new version appears to work.

                              Before you finalize it, it would be appreciated if you could make transmit or receipt of X10 a regular-level logging item vs. a detail-level logging item. Just a simple J5, for example, was received or sent, etc. At the detail level of logging, I'm getting up to 10,000 lines of log a day.

                              Thanks.
                              ok. on the logging

                              with the previous change, I also had to fix the status polling. I'll post the next version in the Beta section of the Updater
                              Mark

                              HS3 Pro 4.2.19.5
                              Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                              Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                              Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                              Comment

                              Working...
                              X