Announcement

Collapse
No announcement yet.

How To Access The Device's "Voice Command" Text Field (Not The Bit Flag)?

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

    How To Access The Device's "Voice Command" Text Field (Not The Bit Flag)?

    I have a need to be able to access the device property "Voice Command" text field. I know how to access (get and set) the bit value that turns on and off the Device's Voice command but I cannot find how to access (get and set) the text field of the Device's voice command. Can anyone point me in the right direction for this Device Text Field?

    Click image for larger version

Name:	Screenshot_2021-02-20_22-16-12.jpg
Views:	99
Size:	109.3 KB
ID:	1457687
    Thanks So Much,
    Jean-Marie Vaneskahia
    ---------------------------------------------------
    Jean-Marie G. Vaneskahian
    jean@vaneskahian.com
    ---------------------------------------------------

    #2
    You would use the DeviceClass:

    Code:
    Dim VC As String = ""
    Dim DeviceRef As Integer = 1234
    Dim dv As Scheduler.Classes.DeviceClass = Nothing
    dv = hs.GetDeviceByRef(DeviceRef)
    ' set
    dv.VoiceCommand(hs) = "Hello"
    ' get
    VC = dv.VoiceCommand(hs)
    Jon

    Comment


      #3
      You are awesome!!! Thank you so much! I do not understand why HomeSeer does not do a better job of documenting the objects properties and methods with simple examples like you just gave! I appreciate it! I have also just discovered "Class View" in Visual Studio that allows you to view all the class. This would have helped me earlier. Again, thanks!!!
      ---------------------------------------------------
      Jean-Marie G. Vaneskahian
      jean@vaneskahian.com
      ---------------------------------------------------

      Comment


        #4
        For anyone else that had a problem with this, here I what I used to both Get and Set the device's "Voice Command" property in HS3.

        C# (Read The Device Voice Command String)
        Code:
        int Device_Reference = 1000;
        string Device_Voice_Command = (Scheduler.Classes.DeviceClass)hs.GetDeviceByRef(Device_Refe rence).VoiceCommand(hs);
        C# (Write The Device Voice Command String)
        Code:
        int Device_Reference = 1000;
        (Scheduler.Classes.DeviceClass)hs.GetDeviceByRef(Device_Reference).VoiceCommand(hs) = "This Is The New Voice Command";
        Visual Basic (Read The Device Voice Command String)
        Code:
        Dim Device_Reference As Integer = 1000
        Dim Device_Voice_Command As String = CType(hs.GetDeviceByRef(Device_Reference), Scheduler.Classes.DeviceClass).VoiceCommand(hs)
        Visual Basic (Write The Device Voice Command String)
        Code:
        Dim Device_Reference As Integer = 1000
        CType(hs.GetDeviceByRef(Device_Reference), Scheduler.Classes.DeviceClass).VoiceCommand(hs) = "This Is The New Voice Command"
        ---------------------------------------------------
        Jean-Marie G. Vaneskahian
        jean@vaneskahian.com
        ---------------------------------------------------

        Comment

        Working...
        X