Renaming a device from a script

Posted on
Sat Jul 07, 2018 1:23 pm
mundmc offline
Posts: 218
Joined: Sep 14, 2012

Renaming a device from a script

I know attributes like folderId can be modified, but can the device.name be changed from a script?

I want to move to select devices to a new folder and rename them, but I can only change their folder, while their name remains the same. Additionally, no error is thrown.

dev.name = “NEWNAME”


Sent from my iPhone using Tapatalk

Posted on
Sat Jul 07, 2018 2:30 pm
howartp offline
Posts: 3310
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Renaming a device from a script

I think you need dev.updateOnServer() after dev.name =


Sent from my iPhone using Tapatalk Pro

Posted on
Sat Jul 07, 2018 4:32 pm
matt (support) offline
Site Admin
User avatar
Posts: 18507
Joined: Jan 27, 2003
Location: Texas

Re: Renaming a device from a script

Close, the API name is dev.replaceOnServer().

Image

Posted on
Sat Jul 07, 2018 5:31 pm
mundmc offline
Posts: 218
Joined: Sep 14, 2012

Re: Renaming a device from a script

matt (support) wrote:
Close, the API name is dev.replaceOnServer().


Doh! I read that but thought it was specific to developing plugins (I’m sure I’m confusing it with somethingSomethingServer(,)).

Many thanks! I now auto-name devices for guests on my wifi! I also log device names and MAC numbers if my home-grown alarm gets tripped!


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest