another quest:
trying to reflect several power phases in the icon color, this template doesn’t work unfortunately. What should i change to get it to show the desired colorings"
First, the logic is incorrect. the second state > 500 will never be evaluated as it will stop after state > 0. As regards the formatting, see my complete example here.
is that redundant? since no other condition is met, it would be the final formatting? Will try that, thanks.
btw, if not declared i take it the default would be used? Or would that throw an error.
The statements are evaluated sequentially. If any return is encountered, it will stop. The else is not required as that statement will be evaluated only if all the preceding statements are false.
making progress, changing from rgb to hs_color, Ive customized my lights showing both as extra_data_template, enabling easy translation between the both of them. Im not yet satisfied with the displayed result which i hope you can help me with:
well thank you, it most certainly does now. Couldn’t find any background on this notation, so this is most educational, as ever. Really appreciate your posts !
I take it I could add a third, attributes.xy_color and add an extra line for this without issues?
btw, is the return null; necessary?
If there is no attribute, it cant be displayed, so adding this might be superfluous?
While i have your expertise at hand, pleas let me ask how to have a scene turn on a light with lets say hs color.
I believe the null is necessary because you need to return something, and if that if-statement fails during any circumstances, then null should be returned. It’s for safety.
As for the hs_color, I’m not sure as I don’t have one of those devices.
There is no built-in support for that, but the system is flexible enough so you can template state_card_mode to be either no-slider or another value depending on state
been trying some customization with group/tab icons.
Changing the icon works just fine, based on a template, changing the color won’t just yet. Isn’t this possible? or do we need a special customization for that.