Announcement

Collapse
No announcement yet.

Hs.devicestring problem

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

    Hs.devicestring problem


    I’m having a senior moment

    In immediate window

    &hs.speak hs.Devicevalue(1042)
    Works as expected
    Log shows
    TTS speak():1


    But
    &hs.speak hs.DeviceString(1042)
    Doesn’t say anything
    Log shows
    TTS speak():

    Status screen shows a string of “clean”

    Probably a simple thing I’m not seeing


    Sent from my iPad using Tapatalk
    Regards,

    Andrew B.

    #2
    hs.Speak(hs.DeviceString(1024)) perhaps?
    Don

    Comment


      #3
      Do you have a device value/status pair that links "clean" to the value of 1?
      The device management screen will display the status text if the device string is empty. Look at the advanced tab of the device. That will display both the status and the device string.
      Have you tried using the replacement variable? &hs.speak $$DSR:1042:?
      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


        #4
        Originally posted by Uncle Michael View Post
        Have you tried using the replacement variable? &hs.speak $$DSR:1042:?
        AFAIK, replacement variables do not work inside of scripts/immediate script commands.
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          Originally posted by sparkman View Post
          AFAIK, replacement variables do not work inside of scripts/immediate script commands.
          I think you are correct. I guess you'd need to use the Speak action of an event rather than an immediate script.
          I don't know of a way to speak a device status using a script.
          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
            This works:

            Code:
            &hs.speak(hs.CAPIGetStatus(2776).Status)
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #7
              Originally posted by sparkman View Post
              Code:
              &hs.speak(hs.CAPIGetStatus(2776).Status)
              Impressive!
              Using CAPI to retrieve a device status would do Rube Goldberg proud.

              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 Uncle Michael View Post
                Impressive!
                Using CAPI to retrieve a device status would do Rube Goldberg proud.
                Lol
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #9
                  Thx... not sure why the string is blank... see attached screenshots




                  Sent from my iPhone using Tapatalk
                  Attached Files
                  Regards,

                  Andrew B.

                  Comment


                    #10
                    Pretty normal that the string is blank. Most devices show value and status.
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #11
                      Originally posted by sparkman View Post
                      Pretty normal that the string is blank. Most devices show value and status.
                      I guess I was confusing status with devicestring...
                      So... how can I have it speak the status? (“On base”, “cleaning”, etc)


                      Sent from my iPhone using Tapatalk
                      Regards,

                      Andrew B.

                      Comment


                        #12
                        Originally posted by ArbWare View Post

                        I guess I was confusing status with devicestring...
                        So... how can I have it speak the status? (“On base”, “cleaning”, etc)


                        Sent from my iPhone using Tapatalk
                        I posted a way to do so earlier in the thread in post #6.
                        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

                          I posted a way to do so earlier in the thread in post #6.
                          Thank you very much.... !! that works well for what i was looking for.
                          Regards,

                          Andrew B.

                          Comment


                            #14

                            I created a multi purpose function for this

                            Code:
                            You can use  $DEVICESTRING( DeviceRef)$ in the string and send it to this function.
                            You will get the device string back even if this is a value pair.
                            
                            '==============================
                            ' REPLACEMENT VARIABLE
                            '==============================
                            ' Using replacement values
                            
                            ' Usage : (String in)
                            '  STRINGS REPLACED
                            '  $DEVICESTRING(RefID of device)$
                            '
                            Function ReplacementVariable(ByVal TestString As String) As String
                             Dim CheckString = Instr(TestString, "$DEVICESTRING(")
                             Dim   temp2     = Replace(TestString, "$DEVICESTRING(", "")
                                Dim ThisDevID   = Mid(temp2, CheckString, Instr(temp2, ")$") - CheckString ) 
                                CheckString     = "$DEVICESTRING(" & ThisDevID & ")$"
                            
                             If (hs.DeviceString(ThisDevID) = "") Then
                               ' In case that the device has no device string set
                               ' then try to get de VSP value-string pair.
                                 Dim VSPstring
                                 Dim DevRef  = CInt(ThisDevID)
                                 Dim Value   = hs.DeviceValue(DevRef)
                                 Dim VSPType = 1  ' 0 = Status - Control
                                ' 1 = Status
                                ' 2 = Control
                                ' 0 = Status - Control
                               VSPString = hs.DeviceVSP_GetStatus(DevRef, Value, VSPType)
                               temp2 = Replace(TestString, CheckString, VSPString )
                             Else
                                  temp2 = Replace(TestString, CheckString, hs.DeviceString(ThisDevID) )
                             End If
                             Return temp2
                            End Function
                            - Bram

                            Send from my Commodore VIC-20

                            Ashai_Rey____________________________________________________________ ________________
                            HS3 Pro 3.0.0.534
                            PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

                            Comment

                            Working...
                            X