Earlier in this thread I discussed a way, using a python script, to incorporate the Philips Hue Icons into an HTML format usable by HA. Starting 0.110.x, the method to load these icons using HTML is no longer possible, so that script is no longer usable.
I haven’t fixed the script, but I will however show a way one can manually convert the HTML file to a javascript file.
(I borrowed and modified this javascript file from jncanches posted here )
Name the file something like: hass-HueIconPack.js
and place it at HA_CONFIG_DIR/www/YOUR_PATH/hass-my_icons.js
The file example:
var icons = {
"heroesBloom": [0, 0, 31.03030303030303, 31.03030303030303, "M25.6928374,...."],
"bulbFlood": [0, 0, 32.0, 32.0, "M8.1699,10.0847......"]
};
async function getIcon(name) {
var svgDef = icons[name];
var primaryPath = svgDef[4];
return {
path: primaryPath,
viewBox: svgDef[0] +" " + svgDef[1] + " " + svgDef[2] + " " + svgDef[3]
};
}
window.customIconsets = window.customIconsets || {};
window.customIconsets["phu"] = getIcon;
For example, from the html file generated earlier say for heroesBloom:
-
the numbers in the javascript file: 31.03030303030303 31.03030303030303
come from the html file parameters transform="scale(31.03030303030303 31.03030303030303)
-
The string in the javascript file "M25.6928374,...."
comes from the html file parameter: <path d="M25.6928374,...."
In the main configuration.yaml file add the following:
frontend:
extra_module_url:
- /local/YOUR_PATH/hass-my_icons.js
The icon configuration itself in yaml remains the same, for example: icon: phu:heroesBloom