You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
It is more of a visual optimization than a problem, but it would be nice if there was a config setting that would add random colors to each entity. Ideally for parents and children and only if no manual color is defined.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Add config setting like color_random: true that automatically assigns each entity (that has no defined color: property) a random color.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I wrote myself a short jinja template that does this for me, but since the random function updates every few seconds, it is a bit of a pain to copy and of course: it is far less elegant than having a built in feature :)
{% set sensors = states.sensor | selectattr('entity_id', 'search', 'energy_today') %}
{% set filtered_sensors = sensors | selectattr('entity_id', 'search', 'energy_today(_\d+)?$') %}
{% if filtered_sensors %}
{% for sensor in filtered_sensors %}
{{ "- type: entity" }}
{{ "children: []" }}
{{ "entity_id: " + sensor.entity_id }}{% set random_color = "rgb(" ~ range(0, 256) | random ~ "," ~ range(0, 256) | random ~ "," ~ range(0, 256) | random ~ ")" %}
{{ "color: " + random_color }}{% endfor %}
{% endif %}
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
AleXSR700
changed the title
Add random color to each entity
[FR] Add random color to each entity
Sep 17, 2024
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
It is more of a visual optimization than a problem, but it would be nice if there was a config setting that would add random colors to each entity. Ideally for parents and children and only if no manual color is defined.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Add config setting like
color_random: true
that automatically assigns each entity (that has no definedcolor:
property) a random color.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I wrote myself a short jinja template that does this for me, but since the random function updates every few seconds, it is a bit of a pain to copy and of course: it is far less elegant than having a built in feature :)
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: