Changing icon

I have an outdoor wayne dalton plug relay and it’s running my waterfall. Is there a way to change the icon in mios to not be a lightbulb?

Im not a programmer, but i think that is done through editing the .JSON file of your plugin.
Maybe @guessed or @futzle can help you with that…

Not easily. You would essentially have to create a new Luup device (D_xxx.xml) file, which references a new Static JSON (D_xxx.json) file, which points to your new icon. Then you would have to edit the device_file line in the device’s Advanced tab to point to your new file.

Even if you did that, there’s a pretty anaemic collection of icons to choose from. The /www/cmh/skins/default/icons/ directory on the Vera has all of the available icons, and none of them look very waterfallish to me. I’ve no idea if adding extra images to that directory makes them available for devices to use. Something for me to investigate; I’ve got the same issue with the Public Holiday virtual switch.

You can use a link to an external image in the JSON file:

"flashicon": "http://web.site.com/image.png",

I wish icons were changeable, I really hate that light level on a sensor uses the same icon as a powered up switch, it means if you have these sensors you can not glance at the dashboard and see what is powered on since there will be "lightbulbs " all over the place

To all, if you think we need other/more icons in Vera’s UI, maybe this is the moment to contribute in the UI board and/or new UI(5) thread here:

http://forum.mios.com/index.php?board=3.0

http://forum.mios.com/index.php?topic=3097.0

Maybe usefull to post icons/images as attachments too.

For Luup plugin programmers: here are the results of my investigations into customizing icons in plugins.

Nice job, futzle. Very in-depth and informative.

@futzle

Great work! Thanks for documenting that.
Still not easy for us non-programmers, but certainly a great reference for plugin builders and users who would like to swap out existing icons for a devicetype with their own.

I presume if someone would like to use a device (like a switch)
for something other than its default use (for instance create a doorbelsensor out of a z-wave device) one would have to take the original XML files of the device (e.g binary switch or motiondetector) and rename them to something unique (doorbell)?

Problem i see with this solution that either ALL switches get the new icon or none at all
because Vera doesnt know the switch is being used for something other than its originally intended use and detects functionality upon inclusion thus selecting the appropriate devicefiles for that devicetype.

Would there be a solution to selecting unique icon for a certain device (#) in your opinion?
i think @guessed filed a bug a while ago related to this. He stumbles on this again while overhauleing the ping sensor code.

If it’s for a device created by the user, then this can be achieved by creating an unique device file and JSON file. If the device is created by MiOS, then it will use one of the existing device files. Changing the icon for it will change it for all the devices that use the same device file.

@mcvflorin

you understood exactly what i was referring to (while i was editing my post because of errors introduced by posting from my phone ;))

Maybe theres a feasible workaround for that?

Correction to my previous post:

If it's for a device created by the user, then this can be achieved by creating an unique device [b]type[/b] and JSON file.

If there are two or more device files (that reference different JSON files) for the same device type, the displayed icon will be the one from the last parsed JSON file.

Unfortunately, I don’t know of any workarounds for this.

@guessed’s bug# 1501. Also running into this when attempting to do custom labels for the Virtual Device.

hi stevenroka, can you please be kind enough to explain the outdoor plug relay for your waterfalls. is this a device you just plug in a regular outlet or it has to be wired. currently, i am using outdoor intermatic appliance module to run my waterfalls. thanks in advance.