Reusing deviceType in new plugins

This question came up when I was developing the X10 CM11a plugin reboot. I had created devices that would mimic existing devices, but added the additional service files I needed. For instance, I had a X10BinarySwitch which was mostly the same as any other switch, but I needed to include extra services. So I had a D_X10BinarySwitch1.xml file which declared a deviceType which was the same as in the D_BinaryLight1.xml, but added my extra S_XXXX.xml files that I needed to include to support my extra services.

This all seemed to work fine. I could see the devices in all the remote apps I was testing at the time, AutHomationHD, Imperihome, HomeBuddy, etc.

However, Garret brought up some concern that because I was using the same deviceType, it might confuse vera and cause unexpected results. He thought that perhaps Vera would only load the first device specification file that had that deviceType, which depending on which one was first, could cause some functions to not work. I asked for clarification from him about how I could use the standard D_BinaryLight1.xml, but still get my additional services loaded since I would not be able to specify the additional S_XXXX.xml files, but he never replied again on that thread.

So, I find myself in another situation where I’m developing a plugin and it really is going to be similar to an existing device and I would like to use that same deviceType, but with some additional services added to it.

Now, I’ve been using those custom X10 plugin files that have the same deviceType as their basic counterparts for about 4 years now and I’ve had no issues or weirdness.

As an experiment today, I changed my D_X10BinarySwitch1.xml file to use a custom deviceType but left everything else the same. I uploaded the new file and reloaded luup. In the UI5 UI, everything still worked fine. The X10 switches turned on and off and the UI showed the proper icons, etc. However, in ImperiHome after doing a refresh, all those devices disappeared from the UI and were inaccessible.

So, that’s the dilemma. If I don’t use the same deviceType as an existing one, then I’m screwed on the mobile apps.

In looking at the article in the wiki about coding plugins here, it says to start with an existing device file, and then says this:

Modify the UPnP device specification file as needed, such as changing the manufacturer and model. Do not worry about the UDN tag as Luup will create a UDN for you automatically. [b]If your device is functionally the same as the template you started from, leave the deviceType the same[/b]. If it's different, modify the deviceType replacing the "schemas-upnp-org" or "micasaverde-com" with some domain that you have...

This seems to indicate that it should be fine to duplicate the deviceType in your custom device specification file without causing any confusion. Since it’s been about 4 years since that original thread, is there anyone else that knows of a concern with using an existing deviceType in a new plugin?