Hi. I’m struggeling a bit with mushroom template card and the use of (entity).
For getting the value I can use states(entity) to get the entity value. But I would like to use the (entity) for all templates in a card. When it comes to i.e. getting last_uppdated, I can only get it to work if I specify the entity_id itself, not by using xxxxx(entity).
- type: custom:mushroom-template-card
primary: '{{ states(entity) }}°C'
secondary: >-
Stue
{% set sec = (as_timestamp(now()) -
(as_timestamp(states.sensor.e1_stue_deteksjon_bevegelsessensor_air_temperature.last_changed)))-3600
%}
{{ sec|int|timestamp_custom('%H:%M:%S') }}
icon: >-
{% set update = (as_timestamp(now()) -
as_timestamp(states.sensor.e1_stue_deteksjon_bevegelsessensor_air_temperature.last_changed))-3600
| int %}
{% if (update > 2880) %}
mdi:robot-dead
{% else %}
mdi:home-thermometer
{% endif %}
icon_color: >-
{% set update = (as_timestamp(now()) -
as_timestamp(states.sensor.e1_stue_deteksjon_bevegelsessensor_air_temperature.last_changed)).3600
| int %}
{% if (update < 720) %}
green
{% elif (update < 1440) %}
yellow
{% elif (update < 2880) %}
orange
{% elif (update > 2880) %}
red
{% else %}
cyan
{% endif %}
entity: sensor.e1_stue_deteksjon_bevegelsessensor_air_temperature
layout: vertical
badge_icon: |-
{% set temp = states(entity)|float %}
{% if temp > 25.0 %}
mdi:fire
{% elif temp < 17 %}
mdi:snowflake-thermometer
{% else %}
mdi:hand-okay
{% endif %}
badge_color: |-
{% set temp = states(entity)|float %}
{% if temp > 25.0 %}
red
{% elif temp < 17 %}
blue
{% else %}
green
{% endif %}
fill_container: false
multiline_secondary: true
The above is my code for one card and I would like to come to a place where I do not use entity_id in it at all but it is taken from entity: . I tried using state_attr(entity,‘last_changed’) but with no luck.
If I enclosed in quotes, it is displayed, but not nice (the quote characters are displayed as well). And also, the other sensors, they are displayed, even though without quotes (see the first screenshot):
Hi,
i tried copy and paste several card templates and installed the card-mod plugin. But i still get the boarders around each inline element. Do i miss something?
Thanks.
:host {
/* Add background to host to prevent transparent card */
border-radius: var(--ha-card-border-radius, 12px);
background: var(--card-background-color);
/* Assign album art color to variable used in sticky media player */
{% if is_state('media_player.wohnzimmer_mediaplayer_music', ['playing', 'paused']) %}
/* --album-art-color: {{ states('sensor.muted_color') }};
{% else %}
/* Hide the sticky media player when it is idle */
display: none !important;
{% endif %}
/* Make the media player sticky at the bottom of the page */
position: sticky;
bottom: 12px;
}
:host {
/* Add background to host to prevent transparent card */
border-radius: var(--ha-card-border-radius, 12px);
background: var(--card-background-color);
/* Assign album art color to variable used in sticky media player */
{% if is_state('media_player.wohnzimmer_mediaplayer_music', ['playing', 'paused']) %}
/* --album-art-color: {{ states('sensor.muted_color') }}; */
{% else %}
/* Hide the sticky media player when it is idle */
display: none !important;
{% endif %}
/* Make the media player sticky at the bottom of the page */
position: sticky;
bottom: 12px;
}
I use the mushroom cover card and want to disable the functions for movement (only display the position, but no possibility to open close).
Is this possible?
sorry, i’m stuck… how do i get Mushroom and the dependencies installed,
tried doing a add on and searching for mushroom.
I’ve posted the code i got to do a dashboard i’m trying into a eskom.yaml and located it in a packages directory which i then pull in under home_assistant section,
G
hey,
small functional question:
I’m using a basic musroom entity card to display my current powerconsumption,
it’s working as intended, but I’d like to make it just a bit nicer by giving it a bg color depending on the entity value, is this something that can be done by the card? or will i need more plugins?