getDeviceById doesn't exist... Looking at other options (BTW I changed my own title!)

I wanted to do the following without an input statement:

def DeviceMap = GetDeviceMap()
app.updateSetting("EM", [value:DeviceMap["EM"], type:"capability.*"])
subscribe(EM, "dryerWatts", dryerHandler)

I was able to get around the issue of getDeviceById() by making the routine GetDeviceMap() and then just using the returned map with app.updateSetting(). The routine and discussion is available at the topic "Obtaining Devices Map" in "Custom Apps and Drivers/Custom Apps".

3 Likes