Announcement

Collapse
No announcement yet.

Super slow PLCBUS scene change (HS3 only)

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

    Super slow PLCBUS scene change (HS3 only)

    I've finally migrated to HS3, overall I'm loving HS3 and also Stipus' PLCBUS plugin for HS3. But I've encountered a very annoying issue.. I hope it's something simple to fix or I've just overlooked something:

    The problem is about PLCBUS scene activation on HS3.... so I've already reprogrammed a couple of my existing scenes with this new plugin. Before the reprogram, the scenes turned on very quickly.. near instantly... but now, it turns on very slow (10-20+ seconds delay!). Why is this?

    I have one scene that includes 5 devices, delayed for 20-25 seconds on both Turn ON and OFF. I have another scene that only includes 2 devices, this one gets delayed for 'only' 10-15 seconds on both ON and OFF operation.

    I've checked for signal:noise on each of the modules involved (all 7 of them), two of them have low signal(11-13), the other three are good (17-22)... as for the noise, they're all 0.

    I've also tried turning WaitForAck off, that didn't help.

    Log (with plcbus debug mode: on)

    Code:
    Mar-25 2:21:51 PM	 	PLCBUS Debug	InterfaceStatus[] - selected=[True] configured=[True] connected=[True]
    Mar-25 2:21:49 PM	 	PLCBUS Debug	InterfaceStatus[] - selected=[True] configured=[True] connected=[True]
    Mar-25 2:21:47 PM	 	PLCBUS Debug	InterfaceStatus[] - selected=[True] configured=[True] connected=[True]
    Mar-25 2:21:45 PM	 	PLCBUS Debug	Rcvd Ack: (138) M5 On Data1:100 Data2:0 Tx:False AckReq:True Ack:True IDreq:False Id:False 3PhReq:True RiscOK:False PlcBusOK:False
    Mar-25 2:21:45 PM	 	PLCBUS Debug	Sent: (138) M5 On Data1:100 Data2:0 Tx:True AckReq:True Ack:False IDreq:False Id:False 3PhReq:True RiscOK:True PlcBusOK:True
    Mar-25 2:21:43 PM	 	PLCBUS Device	Device [138-M5] status set to [On]
    Mar-25 2:21:43 PM	 	PLCBUS Debug	Sending: (138) M5 On Data1:0 Data2:0 Tx:False AckReq:True Ack:False IDreq:False Id:False 3PhReq:True RiscOK:False PlcBusOK:False
    Mar-25 2:21:39 PM	 	PLCBUS Device	Device [138-H11] status set to [On]
    Mar-25 2:21:34 PM	 	PLCBUS Device	Device [138-P3] status set to [On]
    Mar-25 2:21:32 PM	 	PLCBUS Device	Device [138-P2] status set to [On]
    Mar-25 2:21:26 PM	 	PLCBUS Device	Device [138-P10] status set to [On]
    Mar-25 2:21:22 PM	 	PLCBUS Device	Device [138-G1] status set to [On]
    Mar-25 2:21:22 PM	 	PLCBUS Debug	SetIO[] name=[Scene : Night Lights (Indoor)] address=[138-M5] type=[PlcBus Scene] controlValue=[101]
    Mar-25 2:21:22 PM	 	Device Control	Device: Hall Scene : Night Lights (Indoor) to On (101) by/from: CAPI Control Handler
    Mar-25 2:21:21 PM	 	PLCBUS Debug	InterfaceStatus[] - selected=[True] configured=[True] connected=[True]
    Mar-25 2:21:19 PM	 	PLCBUS Debug	InterfaceStatus[] - selected=[True] configured=[True] connected=[True]
    Mar-25 2:21:17 PM	 	PLCBUS Debug	InterfaceStatus[] - selected=[True] configured=[True] connected=[True]
    (clicked 'ON' at 2:21:17, actual lights turned on (all together) at around 2:21:50)

    PS: On the positive side, it seems that this plugin ensures 100% activation of all the devices. I wonder if the mechanism can be changed, so it just fires the scene activation immediately like it used to do, then do the correction afterward.. only if needed.
    HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

    Google Search for HomeSeer Forum

    #2
    Honestly I don't understand what's happening

    From your log I can see you pressed ON at 2:21:22 and the plugin sent the PLCBUS command at 2:21:43 !!!!

    How many HomeSeer devices do you have (total) ?
    How many PLCBUS devices ?

    I know the plugin iterates all devices to change their HomeSeer status if it is different from the scene programming. It seems this process takes 20 seconds on your server... ????
    --
    stipus

    Comment


      #3
      Originally posted by stipus View Post
      Honestly I don't understand what's happening

      From your log I can see you pressed ON at 2:21:22 and the plugin sent the PLCBUS command at 2:21:43 !!!!
      Yes, in actuality I pressed ON at :17. This delay only happens with the 'new' PLCBUS scenes btw. All other devices (single PLCBUS, zwave, etc) all respond instantly. The 'old' PLCBUS scenes (the ones I've already made since HS2 days that I didn't 'reprogram' under HS3) also works instantly.

      How many HomeSeer devices do you have (total) ?
      How many PLCBUS devices ?
      There are 350+ items registered by HS3, but a lot of control/supporting devices... the actual hardware devices are probably around 120-ish. 70 of them are PLCBUS.

      I know the plugin iterates all devices to change their HomeSeer status if it is different from the scene programming. It seems this process takes 20 seconds on your server... ????
      That's correct. 20-25seconds for scenes with 5-6 devices (M5 and M6).
      I have another scene that only includes 2 device, that one takes 10-15s (M3).
      But my M2 scene which I haven't reprogrammed with the HS3 plugin actually has 11 or so devices programmed in it, and that one still works INSTANTLY.



      My guess is that this plugin polls the devices first, before firing the scene command? I mean, the more devices the scene contain, the longer it takes for me... for those without devices listed, it fires instantly.
      HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

      Google Search for HomeSeer Forum

      Comment


        #4
        No the plugin doesn't "poll" the devices using any PLCBUS command.

        The plugin iterates all devices to check if they have a HomeSeer status different than the scene programming, to fix this status.

        This is what you see here in your log:

        PHP Code:
        Mar-25 2:21:22 PM         Device Control    DeviceHall Scene Night Lights (Indoorto On (101by/fromCAPI Control Handler 
        This is the HomeSeer log saying you pressed the button

        PHP Code:
        Mar-25 2:21:22 PM         PLCBUS Debug    SetIO[] name=[Scene Night Lights (Indoor)] address=[138-M5type=[PlcBus ScenecontrolValue=[101
        This is the PLCBUS plugin log saying it received the command from HomeSeer (at the same time)

        PHP Code:
        Mar-25 2:21:22 PM         PLCBUS Device    Device [138-G1status set to [On
        This is again a PLCBUS plugin log saying it fixed the HomeSeer status of the first scene device (notice it's again at the same time)

        PHP Code:
        Mar-25 2:21:26 PM         PLCBUS Device    Device [138-P10status set to [On
        Again a PLCBUS plugin log saying it fixed the status of the second device... notice the 4 second delay .... this what I don't understand....

        PHP Code:
        Mar-25 2:21:32 PM         PLCBUS Device    Device [138-P2status set to [On
        Same with a 6 second delay...

        PHP Code:
        Mar-25 2:21:34 PM         PLCBUS Device    Device [138-P3status set to [On
        2 second delay...

        PHP Code:
        Mar-25 2:21:39 PM         PLCBUS Device    Device [138-H11status set to [On
        5 seconds delay ...

        PHP Code:
        Mar-25 2:21:43 PM         PLCBUS Debug    Sending: (138M5 On Data1:0 Data2:0 Tx:False AckReq:True Ack:False IDreq:False Id:False 3PhReq:True RiscOK:False PlcBusOK:False 
        All status have been fixed according to the scene programming... now the plugin tries to send the PLCBIS scene ON command

        PHP Code:
        Mar-25 2:21:43 PM         PLCBUS Device    Device [138-M5status set to [On
        And sets the scene device to ON

        PHP Code:
        Mar-25 2:21:45 PM         PLCBUS Debug    Sent: (138M5 On Data1:100 Data2:0 Tx:True AckReq:True Ack:False IDreq:False Id:False 3PhReq:True RiscOK:True PlcBusOK:True 
        This is an acknowledgement that the PLCBUS command has really been sent.

        I have to double-check the code for those delays I really don't understand... I have many scenes programmed here at home, and I don't see this behavior (However I don't have 350 devices).
        --
        stipus

        Comment


          #5
          Thanks for the play by play.

          I've retested the scenes to watch for resource usage, and that does seem to be the problem here. My normal cpu isage hovers at 20-30% (hometroller s4), and during the scenes execution cpu usage went up and stayed at 100% during the 20-25 seconds, then immediately came down to normal levels after the scenes finished executing.
          HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

          Google Search for HomeSeer Forum

          Comment


            #6
            Hi stipus, any more thoughts on this issue?

            Just to confirm the issue, I tried creating other (duplicate) scenes pointing to the same address without programming it with HS3. These scenes works as fast (near instant) as normal. So as long as the PLCBUS scene does not know what exact lights it controls, I have no problem. But once I see these small text in brackets... I'm in trouble:



            So.. exactly what does the plugin do to those listed devices, before firing the scene command? And why does it need to do that?
            HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

            Google Search for HomeSeer Forum

            Comment


              #7
              The plugin iterates all devices to check if they have a HomeSeer status different than the scene programming, to fix this status.

              --> There must be a bug or something wrong in the code when there are many devices.
              --> I'm going to have a look and fix this problem.
              --
              stipus

              Comment


                #8
                Originally posted by stipus View Post
                The plugin iterates all devices to check if they have a HomeSeer status different than the scene programming, to fix this status.
                Before or after transmitting the scene code?
                I remember you said it doesn't involve polling the devices? (Becaue some of my devies cannot be polled reliably and may take awhile to do).

                --> There must be a bug or something wrong in the code when there are many devices.
                --> I'm going to have a look and fix this problem.
                Thank you very much.
                HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

                Google Search for HomeSeer Forum

                Comment


                  #9
                  There is no PLCBUS command sent to any device before the PLCBUS ON/OFF scene command is sent. You would see those commands in the debug log if there were any...

                  If you have a scene D8-ON with A1 30%, C1 50%, C2 80% then when you send D8-ON, the plugin iterates all HomeSeer devices to check their HomeSeer Status

                  - If the HomeSeer status for A1 is not 30%, then the status is set to 30%
                  - If the HomeSeer status for C1 is not 50%, then the status is set to 50%
                  - If the HomeSeer status for C2 is not 80%, then the status is set to 80%

                  Then as far as I can remember, there is some kind of recursive call to switch some other scene status OFF

                  If you have an other scene D9-ON that is set to A1 30%, C1 10%, C2 10%, then when you press D8-ON, the status for D9 is set to OFF because C1 and C2 status are not 10% anymore...

                  I'll check the code to see what I can do to improve performance.
                  --
                  stipus

                  Comment


                    #10
                    Originally posted by stipus View Post
                    If you have an other scene D9-ON that is set to A1 30%, C1 10%, C2 10%, then when you press D8-ON, the status for D9 is set to OFF because C1 and C2 status are not 10% anymore...

                    I'll check the code to see what I can do to improve performance.
                    Ohh.. it checks for scene overlaps? That makes sense if you want to ensure all Scene:ON condition is valid. Though a 'scene clash' as you've described is not the only reason that can happen.

                    If it's possible to just optionally disable this 'feature', then I'd love to disable it since I don't use that. This is beyond PLCBUS' own spec and that's actually not the behaviour that I expect out of my PLCBUS system (scenes' status turning on/off automatically when other scenes that may overlap it are triggered).
                    HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

                    Google Search for HomeSeer Forum

                    Comment


                      #11
                      Originally posted by stipus View Post
                      There is no PLCBUS command sent to any device before the PLCBUS ON/OFF scene command is sent. You would see those commands in the debug log if there were any...

                      If you have a scene D8-ON with A1 30%, C1 50%, C2 80% then when you send D8-ON, the plugin iterates all HomeSeer devices to check their HomeSeer Status

                      - If the HomeSeer status for A1 is not 30%, then the status is set to 30%
                      - If the HomeSeer status for C1 is not 50%, then the status is set to 50%
                      - If the HomeSeer status for C2 is not 80%, then the status is set to 80%

                      Then as far as I can remember, there is some kind of recursive call to switch some other scene status OFF

                      If you have an other scene D9-ON that is set to A1 30%, C1 10%, C2 10%, then when you press D8-ON, the status for D9 is set to OFF because C1 and C2 status are not 10% anymore...

                      I'll check the code to see what I can do to improve performance.
                      Hi Stipus,

                      Any updates on this issue? I've upgraded my server to a 4-core Atom Avoton (C2550)... the server idles at around 5-7% now, the RAM is 8GB.. the drive is SSD... so it should have plenty of extra resource.... but PLCBUS scene activation still takes 10 seconds (!). It's cut down quite a lot from before, but still??
                      HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

                      Google Search for HomeSeer Forum

                      Comment


                        #12
                        I know there must be a bug, but I couldn't find some spare time to work on it.

                        I'll tell you as soon as I started working on the problem.
                        --
                        stipus

                        Comment


                          #13
                          Originally posted by stipus View Post
                          I know there must be a bug, but I couldn't find some spare time to work on it.

                          I'll tell you as soon as I started working on the problem.
                          Thanks a lot.

                          Is there anyway to just disable the enumeration for now? I mean, before i 'reprogrammed' those scenes with the HS3 plugin, your plugin handled the scenes pretty much instantly. Before it was aware what devices and their states are for each scene.

                          Alternatively i can change these scenes to different (inactive)addresses and just create temporary new devices for the scenes without reporgramming those?
                          HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

                          Google Search for HomeSeer Forum

                          Comment


                            #14
                            I think you could:

                            - Delete the PlcBus Scene HomeSeer devices (this won't change PLCBUS scene programming)

                            - Create a PlcBus Appliance HomeSeer device with the same HouseCode / DeviceCode.

                            --> Then try ON/OFF on the PlcBus Appliance HomeSeer device. It should work and command the Scene.
                            --
                            stipus

                            Comment


                              #15
                              Originally posted by stipus View Post
                              I think you could:

                              - Delete the PlcBus Scene HomeSeer devices (this won't change PLCBUS scene programming)

                              - Create a PlcBus Appliance HomeSeer device with the same HouseCode / DeviceCode.

                              --> Then try ON/OFF on the PlcBus Appliance HomeSeer device. It should work and command the Scene.
                              Yes, that's what I had before I reprogrammed them to be aware of what the devices with your plugin. It's just that I have quite a few scenes, and some of them controls more than half a dozen devices. It would take awhile to reprogram them when you've fixed it.

                              My idea was to change the address of my current scenes (park them to a non-active address), then make the new simple scene as you suggested. When you've fixed the bug, then I can just delete these simple scene devices, and change back the address of the original scenes. Right?
                              (Does that make sense)
                              HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

                              Google Search for HomeSeer Forum

                              Comment

                              Working...
                              X