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
where the monitored entity is customized by Custom UI:
homeassistant:
customize:
input_number.test_level_2:
templates:
icon_color: >-
if (state <= 10) return 'yellow';
else
if (state <= 20) return 'brown';
else
if (state <= 30) return 'magenta';
else
if (state <= 40) return 'lightblue';
else
if (state <= 50) return 'green';
else
if (state <= 60) return 'orange';
else
if (state <= 70) return 'purple';
else
if (state <= 80) return 'red';
else
if (state <= 90) return 'gold';
else
return 'cyan';
Although the monitored entity is NOT changing - the whole card is flickering.
Same behaviour is observed with HA 2023.4.0 & different test setup (HA 2022.8.x, none of custom card were updated since that time).
Here is what this entity consists of:
Even when a state & all attributes are static, the entity seems to be "changing" - and the only possible "changing" part of it may be that "template" attribute added by Custom UI.
Earlier I registered an issue in Custom UI repo but it was closed w/o explanation - Mariusthvdb/custom-ui#59.
Is it possible to correct the config-template-card to ignore these "changing template"?
Javascript errors shown in the web inspector (if applicable):
Additional information:
The text was updated successfully, but these errors were encountered:
For the sake of experiment I tried to add an icon_color attribute, and used a regular Jinja template (it was after all in a entity) on that attribute. To my surprise this works perfectly
The example from the 1st post may be presented as:
input_number:
test_level_2:
...
template:
- sensor:
- name: test_level_2
state:
{{ states('input_number.test_level_2') }}
attributes:
icon_color:
{% set STATE = this.state|float(default=0) -%}
{%- if STATE <= 10 -%}
{%- set COLOR = 'yellow' -%}
{%- elif STATE <= 20 -%}
{%- set COLOR = 'brown' -%}
{%- elif STATE <= 30 -%}
{%- set COLOR = 'magenta' -%}
{%- elif STATE <= 40 -%}
{%- set COLOR = 'lightblue' -%}
{%- elif STATE <= 50 -%}
{%- set COLOR = 'green' -%}
{%- elif STATE <= 60 -%}
{%- set COLOR = 'orange' -%}
{%- elif STATE <= 70 -%}
{%- set COLOR = 'purple' -%}
{%- elif STATE <= 80 -%}
{%- set COLOR = 'red' -%}
{%- elif STATE <= 90 -%}
{%- set COLOR = 'gold' -%}
{%- else -%}
{%- set COLOR = 'cyan' -%}
{%- endif -%}
{{COLOR}}
So, if defining the icon_color is done by customize (as it is supposed to be with Custom UI) - the flickering is observed.
If the icon_color defined inside the template - NO flickering.
Checklist:
Release with the issue:
1.3.6
Last working release (if known):
Browser and Operating System:
Chrome 112.0.5615.50 (same with FF), Win10
Description of problem:
Consider this card:
where the monitored entity is customized by Custom UI:
Although the monitored entity is NOT changing - the whole card is flickering.
Same behaviour is observed with HA 2023.4.0 & different test setup (HA 2022.8.x, none of custom card were updated since that time).
Here is what this entity consists of:
Even when a state & all attributes are static, the entity seems to be "changing" - and the only possible "changing" part of it may be that "template" attribute added by Custom UI.
Earlier I registered an issue in Custom UI repo but it was closed w/o explanation - Mariusthvdb/custom-ui#59.
Is it possible to correct the
config-template-card
to ignore these "changing template"?Javascript errors shown in the web inspector (if applicable):
Additional information:
The text was updated successfully, but these errors were encountered: