How can I repair state icons?

I have repaired several of my older plugin Default icons by editing their respective json files and moving the icons to “/www/cmh/skins/default/icons/” . I haven’t been sucessfull in repairing the “state_icons”. I copied the “state_icons” into “/www/cmh/skins/default/icons/”. The Default icon works as expected but the state_icons are never displayed. Here is my most recent attempt in repairing the Virtual Clock plugin:

{
  "default_icon": "../../../icons/ic_aclock.png",
  "halloIconsDir": "pics\/hallo",
  "inScene":"1",
    "DisplayStatus": {
        "Service": "urn:micasaverde-com:serviceId:SecuritySensor1",
        "Variable": "Tripped",
        "MinValue": "0",
        "MaxValue": "1"
    },
    "state_icons": [
        "../../../icons/ic_aclock_0.png",
        "../../../icons/ic_aclock_100.png",
    ],
  "x":"2",
  "y":"4",
  "doc_url": {
    "doc_language": 1,
    "doc_manual": 1,
    "doc_version": 1,
    "doc_platform": 0,
    "doc_page": "devices"
  },

Thank you, Mark

I may be off track, but was nonetheless surprised to see an ‘ellipsis’ character

being used between forward slashes in the directory structure of this file.
Aren’t there supposed to be just two periods, to connote “up one level”?

../../../icons/ etc.

Also, beware the dreaded quotes-that-aren’t-quotes issue when posting code between the Forum and your Lua editor.

2 Likes

That’s strange. I copied and pasted it here and the extra dots were added . Here is the corrected text using a jpg.

json

Thank you, Mark

1 Like

It is the usual forum problem…

…you must quote code correctly between delimiters like this

```json
whatever code you want 
goes here
```

To get the right (or nearly right) syntax highlighting, make sure you use the right language tag, typically json, xml, or Lua.

I’ve corrected the formatting of the original post.

1 Like

Hi,

Not sure if you removed the state conditions for your state icons or not, else it should work with the path you use. The state icon definitions should be something like

"state_icons": [{
		"img": "../../../icons/ic_aclock_0.png",
		"conditions": [{
			"service": "urn:micasaverde-com:serviceId:SecuritySensor1",
			"variable": "Tripped",
			"operator": "==",
			"value": 0
		}]
	}, {
		"img": "../../../icons/ic_aclock_100.png",
		"conditions": [{
			"service": "urn:micasaverde-com:serviceId:SecuritySensor1",
			"variable": "Tripped",
			"operator": "==",
			"value": 1
		}]
	}],

Cheers Rene

1 Like

Thank you reneboer for the reply.
I edited the json file with the code you posted and the correct icons are now displayed perfectly. :grin: Thank you!
This is an older unsupported plugin and I only edited the “default_Icon” path and the “state_icon” paths as shown above. The “state conditions” were not in the json file before. I never would have figured this out.

Thank you, Mark

1 Like

OK, two dumb but related questions… what directory\context are these plug-in running under? Seems odd that the path back to the default icon location for plug-ins is ../../../icons

And where are the system default icons actually stored so I can see what is available? Probably the answer to the same question above… but maybe not! When I Putty into the box I can’t get it to reveal to me where the PNG files are… infact doing a ls -R *.png or even ls -R -L *.png from the root tells me there are no files found which is obviously BS.

Hi,

There are several directories under /www/cmh/skins/default/img that have the different sets of icons. The ones used for the standard devices are at /www/cmh/skins/default/img/devices/device_states

This is UI7 of course. The odd path now has to do with NVRAM space savings and limit of rewrites on updates in V7.0.30. Excellent change making me then think Vera FW was alive again :flushed:

Cheers Rene

I know @reneboer has already provided the correct path, but for your future use, the reason these commands aren’t doing what you want is shell wildcard expansion biting you (it’s matching in the current directory, not the traversed directories), and beyond that, the mount points and symbolic links complicate it as well. Try:

cd /www/cmh ; find . -follow -name '*.png'

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.