Skip to content

Instantly share code, notes, and snippets.

@sstratoti
Created March 21, 2021 15:59
Show Gist options
  • Save sstratoti/5588cee4d0c57814d39164d63107453e to your computer and use it in GitHub Desktop.
Save sstratoti/5588cee4d0c57814d39164d63107453e to your computer and use it in GitHub Desktop.
Room Assistant Custom Button Card
type: 'custom:button-card'
color: black
color_type: icon
custom_fields:
date: |
[[[
return `<span style="color: var(--text-color-sensor);">${states['sensor.nodered_[whatever 1st entity Node Red Creates through integration]'].state}</span>`
]]]
time: |
[[[
return `<span style="color: var(--text-color-sensor);">${states['sensor.nodered_[whatever 2nd entity Node Red Creates through integration]'].state}</span>`
]]]
entity: sensor.time
show_name: false
show_state: false
show_icon: false
styles:
card:
- height: 100%
custom_fields:
date:
- padding-bottom: 2px
- align-self: center
- font-weight: bold
- font-size: 1em
time:
- padding-right: 10px
- align-self: center
- text-transform: uppercase
- font-weight: bold
grid:
- grid-template-areas: '"time" "date"'
- grid-template-columns: 1fr
- grid-template-rows: 'repeat(2, 1fr)'
name:
- font-weight: bold
- padding-bottom: 2px
- padding-right: 10px
- align-self: end
- justify-self: end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment