Advertisement
FlyHigh-Swe

Untitled

Nov 4th, 2020
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.84 KB | None | 0 0
  1. -   type: custom:button-card
  2.                                 entity: ""
  3.                                 styles:
  4.                                     card:
  5.                                      #- padding: 4%
  6.                                       - font-size: 10px
  7.                                       #- border-radius: var(--button-card-border-radius)
  8.                                      # - background-color: var(--button-card-background-color)
  9.                                       - color: white
  10.                                     grid:
  11.                                       - grid-template-areas: '"time date warn" "time day warn"'
  12.                                       - grid-template-columns: 40% 40% 20%
  13.                                       - grid-template-rows: 1fr 1fr
  14.                                     custom_fields:
  15.                                       time:
  16.                                         - justify-self: start
  17.                                         - font-size: 52px
  18.                                       date:
  19.                                         - justify-self: end
  20.                                         - font-size: 24px
  21.                                         - color: white
  22.                                       day:
  23.                                         - justify-self: end
  24.                                         - font-size: 24px
  25.                                         - color: var(--secondary-text-color)  
  26.                                       warn:  
  27.                                         - justify-self: end
  28.                                         - font-size: 24px
  29.                                  
  30.                                 custom_fields:
  31.                                     time: >
  32.                                      [[[ return states['sensor.time'].state ]]]
  33.                                     date: >
  34.                                      [[[ return states['sensor.date'].state ]]]
  35.                                     day: >
  36.                                      [[[ return states['sensor.dayoftheweek'].state ]]]
  37.                                     warn:
  38.                                       card:
  39.                                         type: custom:button-card
  40.                                         #entity: input_boolean.warn_light
  41.                                         icon: mdi:exclamation-thick
  42.                                         show_name: false
  43.                                         show_state: false
  44.                                         tap_action:
  45.                                             action: navigate
  46.                                             navigation_path: '/lovelace/Larm_och_varningar'
  47.                                         styles:
  48.                                           card:  
  49.                                             - background-color: transparent
  50.                                             - color: transparent
  51.                                           icon:
  52.                                             - color: >  
  53.                                                         [[[  
  54.                                                             if (states['input_boolean.warn_light'].state === 'on' )
  55.                                                                     return "rgb(255,165,0)";
  56.                                                             if (states['input_boolean.alarm_light'].state === 'on' )
  57.                                                                     return "rgb(255,0,0)";
  58.                                                             else
  59.                                                                     return "green";
  60.                                                         ]]]
  61.                                        
  62.                                 tap_action: none
  63.                                 hold_action: none
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement