Debugging D_* files

Does anyone have any good tips on debugging D_ files?

While working on my alternate Insteon project, I want to add some functionality to the D_DimmableLight. To start with, I just copied over the D_DimmableLight1.xml and D_DimmableLight1.json file to D_InsteonDimmer.xml and D_InsteonDimmer.json. If I set my device to use those files, everything seems to work fine. If I then go and change the in the xml file to something else, making sure to match it with the “DeviceType” and “device_type” values in the json file, the device shows up in the dashboard with no controls and an icon of the circle with the gear in it. (Basically, the default view when the Vera doesn’t know what to do with it.)

So, I obviously have set something wrong, but I don’t know what. Looking at the LuaUPnP.log file I don’t see any indication of errors when the files are loaded. In fact, I see success messages.

Any thoughts?

When I am doing this I make very very small changes one at a time, save, reload the Luup engine and (this is important) flush the browser cache. Any change that breaks things, I back it out and try to do in even littler steps.

The static JSON file is also consumed by the browser’s JavaScript interpreter, so some coding misadventures won’t affect the Luup log. For those, use Firebug or another JavaScript debugger.

You have the JavaScript source. Sometimes you need to read it to figure out how the static JSON is used by the UI.

Validate the JSON and XML using online tools.

Use the forum. Post your discoveries.

Agreed, it’s slow going. But this is how reverse engineering works…