Announcement

Collapse
No announcement yet.

Should be easy, but Im confused - Speak Dev Value/Status

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

  • Should be easy, but Im confused - Speak Dev Value/Status

    Hey All,

    So im embarassed to ask this, but I can't figure out how to get a script to speak a value or status from a device. I have been digging thru posts, and trying different serial to integer and back type of commands.

    All i want to do is speak the temperature of a device I have addressed as Temp05

    I have removed all the stuff I was trying to do, just to get to a Hello World if possible.

    Public Sub Main(ByVal Parms As Object)
    hs.speak("The Value is" & hs.DeviceValue("Temp05"))
    End Sub

    This pukes with:
    Running script C:\Program Files\HomeSeer HS3\scripts\TempStatus.vb :Exception has been thrown by the target of an invocation.Conversion from string "Temp05" to type 'Integer' is not valid.

    So, in my little mind, Temp05 is coming back as an Integer, and hs.speak should be a string, but banging my head isn't helping anything except antiquing my table.



    -John

  • #2
    The DeviceValue uses as input the device reference.

    From the help files:
    Parameters:

    Parameter: dvRef
    Type: Integer
    Description: This is the device reference ID number.

    Try using the devices reference found on the Advance tab of the devices properties.
    ie
    Public Sub Main(ByVal Parms As Object)
    hs.speak("The Value is" & hs.DeviceValue(7))
    End Sub

    Or you can use DeviceValueByNameEx
    ie
    Public Sub Main(ByVal Parms As Object)
    hs.speak("The Value is" & hs.DeviceValueByNameEx("Living Room Lamp"))
    End Sub
    -Rupp
    sigpic

    Comment


    • #3
      Rupp, that was it!!! I had seen your example in another posting, but for the life of me, i couldn't figure out where that value came from. Now that i know i just need to look in the advance tab, things are looking up!

      Thank you again. We need an idiots guide to HS3 ;-)

      Comment


      • #4
        Originally posted by Automate_It View Post
        Rupp, that was it!!! I had seen your example in another posting, but for the life of me, i couldn't figure out where that value came from. Now that i know i just need to look in the advance tab, things are looking up!

        Thank you again. We need an idiots guide to HS3 ;-)
        I would recommend using the second example using DeviceValueByNameEx.
        -Rupp
        sigpic

        Comment

        Working...
        X