Static JSON files for devices - templates/examples?

I think I have a working version to meet my second objective now, which as a non-plug-in and something I’m trying to keep simple - I’m calling it a “Vera Widget”. :slight_smile: .

This first one will just present you with your external IP address.

To do it, I’ve used the light sensor device as the basis, and after uploading the following new Widget1.json file to Vera and added some Lua code to the LuaStartUp (the code leverages things like the luup.create_device() and the luup.call_timer() functions ) it will try to find the widget, if not there it’ll create it and then keep it updated going forward checking every hour.

D_Widget1.json

{
	"default_icon": "light_sensor_default.png",
	"x":"2",
	"y":"4",
	"inScene":"0",
	"Tabs": [
		{
			"Label": {
				"lang_tag": "ui7_tabname_control",
				"text": "Control"
			},
			"Position": "0",
			"TabType": "flash",
			"top_navigation_tab": 1,
			"ControlGroup":[
				{
					"id": "1",
					"scenegroup": "1"
				}
			],
			"SceneGroup":[
				{
					"id": "1",
					"top": "1.5",
					"left": "0.25",
					"x": "1.5",
					"y": "2"
				}
			],
			"Control": [
				{
					"ControlGroup":"1",
					"ControlType": "variable",
					"top": "1",
					"left": "0",
					"Display": {
						"Service": "urn:nodecentral-net:serviceId:Widget1",
						"Variable": "ExternalIP",
						"Top": 60,
						"Left": 145,
						"Width": 75,
						"Height": 20
					}
				}
			]
		},
		{
			"Label": {
				"lang_tag": "ui7_settings",
				"text": "Settings"
			},
			"Position": "1",
			"TabType": "javascript",
			"ScriptName": "shared.js",
			"Function": "simple_device"
		},
		{
			"Label": {
				"lang_tag": "ui7_advanced",
				"text": "Advanced"
			},
			"Position": "2",
			"TabType": "javascript",
			"ScriptName": "shared.js",
			"Function": "advanced_device"
		}
	],
	"eventList2": [],
	"device_type": "urn:schemas-micasaverde-com:device:LightSensor:1"
}

@rigpapa - I know it’s no where near as comprehensive as your plugins, but as a learning exercise and a simple dashboard item, I’m quite please with myself :slight_smile:

If anyone can think of any ways to further polish the .json, please let me know