SOLVED - Weird problem with uploaded JSON files on Vera Lite

I am trying to write my first plugin. I have come across a problem which I cannot understand the Vera behaviour and hope someone can point me in the right direction.

I have created a small plugin which has an implementation file, service file, lua file, device file and JSON file.

The JSON file I used to start off with was a cut and paste from an existing JSON file.

I upload all the files through the LUUP Files page, and created a device using the Create Device page, the device created, no problem. Reload Lua, the device showed up on the web page.

If I clicked any of the buttons or moved the sliders I got an error saying ‘No Implementation’. No problem, I updated the JSON file to the correct action names etc, the errors went, the variables updated correctly. This all worked well. I would make some changes, re-upload the files, reload, test, repeat.

Until one time I uploaded a new JSON file, reloaded and the device disappeared. I uploaded a copy of the old file, reloaded, no joy.

I have refreshed the browser, used another browser, reloaded mulitple times. created new devices. None of these steps make any difference, the device will not display in the Advanced UI. They display in the Simple UI, they display on AutHomationHD. Just not in the Advanced UI.

The devices initialise as I can see the ouput in the Lua log file. I can adjust the variables using the Test Lua page. The log shows the variables updating ok.

If I change the

<staticJson>D_WindowOpener.json</staticJson>[/code] line in the Device XML file to any of the std JSON files. eg [code]<staticJson>D_Heater1.json</staticJson>

All previously created devices reappear in the Advanced UI. Any of the std JSON files work.

There are no errors I can see in the log file, they just simply do not display in the Advanced UI.

If I copy the contents of the std JSON file to notepad and Save As another name, upload that file so that it is exactly the same content except my own name it does not work.
To verify the file contents are the same I have copied the json.lzo files to /tmp, pluto-lzo decompressed them and ran diff against the two files. Exactly the same. run ‘file’ on the two files reports that they have the same contents

D_WindowOpener.json: ASCII English text, with CRLF line terminators D_Heater1.json: ASCII English text, with CRLF line terminators

I can’t figure it out. Has anyone had the same problem??

If there is a syntax error in the json file, the device may disappear but no error is logged. Try running your file through [url=http://jsonlint.com/]http://jsonlint.com/[/url].

Typical errors that occur when editing json are missing or extraneous commas and parentheses.

[quote=“RexBeckett, post:2, topic:183623”]If there is a syntax error in the json file, the device may disappear but no error is logged. Try running your file through [url=http://jsonlint.com/]http://jsonlint.com/[/url].

Typical errors that occur when editing json are missing or extraneous commas and parentheses.[/quote]

Thanks for the response, I checked the file contents of several of the files I had tried with jslint, they came back valid.

I have just solved the problem though.

It was to do with my use of the original files. When I did a search for JSON files to use I found files existed in 6 locations with the same name. I checked a few and found that they seemed to be the same file, so I arbitrarily downloaded a copy of the files from one of the directories.
This was a mistake, as they are not all the same files. They do differ. This was why they would show up on all but the Advanced UI. I was not using a file from the cmh-lu_UI6 directory.

When I used the file contents of the UI6 based file it worked fine. I can now carry on with my plugin.

Assumptions I made bit me in the arse.