ControlType for icons/images

Is there a ControlType for icons/images?

Is there a way to change the device icon dynamically?

This functionality is needed for porting [tt]AUC[/tt] and [tt]GWC[/tt] to UI5.

There is the ControlType image, which is used by the camera.

Only by modifying the Json file. Not that dynamic if you ask me. :slight_smile:

The Enhancement already exists… for a similar reasoning, I wanted to include images in the Google Weather device (and others) natively:
http://bugs.micasaverde.com/view.php?id=1386

The secondary use for it was going to be to include Google Charts.

and it needs to not have all the extra stuff that a Camera might have, like panning controls, etc, etc. A plain image, sourced from a URL.

[quote=“Ap15e, post:1, topic:170510”]Is there a ControlType for icons/images?

Is there a way to change the device icon dynamically?

This functionality is needed for porting [tt]AUC[/tt] and [tt]GWC[/tt] to UI5.[/quote]

Well, you could have five icons by using the same mechanism used for dimmable lights. Essentially you have a display service variable and min/max values defined. The rendering uses the current value - min divided by max to figure out which of the five potential images (which use the _0, _25, _50, _75, _100) to use. Of course the icons would have to exist in vera, which means they would have to be put there manually.

Here’s an example of how the display service is defined:

"flashicon": "icons/Dimmable_Light.swf", "imgIconBody": "pics/devices/Dimmable_Light_BODY.png", "imgIconDimmable": "pics/devices/Dimmable_Light_SWITCH.png", "imgIconTurnable": "", "imgIconMin": "", "imgIconMax": "", "halloIconsDir": "pics/hallo", "DisplayStatus": { "Service": "urn:upnp-org:serviceId:Dimming1", "Variable": "LoadLevelStatus", "MinValue": "0", "MaxValue": "100"

Note: imgIconBody, imgIconDimmable, imgIconTurnable, imgIconMin, imgIconMax, and halloIconsDir are not used in UI4 or UI5 and are just cluttering up the json. I assume they are from some earlier UI revision.

@MCV, ever though of pruning user_data of obsolete settings (and camera settings you automatically added to every device during the UI5 upgrade)?

Thanks for the suggestions.

There is the ControlType image, which is used by the camera.

IIUC, one would have to install a virtual camera and a http handler to make use of this ControlType - not the way to go for me …

Well, you could have five icons by using the same mechanism used for dimmable lights.

Far too limited to be of use for more complex plugins, so we are back at [tt]http://bugs.micasaverde.com/view.php?id=1386[/tt]

Just for reference, here are the results from harvesting [tt]ControlTypes[/tt] from [tt]/etc/cmh-lu[/tt]:

"ControlType": "button",
"ControlType": "checkbox",
"ControlType": "image",
"ControlType": "image_player",
"ControlType": "input",
"ControlType": "js_button",
"ControlType": "label",
"ControlType": "slider",
"ControlType": "slider_vertical",
"ControlType": "variable",

AFAIK there are no obsolete settings in the user_data (though there may be on or two if upgrading from UI4 with Keep settings). The camera settings on every device was a bug in some firmware versions, but it has been fixed.