This pull request fixes the code for adding extensions and a device is added to the extension.
These device fields are populated if they are defined and enabled in default setttings. This works if the data types = text (the default) and it works if the data types = array (very useful for server clusters)