If you want a device's address, there's a simple "one-liner" to get it:
hs.speak(hs.GetDeviceCode("Living Room Light"))
Is there a way to do the opposite, give it an address and have it announce the name? After much trial & error, I wrote a short script to do this:
hs.GetDevice("L1").name
hs.speak(hs.GetDeviceCode("Living Room Light"))
Is there a way to do the opposite, give it an address and have it announce the name? After much trial & error, I wrote a short script to do this:
dim dref as long
dim dloc as Object
dref = hs.getdeviceRef("L1")
dloc = hs.GetDeviceByRef(dref)
hs.speak (dloc.name)
but I imagine there's a cleaner way to get this info -- maybe something along the lines of: dim dloc as Object
dref = hs.getdeviceRef("L1")
dloc = hs.GetDeviceByRef(dref)
hs.speak (dloc.name)
hs.GetDevice("L1").name
Comment