Announcement

Collapse
No announcement yet.

Polling All Devices

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

    #16
    I’m at a loss.
    • Are all of your devices not reporting status when operated manually?
    • Can you control all of them through HomeSeer?
    • Are any of them Z-Wave plus devices?
    • When you control them manually is a Device Control entry in the log?
    • When you ran the script were there entries for every device polled?
    • Were there any errors in the log when they were being polled?
    • Are there anyberrors when you control a device manually?
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #17
      Originally posted by rprade View Post
      I’m at a loss.
      • Are all of your devices not reporting status when operated manually? yes, just AC powered devices. Door lock is updating in HS.
      • Can you control all of them through HomeSeer? Yes
      • Are any of them Z-Wave plus devices? I'm sure some are
      • When you control them manually is a Device Control entry in the log? No
      • When you ran the script were there entries for every device polled? It looks like it
      • Were there any errors in the log when they were being polled? No errors but one device did not respond. it's unplugged right now
      • Are there anyberrors when you control a device manually? No, no log entries
      I put the script back in and tried again.


      Sep-03 10:11:14 PM Polling Device: Bedroom Light (99)
      Sep-03 10:11:14 PM Polling Device: AC Temp (98)
      Sep-03 10:11:14 PM Polling Device: Sensor Binary (97)
      Sep-03 10:11:14 PM Polling Device: General Purpose Alarm (96)
      Sep-03 10:11:14 PM Polling Device: System Notification (95)
      Sep-03 10:11:14 PM Polling Device: Home Security (94)
      Sep-03 10:11:13 PM Polling Device: Access Control Notification (93)
      Sep-03 10:11:13 PM Polling Device: Heat Notification (92)
      Sep-03 10:11:13 PM Polling Device: Battery (91)
      Sep-03 10:11:13 PM Polling Device: Application Status (90)
      Sep-03 10:11:13 PM Polling Device: Fibaro Notification Sensor (89)
      Sep-03 10:11:13 PM Polling Device: Krystle Light (88)
      Sep-03 10:11:13 PM Polling Device: SmartStick (87)
      Sep-03 10:11:13 PM Polling Device: Zooz Outlet (86)
      Sep-03 10:11:13 PM Polling Device: Amperes (85)
      Sep-03 10:11:12 PM Z-Wave Device: Node 16 Zooz Outlet Volts Set to 123.793 (123.793 Volts)
      Sep-03 10:11:12 PM Polling Device: Volts (84)
      Sep-03 10:11:12 PM Z-Wave Device: Node 23 Garage Outlet Watts Set to 9.875 (9.875 Watts)
      Sep-03 10:11:12 PM Polling Device: Watts (83)
      Sep-03 10:11:12 PM Polling Device: kW Hours (82)
      Sep-03 10:11:12 PM Polling Device: Zooz Switch Binary (81)
      Sep-03 10:11:11 PM Polling Device: Notification (41)
      Sep-03 10:11:11 PM Polling Device: Door Lock Logging (40)
      Sep-03 10:11:09 PM Polling Device: Door Lock (39)
      Sep-03 10:11:09 PM Z-Wave Device: Node 16 Zooz Outlet Watts Set to 2.369 (2.369 Watts)
      Sep-03 10:11:07 PM Polling Device: Battery (38)
      Sep-03 10:11:07 PM Polling Device: Assa Abloy Entry Control (37)
      Sep-03 10:11:07 PM Polling Device: Attic Temp (36)
      Sep-03 10:11:07 PM Polling Device: Sensor Binary (35)
      Sep-03 10:11:07 PM Polling Device: General Purpose Alarm (34)
      Sep-03 10:11:07 PM Polling Device: System Notification (33)
      Sep-03 10:11:07 PM Polling Device: Home Security (32)
      Sep-03 10:11:06 PM Polling Device: Access Control Notification (31)
      Sep-03 10:11:06 PM Polling Device: Heat Notification (30)
      Sep-03 10:11:06 PM Polling Device: Hall Light (3)
      Sep-03 10:11:06 PM Polling Device: Battery (29)
      Sep-03 10:11:06 PM Polling Device: Application Status (28)
      Sep-03 10:11:06 PM Polling Device: Fibaro Notification Sensor (27)
      Sep-03 10:11:06 PM Z-Wave Device: Node 17 Temp Sensor 1 AC Temp Set to 71.258 (F)
      Sep-03 10:11:06 PM Polling Device: Door Bell (23)
      Sep-03 10:11:06 PM Polling Device: Home Security (22)
      Sep-03 10:11:06 PM Polling Device: Battery (21)
      Sep-03 10:11:06 PM Polling Device: Vision Sec On/Off Sensor (20)
      Sep-03 10:11:06 PM Polling Device: Bedroom Door (19)
      Sep-03 10:11:05 PM Polling Device: Home Security (18)
      Sep-03 10:11:05 PM Polling Device: Battery (17)
      Sep-03 10:11:05 PM Polling Device: On/Off Sensor (16)
      Sep-03 10:11:05 PM Polling Device: Kitchen Fan (15)
      Sep-03 10:11:05 PM Z-Wave Warning No response from device when getting level: Node 11 Kitchen Kitchen Fan, Node: 11
      Sep-03 10:11:03 PM Polling Device: Front Door Light (14)
      Sep-03 10:11:02 PM Polling Device: Aeon Labs Generic Controller (131)
      Sep-03 10:11:02 PM Polling Device: Notification (130)
      Sep-03 10:11:02 PM Polling Device: Living Room Fan (13)
      Sep-03 10:11:02 PM Z-Wave Device: Node 29 Front Door Lock Door Lock Logging Set to Auto Locked
      Sep-03 10:11:02 PM Polling Device: Door Lock Logging (129)
      Sep-03 10:11:01 PM Polling Device: Front Door Lock (128)
      Sep-03 10:10:59 PM Z-Wave Device: Node 17 Temp Sensor 1 AC Temp Set to 72.266 (F)
      Sep-03 10:10:59 PM Polling Device: Battery (127)
      Sep-03 10:10:59 PM Polling Device: Assa Abloy Entry Control (126)
      Sep-03 10:10:59 PM Polling Device: Garage Outlet (121)
      Sep-03 10:10:59 PM Z-Wave Device: Node 23 Garage Outlet Power Set to 9.93 (W)
      Sep-03 10:10:59 PM Polling Device: Power (120)
      Sep-03 10:10:59 PM Polling Device: Night Light (12)
      Sep-03 10:10:59 PM Z-Wave Device: Node 23 Garage Outlet Watts Set to 9.93 (9.93 Watts)
      Sep-03 10:10:59 PM Polling Device: Watts (119)
      Sep-03 10:10:58 PM Z-Wave Device: Node 23 Garage Outlet kW Hours Set to 17.644 (17.644 kW Hours)
      Sep-03 10:10:58 PM Polling Device: kW Hours (118)
      Sep-03 10:10:58 PM Polling Device: Aeon Labs Switch Binary (117)
      Sep-03 10:10:58 PM Polling Device: Kitchen Leak (115)
      Sep-03 10:10:58 PM Polling Device: Home Security (114)
      Sep-03 10:10:58 PM Polling Device: Battery (113)
      Sep-03 10:10:58 PM Polling Device: Ecolink On/Off Sensor (112)
      Sep-03 10:10:58 PM Polling Device: Washer Leak (111)
      Sep-03 10:10:58 PM Polling Device: Home Security (110)
      Sep-03 10:10:58 PM Polling Device: Bedroom Fan (11)
      Sep-03 10:10:57 PM Polling Device: Battery (109)
      Sep-03 10:10:57 PM Polling Device: Ecolink On/Off Sensor (108)
      Sep-03 10:10:57 PM Polling Device: Small Fan (10)
      Sep-03 10:10:56 PM email Email successfully sent to @vtext.com
      Sep-03 10:10:56 PM Event Running script in background: C:/Program Files/HomeSeer HS3/scripts/pollZwave.vb
      Sep-03 10:10:55 PM Z-Wave Device: Node 17 Temp Sensor 1 AC Temp Set to 72.266 (F)
      Sep-03 10:10:54 PM Event Event Trigger "Misc Events PC Start"
      Sep-03 10:10:54 PM Event Event Misc Events PC Start triggered by the event page 'Run' button.

      Comment


        #18
        I don't use HS in the web browser much. Maybe it's been like this and I didn't notice it. During the last week, I did install 3 devices. Two of them I didn't like so I removed them. One was aeotec quad wallmote and two different LED RGB bulbs. One was Yeelight wifi bulb and the other was Z-wave RGB from Monoprice. I removed the Monoprice bulb and wallmote. I also installed the Plug-in for the Yeelight. Other than that I don't remember any other changes.

        Comment


          #19
          Sorry ... I'm trying to use this script and am having problems.
          I am running HS3 on an Odroid under Ubuntu.
          Mono is v 5.0.1.1.
          My zwave controller is a ZNet (Rpi 3 with a Smartstick+)

          This is what the log shows when running the script ...
          Nov-17 11:28:25 AM Error Compiling script /usr/local/HomeSeer/scripts/pollZWave.vb: http://mono-project.com/Bugs)
          Nov-17 11:28:25 AM Error Compiling script /usr/local/HomeSeer/scripts/pollZWave.vb: Variable declaration without an 'As' clause; Object type assumed.
          Nov-17 11:28:25 AM Error Compiling script /usr/local/HomeSeer/scripts/pollZWave.vb: The import 'System.Core' could not be found.
          I assume it does not like the mono version I am running. I have locked in v 5.0.1.1 because I read somewhere on this forum it is the latest fully compatible mono version. I also have problems with the ecobee plugin most likely due to my mono version.

          Thanks.

          Comment


            #20
            ramans Try changing "Dim dvRef" to "Dim dvRef As Object" in the script.
            Last edited by sparkman; November 17, 2018, 02:25 PM.
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #21
              Hi all,

              First of, thanks to for posting this script. I created a version that only polls z-wave root devices that are always listening (i.e. not battery powered). Polling the root devices, rather than each child and root, reduces the amount of z-wave traffic significantly since polling the root automatically polls the child devices. I've also introduced a 5 second delay between the polls of the devices that meet the criteria in order to not flood the z-wave network with polls and responses. The version of the script is shown below.

              Cheers
              Al

              New script posted here: https://forums.homeseer.com/forum/li...98#post1260198
              Last edited by sparkman; November 17, 2018, 09:48 PM.
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #22
                Thanks for the help ...
                I made the change suggested above, but no luck.
                This is what the log shows now.
                Nov-17 3:59:18 PM Error Compiling script /usr/local/HomeSeer/scripts/pollZWave.vb: http://mono-project.com/Bugs)
                Nov-17 3:59:18 PM Error Compiling script /usr/local/HomeSeer/scripts/pollZWave.vb: The import 'System.Core' could not be found.
                Nov-17 3:59:16 PM Event Running script in background: /usr/local/HomeSeer/scripts/pollZWave.vb
                Nov-17 3:59:16 PM Event Event Trigger "HomeSeer Poll All Z-Wave"
                Nov-17 3:59:16 PM Event Event HomeSeer Poll All Z-Wave triggered by the event page 'Run' button.
                So maybe there were two errors and 1 is corrected?

                Again,
                Thanks

                Comment


                  #23
                  Unfortunately the "The import 'System.Core' could not be found" message seems to be a common error message when something is wrong, but does not provide any hints as to what it could be. I'm thinking it might be one of the following:

                  - unix/linux is typically much more case sensitive than Windows, so try changing "sub Main" to "Sub Main"
                  - the mono installation may be incomplete so some functions like "System.Threading.Thread.Sleep(50)" may not work. Two possible remedies for this are to install the complete mono build on the Odroid. Google for help on that. The other possible solution is to replace it with the hs delay function "hs.WaitSecs(2)". Note that the hs function uses seconds whereas Thread.Sleep is in milliseconds.

                  If none of that resolves the issue, then I'd suggest removing sections out of the script to see if it works with those sections removed. If it does, then that narrows down what is generating the error.
                  HS 4.2.8.0: 2134 Devices 1252 Events
                  Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                  Comment


                    #24
                    Answered my own question about how to check if a device is a listening device. I created an updated version of the script which is now shown here: (https://forums.homeseer.com/forum/li...98#post1260198). I trigger the script using UltraLog once the Z-Wave plugin has started.

                    Click image for larger version  Name:	Untitled.png Views:	1 Size:	32.1 KB ID:	1260166
                    Last edited by sparkman; November 17, 2018, 09:49 PM.
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #25
                      Very cool.

                      One thing I've wondered about this particular script - I see that the assignment to the PollResult object is never used. How does one determine the structure of that object so that the status can be reported in the writeLog message?

                      Comment


                        #26
                        Originally posted by zwolfpack View Post
                        Very cool.

                        One thing I've wondered about this particular script - I see that the assignment to the PollResult object is never used. How does one determine the structure of that object so that the status can be reported in the writeLog message?
                        Unfortunately the documentation for the z-wave plugin is sparse. Looking at the function through Visual Studio's object browser does not give much guidance:

                        Code:
                        public unknown-type PollDevice(int dvref)
                        That also indicates that an integer should be passed to it, but experimenting with it, it only seems to work with passing an object. From some other script that I had, the value and result are returned, so the updated script below also writes that to the log:

                        Code:
                        Sub Main(ByVal Parm As Object)
                        
                            Dim Debug As Boolean = True
                            Dim logName As String = "Z-Wave Polling"
                            Dim dvRef As Integer
                            Dim PollDelay As Integer = 5000 'delay between polls in milliseconds
                        
                        
                            Try
                                Dim PollResult As New HomeSeerAPI.IPlugInAPI.PollResultInfo
                                Dim dv As Scheduler.Classes.DeviceClass
                                Dim EN As Scheduler.Classes.clsDeviceEnumeration
                                EN = hs.GetDeviceEnumerator
                        
                                Do
                                    dv = EN.GetNext
                                    If dv Is Nothing Then Continue Do
                                    'poll only z-wave root devices that support status
                                    If dv.Interface(Nothing).ToLower = "z-wave" And dv.Relationship(Nothing) < 4 And dv.Status_Support(Nothing) = True Then
                                        dvRef = dv.Ref(Nothing)
                                        PollResult = hs.PluginFunction("Z-Wave", "", "PollDevice", New Object() {dvRef})  
                                        If Debug Then hs.writelog(logName, "Device: " & dv.Name(Nothing) & " (" & dvRef & ") Result: " & PollResult.Result.ToString & " (" & PollResult.Value.ToString    &")" )
                                        System.Threading.Thread.Sleep(PollDelay)
                                    End If
                        
                                Loop Until EN.Finished
                        
                            If Debug Then hs.writelog(logName, "Finished Polling")
                        
                            Catch ex As Exception : hs.writelog(logName, "Exception: " & ex.message)
                            End Try
                        
                        End Sub
                        Last edited by sparkman; November 18, 2018, 10:45 AM.
                        HS 4.2.8.0: 2134 Devices 1252 Events
                        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                        Comment


                          #27
                          Excellent - many thanks!

                          Circling back to the Linux issue - this seems another case where the HS3-Linux port, as Maxwell Smart might say, "missed it by that much..."

                          Script runs beautifully under Windows, but when same is run under Linux (HS3 3.0.0.478, latest mono 5.16), "The import 'System.Core' could not be found." is logged as reported earlier. Commenting out the single line containing the call to hs.PluginFunction eliminates this; however then get only "VB.Net script exception(0), re-starting: Object reference not set to an instance of an object." -- and the script never exits; further attempts yield "Not running script since its already running: /opt/HomeSeer/scripts/Z-Wave.vb Single instance option enabled in event properties"... Gah!

                          Comment


                            #28
                            Weird. Might be that Windows/.NET is bit more forgiving on syntax whereas linux/mono isn't. Perhaps try changing:
                            Code:
                            Dim dvRef As Object
                            
                            To
                            
                            Dim dvRef As Integer
                            
                            and
                            
                            PollResult = hs.PluginFunction("Z-Wave", "", "PollDevice", {dvRef})
                            
                            To
                            
                            PollResult = hs.PluginFunction("Z-Wave", "", "PollDevice", New Object() {dvRef})
                            HS 4.2.8.0: 2134 Devices 1252 Events
                            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                            Comment


                              #29
                              Cool, that cures the "System.Core" issue. But the "VB.Net script exception(0), re-starting: ..." and never finishing script remains.
                              It's pretty hosed; I put a writelog at the very start and it doesn't show.

                              Comment


                                #30
                                Hi again ...
                                I copied the script that only polls zwave root devices from sparkman's post above and it works on my system. The original script from rprade with the latest modifications still did not work. I did have to delay the start of the script because the timing of all on/all off is not instantaneous. Using mono is a hit or miss proposition ... so thanks to everyone.

                                HS3 v 3.0.0.435
                                Mono v 5.0.1.1
                                Odroid HC1 running Ubuntu LT v 18.04
                                homemade znet via Rpi2 and HomeSeer smartstick+

                                I'm not sure if "all" of mono is installed, but I installed mono-complete and mono-vbnc only and locked the version of mono to 5.0.1.1 with "snapshot" per the mono project. I found if you go beyond this version other scripts and things may not work.

                                My "ALL ON and ALL OFF" zwave command in events are now updated on the HomeSeer web page. I only use the command shortly after startup or when I'm unsure of what to do to return the system to a known and controllable state so future events provide expected results.

                                Comment

                                Working...
                                X