Is there a way to conditionally add additional custom attributes for all devices/entities of a domain?
For example, I want to add a custom attribute called friendly_color_temp
for light
domain type.
Closest I found is Light Template and Customize Domain but neither really do what I want.
I am looking to do something like:
customize_domain:
light:
icon: mdi:home
friendly_color_temp:
{% if is_state('on') %}
{% if state_attr('color_temp') %}
{% color_temp_in_kelvin = 1000000/color_temp %}
{% if color_temp_in_kelvin < 3000 %>
Warm White
...
My question is that I have special computed attributes for each device and I want to reference the values easily when I use them in cards, node-red, etc.