Hi,
I found a lot the last days in here, but can you tell me how I can adress this information manually
like mushroom-update-card does automatically.
states(…) shows only off
and it seems to be no attribute because its not in the attributes-list.
hare0815
(Harald)
January 19, 2023, 5:23pm
2
hi,
i did it like this
go to the dashboard
add a card
select 'by entities
search for 'home assistant
select the entries you want
i have created the following card:
cards:
- type: entities
entities:
- entity: update.check_home_assistant_configuration_update
secondary_info: last-changed
- entity: update.home_assistant_core_update
secondary_info: last-changed
- entity: update.home_assistant_operating_system_update
secondary_info: last-changed
- entity: update.home_assistant_supervisor_update
secondary_info: last-changed
- entity: sensor.home_assistant_operating_system_newest_version
secondary_info: last-changed
- entity: sensor.home_assistant_operating_system_version
secondary_info: last-changed
state_color: true
title: Home Assistant
If you do not see sensors, they may be disabled.
I have done the following steps to activate them
Settings
Entities
search for ‘home assistant’
If you see the ‘deactivated’ icon in the right column, click on it and activate the entity in the next window.
thx man. i have to give more details. my fault. i built the following card. my goal is, if there is a new version. that the 3 text-values change from green to red to make it more eye-catching… but the if-then statements are not functioning.
i found al lot of examples using “is_state” and not statements where two sensors were compared. and ive got the idea to make something like is_state(…)=‘up-top-date’ or so. but i could not get it to work.
type: entities
show_header_toggle: false
entities:
- type: custom:multiple-entity-row
entity: update.home_assistant_core_update
name: HA Core
icon_type: entity-picture
show_state: false
entities:
- entity: update.home_assistant_core_update
attribute: installed_version
name: AKTUELL
tap_action:
action: none
- entity: update.home_assistant_core_update
attribute: latest_version
name: VERFÜGBAR
tap_action:
action: none
style:
hui-generic-entity-row:
$: |
.info.pointer {
{% if
state_attr('update.home_assistant_core_update','installed_version') | string
==
state_attr('update.home_assistant_core_update','latest_version') | string
%}
color: green;
{% else %}
color: red;
{% endif %}
}
.: |
div.entity:nth-child(2) span {
{% if
state_attr('update.home_assistant_core_update','installed_version')
==
state_attr('update.home_assistant_core_update','latest_version')
%}
color: green;
{% else %}
color: red;
{% endif %}
}
div.entity:nth-child(2) {
{% if
state_attr('update.home_assistant_core_update','installed_version')
==
state_attr('update.home_assistant_core_update','latest_version')
%}
color: green;
{% else %}
color: red;
{% endif %}
}
- type: custom:mushroom-update-card
entity: update.home_assistant_core_update
name: ' '
show_buttons_control: true
icon_type: none
layout: vertical
secondary_info: none
primary_info: none
style: |
ha-card {
border: solid 0px ;
}
1 Like
hare0815
(Harald)
January 26, 2023, 9:28am
4
hi,
I have tested (the upper part) of your card and the same problems.
{{ is_state('update.home_assistant_core_update','on') }}
should do the work …
However, your IF command should work exactly the same way.
When I test it with the developer tools / template, there are no syntax errors.
BUT:
If I set a fixed color value at entity level , it works for me …
- entity: update.home_assistant_core_update
attribute: latest_version
name: VERFÜGBAR
tap_action:
action: none
styles:
color: green;
another test with
styles:
color: {{ 'green;'}}
does not work for me.
Maybe ‘templates’ are not supported here.
In github I found several tickets to support templates.
Maybe your problem is identical to this one:
opened 07:21AM - 18 Apr 21 UTC
closed 10:36AM - 19 Apr 21 UTC
It would be really nice to be able to change the color of an entity value based … on some attribute. For instance I'm now displaying the current price of electricity, and I'd like to have the text be red when it's expencive. Is there currently a way to do that?
hare0815
(Harald)
January 26, 2023, 11:03am
5
hi,
… that has left me no peace …
it seems to work with the lovelace card_mod extension
my current test:
- entity: update.home_assistant_core_update
attribute: latest_version
name: VERFÜGBAR
tap_action:
action: none
card_mod:
style: |
hui-generic-entity-row:
$: |
.info.pointer { .....
- type: custom:mushroom-update-card
entity: update.home_assistant_core_update
name: ' '
show_buttons_control: true
icon_type: none
layout: vertical
secondary_info: none
primary_info: none
card_mod:
style: |
ha-card {
border: solid 0px;
}
OMG. Thx 4 hlp. The solution was so near. Everytime i was looking on the entities they were ‘off’, that I never saw it. My working solution is:
style:
hui-generic-entity-row:
$: |
.info.pointer {
{% if is_state('update.home_assistant_core_update','on') %}
color: red;
{% else %}
color: green;
{% endif %}
}
.: |
div.entity:nth-child(2) span {
{% if is_state('update.home_assistant_core_update','on') %}
color: red;
{% else %}
color: green;
{% endif %}
}
div.entity:nth-child(2) {
{% if is_state('update.home_assistant_core_update','on') %}
color: red;
{% else %}
color: green;
{% endif %}
}
1 Like