littlemaui
(Shawn Haywood)
June 7, 2025, 12:19am
1
I have a conditional card setup to display on my dashboard whenever devices on my fish tank reach certain values. For example, the button card below reminds me to check the reef tank if the temp get too high. Can I add script to this code to also display the current device value? Ie. Reef Tank Temp >87?
type: custom:button-card
name: Check Reef Tank
styles:
card:
- background: linear-gradient(to right, red, blue)
- box-shadow: none
name:
- font-size: 24px
- font-weight: bold
- color: white /* Change color */
littlemaui:
Tank Temp >
Something like this
type: custom:button-card
name: Check Reef Tank
show_label: true
label: |
[[[ return 'Reef Tank Temp > ' + states['sensor.tank_sensor'].state ]]]
styles:
card:
- background: linear-gradient(to right, red, blue)
- box-shadow: none
name:
- font-size: 24px
- font-weight: bold
- color: white /* Change color */
or so it’s hidden when below 87
type: custom:button-card
name: Check Reef Tank
show_label: true
label: >
[[[ if (states['sensor.tank_sensor'].state >= 87)
return 'Reef Tank Temp > ' + states['sensor.tank_sensor'].state ]]]
styles:
card:
- background: linear-gradient(to right, red, blue)
- box-shadow: none
name:
- font-size: 24px
- font-weight: bold
- color: white /* Change color */