Is there a way I can use a script to automatically configure settings in the APPS → Develop Apps → Serial Port configuration?
Maybe. I don’t have any serial devices directly attached to Vera any more so this is from memory.
Grab your Vera’s user data (http://veralite-address:3480/data_request?id=lu_user_data2&output_format=xml) and search for your existing serial port. If I recall there will be a hidden device with variables for each of the properties you see on that page. They are all standard Luup variables with a service ID and name. You should then be able to set those variables with a standard luup.variable_set() from a Lua script, or using a variableset HTTP request.
Okay, I found the entry in the Vera user data xml. However, I do not see a variable for the “Used by device:” entry. I want to set that automatically via lua as well. Any thoughts?
I believe that the “used by device” magic is on the device doing the using. Try assigning the serial port to a plugin device and then look at that device’s variables.
That implies that if you want to change the device using a serial port you’ll need to delete a variable from the old device too.
I believe futzle is correct. (The device that you want to use the serial port needs to have what appears to be a few variables set:)
The service for all the variables (see attached) is “urn:micasaverde-com:serviceId:HaDevice1”
Looks like IOPortPath should be set to the “path” of the serial port,
IODevice and IODeviceXRef should be set to the device id of the serial device (17 in my case…90 in yours).
Thank you all for the help! Looks like I am getting closer.