Hey all! Given I couldn’t find a clear way to do this in the forums, I thought I would share a little css template I came up with to be able to render multiple lights on top of each other AND map their color and hue dynamically to a light entity - EG:
Individual Lights:
To have multiple lights overlayed ontop of each other, the solution is actually pretty simple. You render an image for each individual light and use the CSS property filter
mix-blend-mode: lighten
This will make sure only the “light” part of the image is shown, and will blend together any amount of images on top.
Hue and Opacity
To map one of your light images to the actual live RGB color of the bulb, you can use the following CSS template style which will adjust the hue rotation to the hue of the bulb (in this case, light.table):
style:
filter: '${ "hue-rotate(" + (states[''light.table''].attributes.hs_color ? states[''light.table''].attributes.hs_color[0] : 0) + "deg)"}'
OR, include saturation (I found it buggy):
style:
filter: '${ "hue-rotate(" + (states[''light.table''].attributes.hs_color ? states[''light.table''].attributes.hs_color[0] : 0) + "deg) saturate(" + (states[''light.table''].attributes.hs_color ? states[''light.table''].attributes.hs_color[1] : 100)+ "%)"}'
To map opacity to the entity’s brightness, use this css template:
style:
opacity: '${ states[''light.table''].attributes.brightness / 255 }'
In my config, I also added an image for day and night and blended those together as well giving a different appearence of my home in the evening and daytime, for good measure. Hopefully this helps some of you make even crazier floorplans! If you need a place to start, this is a brilliant overview of how to make your own floorplan:
You can check out my full config here:
Cheers!