Announcement

Collapse
No announcement yet.

How to discover what device uses a device code

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

    How to discover what device uses a device code

    I created a bunch of virtual devices, and i must of gotten my records messed up, because one of them is h12, but I don't know what it is...HS2 used to show them all by device ID, I don't see that option here w/HS3. any suggestions?

    thanks,

    Ian
    Plugins:
    BLLogMonitor, BLGarbage, BLBackup, BLOutGoingCalls, BLUps, BLRfid, JvEss, DooMotion, Applied Digital Ocelot, AC RF Processor, UltraMon, PJC AVR 430, UPB, Rain8net, DSC Panel, JRiver Media center, Windows Media Player, SageMediaCenter, SnevlCID, MCSTemperature.

    #2
    Hi Ian,

    If you go into Setup and then the Custom tab, make sure "Show Device Address/Code Column on Device Management Page" is checked. If you still can't find it that way, then it's possible to get more info on the device using a small script.

    Cheers
    Al
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      This is the ASPX source code for a page that gives me a list of X10 devices with the addresses in the first column, it was just quick and easy to enable me to prevent duplication now the X10 code is not as easily looked at. You might be able to adapt it if you so wish.

      Code:
      <%@ Page Language="VB" %>
      <script runat="server">
      
      Dim hs As Scheduler.hsapplication
      
        Sub Page_Load(Sender As Object, E As EventArgs)
              ' for use with the HS web server
              hs = Context.Items("Content")
      End Sub
      
      Private Function GetHeadContent() As String
              Try
                  Return hs.GetPageHeader("", "X10 Device List", "", "", False, False, True, False, False)
              Catch ex As Exception
              End Try
              Return ""
          End Function
      
      Private Function GetFootContent() As String
              Try
                  Return hs.GetPageFooter(False)
              Catch ex As Exception
              End Try
              Return ""
      End Function
      
      Private Function GetBodyContent() As String
              Try
                  Return hs.GetPageHeader("", "X10 Device List", "", "", False, True, False, True, False)
              Catch ex As Exception
              End Try
              Return ""
          End Function
      
      Private Function GetTableContent() As String
              Try
      		Dim td As New StringBuilder
      
      		Dim dv As Scheduler.Classes.DeviceClass
      		Dim EN As Scheduler.Classes.clsDeviceEnumeration
      	
      		EN = hs.GetDeviceEnumerator
      
      		td.Append("<u>X10 Devices</u><br><br>")
      
      		td.Append("<table><tr><td><b>X10 Address</b></td><td><b>Device Reference</b></td><td><b>Location</b></td><td><b>Device Name</b></td><td><b>Last Change</b></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr>")
      	
      		Do
      
      		dv = EN.GetNext
      
      		If dv.Interface(Nothing) = "X10" Then 
      		td.Append("<tr><td>" & dv.Code(Nothing) & "</td><td>" & dv.Ref(Nothing) & "</td><td>" & dv.Location(Nothing) & "</td><td>" & dv.Name(Nothing) & "</td><td>" & dv.Last_Change(Nothing) & "</td><tr>")
      		End If
      
      		Loop Until EN.Finished
      
      		td.Append("</table>")
      
      		Return td.ToString
      
      	Catch ex As Exception : Return "Unknown Error"
              End Try
      End Function
      
      </script>
      <html>
      <head runat="server">
      <%response.write(GetHeadContent())%>
      </head>
      <body>
      <% response.write(GetBodyContent()) %>
      <br>
      <% response.write(GetTableContent()) %>
      <br><br>
      <% response.write(GetFootContent()) %>
      </body>
      </html>

      Comment


        #4
        Both methods were very helpful, thanks guys!
        Plugins:
        BLLogMonitor, BLGarbage, BLBackup, BLOutGoingCalls, BLUps, BLRfid, JvEss, DooMotion, Applied Digital Ocelot, AC RF Processor, UltraMon, PJC AVR 430, UPB, Rain8net, DSC Panel, JRiver Media center, Windows Media Player, SageMediaCenter, SnevlCID, MCSTemperature.

        Comment


          #5
          Originally posted by completelyhis View Post
          I created a bunch of virtual devices, and i must of gotten my records messed up, because one of them is h12, but I don't know what it is...
          Ian,
          I try not to use the X10 style address for anything but X10 devices. Is there something about these devices that requires that address form?
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #6
            I guess it was just out of habit, from HS2 days. What's your preferred method?


            Sent from my iPhone using Tapatalk
            Plugins:
            BLLogMonitor, BLGarbage, BLBackup, BLOutGoingCalls, BLUps, BLRfid, JvEss, DooMotion, Applied Digital Ocelot, AC RF Processor, UltraMon, PJC AVR 430, UPB, Rain8net, DSC Panel, JRiver Media center, Windows Media Player, SageMediaCenter, SnevlCID, MCSTemperature.

            Comment


              #7
              Originally posted by completelyhis View Post
              I guess it was just out of habit, from HS2 days. What's your preferred method?
              I've been using only the Device Reference number and the device name, plus meaningful entries for 'Room' and 'Floor' (which I call 'Narrow' and 'Broad') for virtual devices. With descriptive names, and a device type of 'Virtual', I've had no trouble getting a segregated list to remind myself about what does what - so far, at least.

              Tenhold has just published a useful tool he calls tenSciptAid that makes sorting and retrieving details about devices pretty easy. It's designed to help in writing scripts, but I'm expecting it will be very useful for fishing a target device from the sea of devices in HS3.
              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.548, NUC i3

              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

              Comment


                #8
                Originally posted by completelyhis View Post
                I guess it was just out of habit, from HS2 days. What's your preferred method?


                Sent from my iPhone using Tapatalk
                As UM says, go with the device reference as you will just create more work for yourself - quite a few of the scripting calls now do not support device codes and rely on references. It's not as intuitive but that's the way of things now.

                Comment


                  #9
                  Playing around with virtual devices, how do you set the Reference Id of a virtual device you want to create and how do you know what Id is available.
                  Admittedly, I created a virtual device using HS2 style i.e S1. Then I tried to write a text status to it and of course hs.SetDeviceString wants an Id. No problem, go into Advance settings of the device and I see it and use if fine. But the aforementioned, remains the outstanding question...

                  Rob
                  HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                  Comment


                    #10
                    Originally posted by langenet View Post
                    Playing around with virtual devices, how do you set the Reference Id of a virtual device you want to create and how do you know what Id is available.
                    Admittedly, I created a virtual device using HS2 style i.e S1. Then I tried to write a text status to it and of course hs.SetDeviceString wants an Id. No problem, go into Advance settings of the device and I see it and use if fine. But the aforementioned, remains the outstanding question...

                    Rob
                    Hi Rob,

                    The reference id is automatically assigned by HS3. It assigns the next available number and does not reuse reference id's of devices previously deleted. You can't manually set it.

                    Cheers
                    Al
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #11
                      Thank Al,

                      I kinda thought that. But I'm confused with the statement go with the device reference . When I create a virtual device I should then not even set the address - rather just create it by name then note the reference Id?

                      So how can I see the reference number without going to Advance properties. I set the "Show device/Address..." in setup. Still no Ref ID easily displayed.

                      Robert
                      HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                      Comment


                        #12
                        Most devices don't need an address, although some plugins do use them, and you can manually set them and then use them from scripts, etc. The easiest way to see the device reference is to hover over the device's link in the device management page. The url displayed contains the reference id.

                        Cheers
                        Al
                        HS 4.2.8.0: 2134 Devices 1252 Events
                        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                        Comment


                          #13
                          Originally posted by sparkman View Post
                          The easiest way to see the device reference is to hover over the device's link in the device management page. The url displayed contains the reference id.
                          I hadn't noticed that! What a useful tip.

                          Another useful tool is TenScriptAid, which locates devices with an easy search and lists virtually everything about them.
                          Mike____________________________________________________________ __________________
                          HS3 Pro Edition 3.0.0.548, NUC i3

                          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                          Comment


                            #14
                            Great!... I hadn't either. Thanks for your help.

                            Rob
                            HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                            Comment

                            Working...
                            X