I am wondering how I would go about getting the temp and humidity in one line. I have it done in the mushroom template card but I want to see if I can get it to show the same thing in the button card.
Here’s what the mushroom template card looks like and the code:
type: custom:mushroom-template-card
primary: Family Room
secondary: >-
{{states('sensor.family_room_temperature') | int }}°F |
{{states('sensor.family_room_humidity') | int }}%
icon: mdi:sofa
icon_color: |-
{% if is_state('input_boolean.toggle_fr_occ', 'on') %}
purple
{% endif %}
layout: vertical
tap_action:
action: navigate
navigation_path: /dashboard-main/fr
card_mod:
style: |
ha-card {
--ha-card-background: rgba(0,0,0,.3);
border: 2px solid rgba(147, 112, 219, .5);
--card-primary-font-size: 1em !important;
--card-secondary-font-size: 1.2em;
}
And here’s the card I’m trying to do and what I have so far. I want to display an ‘F’ after the temp and then add the pipe and humidity following it but I’m not sure how to write the code to do so.
type: custom:button-card
entity: input_boolean.toggle_pre_game
size: 16%
icon: mdi:sofa
show_state: false
show_name: false
label: Family Room
show_label: true
tap_action:
action: toggle
styles:
grid:
- grid-template-columns: 100%
- grid-template-rows: 1fr
- grid-template-areas: '"i" "l" "games"'
card:
- border: 2px solid rgba(0,150,255, .5)
- background-color: rgba(0,0,0,.2)
icon:
- color: rgba(138, 121, 93, 1)
custom_fields:
games: |
[[[ return states['sensor.media_room_temperature' ].state; ]]]
state:
- value: 'off'
styles:
icon:
- color: rgba(105,105,105,1)
- value: 'on'
styles:
card:
- filter: opacity(100%)
icon:
- color: rgba(0,150,255, 1)
Is this possible?