Announcement

Collapse
No announcement yet.

Get deivce name in script

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

    Get deivce name in script

    Hi
    i have created a script that will prompt a user in HSTOUCH to enter a time for hours, minutes and select a device + action.
    it will then create a one time event that will perform the Action for the DEVICE at Hours:Minutes.


    now this script works perfectly and i am able to create timer events.

    now i want to add a push message to be sent to the device:
    "a new timer has been set"
    "the device **device_name** is set to do **action** at **hours**:**Minutes**"
    the push is sent just fine but i cant get the **device_name** to be displayed. i managed to get the REF number or the address but i cant get the device actual name.

    anyone have any idea what command i use to extract the device name as a string from ref number?

    thanks

    #2
    Originally posted by ez1976 View Post
    Hi
    i have created a script that will prompt a user in HSTOUCH to enter a time for hours, minutes and select a device + action.
    it will then create a one time event that will perform the Action for the DEVICE at Hours:Minutes.


    now this script works perfectly and i am able to create timer events.

    now i want to add a push message to be sent to the device:
    "a new timer has been set"
    "the device **device_name** is set to do **action** at **hours**:**Minutes**"
    the push is sent just fine but i cant get the **device_name** to be displayed. i managed to get the REF number or the address but i cant get the device actual name.

    anyone have any idea what command i use to extract the device name as a string from ref number?

    thanks
    You can use hs.devicename(ref) - it is not documented but I find it quite a useful one to use, there is another way by using hs.GetDeviceByRef and going through the device class but I would try the first method first.

    Comment


      #3
      Originally posted by mrhappy View Post
      You can use hs.devicename(ref) - it is not documented but I find it quite a useful one to use, there is another way by using hs.GetDeviceByRef and going through the device class but I would try the first method first.
      Thanks
      can you give me an example how to use it?

      like this?
      DevRefM = hs.GetDevicename("V902")

      Comment


        #4
        If the device ref # is 123 then the syntax is

        name = hs.DeviceName(123)

        Wow. Didn't have a clue about this call. Thanks.
        Don

        Comment

        Working...
        X