Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: custom:button-card
- show_name: false
- show_state: false
- styles:
- grid:
- - grid-template-areas: '"header" "stack_alistair" "stack_andreia"'
- grid-template-columns: 1fr
- grid-template-rows: auto
- align-content: start
- align-self: start
- justify-content: start
- justify-self: start
- column-gap: 20px
- card:
- - background-color: transparent
- border: solid 2px transparent
- height: 375px
- width: 302.5px
- padding: 0px 10px 10px 10px
- margin: 0px 0px 0px 0px
- custom_fields:
- header:
- card:
- type: custom:button-card
- name: Health
- styles:
- grid:
- - grid-template-areas: '"n toggle"'
- align-content: center
- align-self: center
- justify-content: center
- justify-self: center
- name:
- - font-size: 18px
- font-weight: 600
- justify-self: start
- align-self: center
- text-align: left
- padding: 10px 0px 0px 0px
- card:
- - background-color: transparent
- border-radius: 0px
- padding: 0px 15px 0px 15px
- height: 50px
- custom_fields:
- toggle:
- card:
- type: custom:button-card
- styles:
- grid:
- - grid-template-areas: '"alistair andreia"'
- grid-template-columns: 1fr 1fr
- align-content: center
- align-self: center
- justify-content: center
- justify-self: center
- card:
- - background: rgba(255,255,255,0.1)
- width: 140px
- border-radius: 25px
- padding: 0px 0px 0px 0px
- margin: 0px 0px -5px 0px
- align-content: end
- custom_fields:
- alistair:
- card:
- type: custom:button-card
- name: Alistair
- entity: input_select.health_toggle
- show_icon: false
- show_name: true
- show_state: false
- tap_action:
- action: perform-action
- perform_action: input_select.select_option
- target:
- entity_id:
- - input_select.health_toggle
- data:
- option: Alistair
- state:
- - value: Alistair
- styles:
- card:
- - background-color: rgba(255,255,255,0.4)
- name:
- - color: white
- styles:
- card:
- - background-color: transparent
- border-radius: 25px
- height: 25px
- name:
- - font-size: 12px
- font-weight: 400
- color: rgba(255,255,255,0.3)
- andreia:
- card:
- type: custom:button-card
- name: Andreia
- entity: input_select.health_toggle
- show_icon: false
- show_name: true
- show_state: false
- tap_action:
- action: perform-action
- perform_action: input_select.select_option
- target:
- entity_id:
- - input_select.health_toggle
- data:
- option: Andreia
- state:
- - value: Andreia
- styles:
- card:
- - background-color: rgba(255,255,255,0.4)
- name:
- - color: white
- styles:
- card:
- - background-color: transparent
- border-radius: 25px
- height: 25px
- name:
- - font-size: 12px
- font-weight: 400
- color: rgba(255,255,255,0.3)
- stack_alistair:
- card:
- type: conditional
- conditions:
- - condition: state
- entity: input_select.health_toggle
- state: Alistair
- card:
- type: custom:button-card
- template: health_template
- variables:
- var_sleep: sensor.alistair_total_sleep_hmm
- var_sleep_score: sensor.alistair_bed_sensor_sleep_score
- var_deep: sensor.alistair_bed_sensor_deep_sleep
- var_rem: sensor.alistair_bed_sensor_rem_sleep
- var_light: sensor.alistair_bed_sensor_light_sleep
- var_min: input_number.alistair_heart_rate_min
- var_avg: sensor.alistair_bed_sensor_average_heart_rate
- var_max: input_number.alistair_heart_rate_max
- var_steps: input_number.alistair_steps
- var_move: input_number.alistair_move
- var_template: circular-gauge-alistair
- stack_andreia:
- card:
- type: conditional
- conditions:
- - condition: state
- entity: input_select.health_toggle
- state: Andreia
- card:
- type: custom:button-card
- template: health_template
- variables:
- var_sleep: sensor.andreia_total_sleep_hhmm
- var_sleep_score: sensor.andreia_bed_sensor_sleep_score
- var_deep: sensor.andreia_bed_sensor_deep_sleep
- var_rem: sensor.andreia_bed_sensor_rem_sleep
- var_light: sensor.andreia_bed_sensor_light_sleep
- var_min: input_number.andreia_heart_rate_min
- var_avg: sensor.andreia_bed_sensor_average_heart_rate
- var_max: input_number.andreia_heart_rate_max
- var_steps: input_number.andreia_steps
- var_move: input_number.andreia_move
- var_template: circular-gauge-andreia
- card_mod:
- style: |
- :host {
- display: block;
- position: relative; margin: 0px 6px 0px 0px;
- }
- :host::before {
- content: "";
- position: absolute;
- inset: 0;
- border-radius: 30px;
- -webkit-backdrop-filter: blur(50px);
- z-index: -1;
- padding: .1rem;
- background: linear-gradient(60deg,
- rgba(255,255,255,0.0) 0%,
- rgba(255,255,255,0.2) 49%,
- rgba(255,255,255,0.2) 51%,
- rgba(255,255,255,0.0) 100%);
- -webkit-mask:
- linear-gradient(#fff 0 0) content-box,
- linear-gradient(#fff 0 0);
- -webkit-mask-composite: xor;
- mask-composite: exclude;
- z-index: 0; filter: saturate(140%);
- }
- :host::after {
- content: "";
- background: linear-gradient(180deg, rgba(255,255,255, 0.1) 20%, rgba(255,255,255, 0.0) 100%);
- position: absolute;
- inset: 0;
- border-radius: 30px;
- box-shadow: inset -8px 10px 15px rgba(0, 0, 0, 0.1);
- z-index: -1;
- -webkit-backdrop-filter:blur(30px) saturate(110%) brightness(90%);
- filter: drop-shadow(3px 3px 10px rgba(0, 0, 0, 0.2)); }
- health_template:
- variables:
- var_sleep: null
- var_sleep_score: null
- var_deep: null
- var_rem: null
- var_light: null
- var_min: null
- var_avg: null
- var_max: null
- var_steps: null
- var_move: null
- type: custom:button-card
- show_state: false
- show_name: true
- show_icon: false
- styles:
- grid:
- - grid-template-areas: '"divider1" "sleep" "divider2" "heart" "divider3" "stats"'
- align-content: start
- align-self: start
- justify-content: start
- justify-self: start
- card:
- - background-color: transparent
- padding: 0px
- border-radius: 0px
- align-content: start
- align-self: start
- justify-content: start
- justify-self: start
- custom_fields:
- divider1:
- card:
- type: custom:button-card
- template: divider
- styles:
- card:
- - margin: 0px 0px 5px 0px
- divider2:
- card:
- type: custom:button-card
- template: divider
- styles:
- card:
- - margin: 2px 0px 2px 0px
- divider3:
- card:
- type: custom:button-card
- template: divider
- sleep:
- card:
- type: custom:button-card
- styles:
- grid:
- - grid-template-areas: '"header" "timeline" "legend"'
- card:
- - background-color: transparent
- border-radius: 0px
- padding: 0px 15px 0px 15px
- custom_fields:
- timeline:
- - justify-self: center
- align-self: center
- justify-items: center
- custom_fields:
- header:
- card:
- type: custom:button-card
- entity: |
- [[[ return variables.var_sleep; ]]]
- label: |
- [[[ return `${states[variables.var_sleep_score].state}`; ]]]
- name: /100
- icon: mdi:medal
- show_state: true
- show_name: true
- show_icon: true
- show_label: true
- styles:
- grid:
- - grid-template-areas: '"s i l n"'
- grid-template-columns: auto min-content min-content min-content
- grid-template-rows: auto
- align-items: center
- state:
- - font-size: 20px
- font-weight: 600
- justify-self: start
- icon:
- - width: 25px
- color: |
- [[[
- const score = parseFloat(states[variables.var_sleep_score].state);
- if (score > 90) return 'rgba(255,159,10,1)';
- if (score > 75) return 'rgba(10,132,255,1)';
- if (score > 50) return 'rgba(255,69,58,1)';
- return 'gray';
- ]]]
- - justify-self: end
- padding-right: 10px
- label:
- - font-size: 20px
- font-weight: 550
- color: rgba(255,255,255,1)
- justify-self: end
- name:
- - font-size: 20px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: end
- card:
- - background-color: transparent
- - border-radius: 0px
- - padding: 0px
- - margin: 0px 0px 20px 0px
- timeline:
- card:
- type: horizontal-stack
- cards:
- - type: custom:button-card
- entity: |
- [[[ return variables.var_deep; ]]]
- icon: nul
- show_state: false
- show_name: false
- show_icon: true
- styles:
- card:
- - width: |
- [[[
- const deep = parseInt(states[variables.var_deep].state) || 0;
- const rem = parseInt(states[variables.var_rem].state) || 0;
- const light = parseInt(states[variables.var_light].state) || 0;
- const total = deep + rem + light || 1;
- return ((deep / total) * 240) + 'px';
- ]]]
- - height: 15px
- - margin: 0px
- - padding: 0
- - border-radius: 15px 0px 0px 15px
- - background-color: rgba(255,69,58,1)
- - type: custom:button-card
- entity: |
- [[[ return variables.var_rem; ]]]
- icon: nul
- show_state: false
- show_name: false
- show_icon: true
- styles:
- card:
- - width: |
- [[[
- const deep = parseInt(states[variables.var_deep].state) || 0;
- const rem = parseInt(states[variables.var_rem].state) || 0;
- const light = parseInt(states[variables.var_light].state) || 0;
- const total = deep + rem + light || 1;
- return ((rem / total) * 240) + 'px';
- ]]]
- - background-color: rgba(0,122,255,1)
- - height: 15px
- - margin: 0px 0px 0px -8px
- - padding: 0
- - border-radius: 0px
- name:
- - font-size: 10px
- align-self: end
- - type: custom:button-card
- entity: |
- [[[ return variables.var_light; ]]]
- icon: nul
- show_state: false
- show_name: false
- show_icon: true
- styles:
- card:
- - width: |
- [[[
- const deep = parseInt(states[variables.var_deep].state) || 0;
- const rem = parseInt(states[variables.var_rem].state) || 0;
- const light = parseInt(states[variables.var_light].state) || 0;
- const total = deep + rem + light || 1;
- return ((light / total) * 240) + 'px';
- ]]]
- - background-color: rgba(90,200,255,1)
- - height: 15px
- - margin: 0px 0px 0px -8px
- - padding: 0
- - border-radius: 0px 15px 15px 0px
- name:
- - font-size: 10px
- align-self: end
- legend:
- card:
- type: custom:button-card
- styles:
- card:
- - background-color: transparent
- border-radius: 0px
- overflow-x: auto
- padding: 0px 0px 10px 0px
- justify-content: center
- grid:
- - grid-template-areas: '"deep rem light"'
- grid-template-columns: auto auto auto
- justify-content: center
- column-gap: 5px
- custom_fields:
- deep:
- card:
- type: custom:button-card
- entity: |
- [[[ return variables.var_deep; ]]]
- show_state: false
- show_name: true
- show_icon: true
- show_label: true
- label: Deep
- icon: null
- name: |
- [[[
- let seconds = parseInt(states[variables.var_deep].state, 10);
- let hours = Math.floor(seconds / 3600);
- let minutes = Math.floor((seconds % 3600) / 60);
- if (hours === 0) {
- return `${minutes}m`;
- } else {
- return `${hours}h ${minutes}m`;
- }
- ]]]
- styles:
- grid:
- - grid-template-areas: '"i n l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content min-content
- card:
- - border-radius: 0px
- width: 100%
- height: 25px
- padding: 0px
- margin: 0px
- background-color: transparent
- img_cell:
- - background-color: rgba(255,69,58,1)
- border-radius: 2px
- width: 13px
- height: 13px
- justify-self: start
- align-self: end
- name:
- - font-size: 11px
- font-weight: 550
- color: white
- justify-self: start
- padding-left: 5px
- align-self: end
- label:
- - font-size: 9px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: start
- align-self: end
- padding: 0px 0px 0px 5px
- rem:
- card:
- type: custom:button-card
- entity: |
- [[[ return variables.var_rem; ]]]
- show_state: false
- show_name: true
- show_icon: true
- show_label: true
- label: REM
- name: |
- [[[
- let seconds = parseInt(states[variables.var_rem].state, 10);
- let hours = Math.floor(seconds / 3600);
- let minutes = Math.floor((seconds % 3600) / 60);
- return `${hours}h ${minutes}m`;
- ]]]
- icon: null
- styles:
- grid:
- - grid-template-areas: '"i n l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content min-content
- card:
- - border-radius: 0px
- width: 100%
- height: 25px
- padding: 0px
- margin: 0px
- background-color: transparent
- img_cell:
- - background-color: rgba(0,122,255,1)
- border-radius: 2px
- width: 13px
- height: 13px
- justify-self: start
- align-self: end
- name:
- - font-size: 11px
- font-weight: 550
- color: white
- justify-self: start
- padding-left: 5px
- align-self: end
- label:
- - font-size: 9px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: start
- align-self: end
- padding: 0px 0px 0px 5px
- light:
- card:
- type: custom:button-card
- entity: |
- [[[ return variables.var_light; ]]]
- show_state: false
- show_name: true
- show_icon: true
- show_label: true
- icon: null
- label: Light
- name: |
- [[[
- let seconds = parseInt(states[variables.var_light].state, 10);
- let hours = Math.floor(seconds / 3600);
- let minutes = Math.floor((seconds % 3600) / 60);
- return `${hours}h ${minutes}m`;
- ]]]
- styles:
- grid:
- - grid-template-areas: '"i n l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content
- card:
- - border-radius: 0px
- width: 100%
- height: 25px
- padding: 0px
- margin: 0px
- background-color: transparent
- img_cell:
- - background-color: rgba(90,200,255,1)
- border-radius: 2px
- width: 13px
- height: 13px
- justify-self: start
- align-self: end
- name:
- - font-size: 11px
- font-weight: 550
- color: white
- justify-self: start
- padding-left: 5px
- align-self: end
- label:
- - font-size: 9px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: start
- align-self: end
- padding: 0px 0px 0px 5px
- heart:
- card:
- type: custom:button-card
- show_state: false
- show_name: true
- show_icon: false
- show_units: false
- name: Heart Rate
- icon: mdi:heart-pulse
- styles:
- grid:
- - grid-template-areas: '"n gauge" "minimum gauge" "average gauge" "maximum gauge"'
- - grid-template-columns: 1fr 1fr
- - grid-template-rows: min-content min-content min-content
- name:
- - font-size: 18px
- - font-weight: 600
- - justify-self: start
- - align-self: start
- - text-align: left
- - padding: 0px 0px 10px 0px
- card:
- - background-color: transparent
- border-radius: 0px
- padding: 10px 15px 0px 15px
- margin: 0px 0px 15px 0px
- custom_fields:
- gauge:
- - margin: 0px -20px 0px 0px
- custom_fields:
- gauge:
- card:
- type: custom:button-card
- template: '[[[ return variables.var_template; ]]]'
- minimum:
- card:
- type: custom:button-card
- entity: '[[[ return variables.var_min; ]]]'
- show_state: true
- show_name: false
- show_icon: true
- show_label: true
- show_units: false
- icon: mdi:tortoise
- label: Min
- styles:
- grid:
- - grid-template-areas: '"i s l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content min-content
- card:
- - border-radius: 0px
- width: 150px
- height: 25px
- padding: 0px 0px 0px 0px
- margin: 0px
- background-color: transparent
- img_cell:
- - background-color: rgba(90,200,250,1)
- border-radius: 5px
- width: 20px
- height: 20px
- justify-self: start
- state:
- - font-size: 16px
- font-weight: 550
- color: white
- justify-self: start
- padding-left: 10px
- label:
- - font-size: 12px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: start
- padding: 5px 0px 0px 5px
- icon:
- - width: 25px
- average:
- card:
- type: custom:button-card
- entity: '[[[ return variables.var_avg; ]]]'
- show_state: true
- show_name: false
- show_icon: true
- show_label: true
- show_units: false
- label: Avg
- icon: mdi:minus
- styles:
- grid:
- - grid-template-areas: '"i s l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content min-content
- card:
- - border-radius: 0px
- width: 150px
- height: 25px
- padding: 0px
- margin: 0px
- background-color: transparent
- img_cell:
- - background-color: rgba(0,122,255,1)
- border-radius: 5px
- width: 20px
- height: 20px
- justify-self: start
- icon:
- - width: 25px
- state:
- - font-size: 16px
- font-weight: 550
- color: white
- justify-self: start
- padding-left: 10px
- label:
- - font-size: 12px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: start
- padding: 5px 0px 0px 5px
- maximum:
- card:
- type: custom:button-card
- entity: '[[[ return variables.var_max; ]]]'
- show_state: true
- show_name: false
- show_icon: true
- show_label: true
- show_units: false
- label: Max
- icon: mdi:rabbit
- styles:
- grid:
- - grid-template-areas: '"i s l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content min-content
- card:
- - border-radius: 0px
- width: 150px
- height: 25px
- padding: 0px
- margin: 0px
- background-color: transparent
- img_cell:
- - background-color: rgba(255,69,58,1)
- border-radius: 5px
- width: 20px
- height: 20px
- justify-self: start
- state:
- - font-size: 16px
- font-weight: 550
- color: white
- justify-self: start
- padding-left: 10px
- label:
- - font-size: 12px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: start
- padding: 5px 0px 0px 5px
- icon:
- - width: 25px
- color: white
- stats:
- card:
- type: custom:button-card
- styles:
- card:
- - background-color: transparent
- height: 40px
- border-radius: 0px
- overflow-x: auto
- margin: 0px 15px 10px 15px
- padding: 0px
- justify-content: start
- grid:
- - grid-template-areas: '"steps move"'
- grid-template-columns: auto auto
- justify-content: start
- align-content: start
- column-gap: 10px
- custom_fields:
- steps:
- card:
- type: custom:button-card
- entity: |
- [[[ return variables.var_steps; ]]]
- label: Steps
- show_name: false
- show_label: true
- show_icon: true
- show_state: true
- show_units: false
- styles:
- grid:
- - grid-template-areas: '"i s l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content min-content
- align-content: center
- card:
- - border-radius: 0px
- - padding: 0px
- - margin: 0px
- - background-color: transparent
- img_cell:
- - background-color: transparent
- - border-radius: 0px
- - width: 25px
- - height: 40px
- - justify-self: start
- icon:
- - width: 25px
- - color: rgba(255,69,58,1)
- state:
- - font-size: 18px
- font-weight: 600
- color: white
- justify-self: start
- padding-left: 5px
- label:
- - font-size: 12px
- font-weight: 550
- color: rgba(255,255,255,0.3)
- justify-self: start
- padding: 5px 0px 0px 5px
- move:
- card:
- type: custom:button-card
- entity: |
- [[[ return variables.var_move; ]]]
- label: kcal
- name: /806
- show_name: true
- show_label: true
- show_icon: true
- show_state: true
- show_units: false
- styles:
- grid:
- - grid-template-areas: '"i s n l"'
- grid-template-rows: 1fr
- grid-template-columns: min-content min-content min-content
- card:
- - border-radius: 0px
- - background-color: transparent
- img_cell:
- - background-color: transparent
- - border-radius: 0px
- - width: 25px
- - height: 40px
- - justify-self: start
- icon:
- - width: 25px
- - color: rgba(255,69,58,1)
- state:
- - font-size: 18px
- - font-weight: 600
- - color: white
- - justify-self: start
- - padding-left: 5px
- label:
- - font-size: 12px
- - font-weight: 550
- - color: rgba(255,255,255,0.3)
- - justify-self: start
- - padding: 5px 0px 0px 5px
- name:
- - font-size: 18px
- - font-weight: 600
- - color: rgba(255,255,255,0.3)
- - justify-self: start
- - padding: 0px 0px 0px 2px
- circular-gauge-andreia:
- type: custom:button-card
- show_icon: false
- show_name: false
- show_state: false
- styles:
- grid:
- - grid-template-areas: '"gauge"'
- card:
- - padding: 0px
- margin: 0px
- height: 110px
- width: 110px
- background-color: transparent
- custom_fields:
- gauge:
- card:
- type: custom:modern-circular-gauge
- entity: sensor.andreia_bed_sensor_average_heart_rate
- secondary: {}
- max: >
- {{ states('input_number.andreia_heart_rate_max') | float
- }}
- gauge_foreground_style:
- color: adaptive
- width: 6
- gauge_background_style:
- width: 6
- color: adaptive
- opacity: 1
- show_header: false
- adaptive_icon_color: true
- icon: mdi:heart-pulse
- show_icon: true
- segments:
- - from: 50
- to: 100
- color:
- - 100
- - 210
- - 255
- - from: 100
- to: 150
- color:
- - 10
- - 132
- - 255
- - from: 150
- to: 150
- color:
- - 255
- - 69
- - 58
- unit: bpm
- smooth_segments: true
- needle: true
- min: >
- {{ states('input_number.andreia_heart_rate_min') | float
- }}
- show_unit: true
- show_state: true
- card_mod:
- style: |
- ha-card {
- background-color: transparent;
- font-size: 25px !important;
- width: 100% !important;
- height: 100% !important;
- }
- text.value {
- font-size: 35px !important;
- font-weight: 600;
- }
- .arc.clear {
- stroke: rgba(0,0,0,0.3) !important;
- }
- .icon-container {
- margin-top: 0px;
- margin-bottom: -10px !important;
- margin-right: 5px;}
- ha-state-icon {
- --mdc-icon-size: 150% !important;}
- circular-gauge-alistair:
- type: custom:button-card
- show_icon: false
- show_name: false
- show_state: false
- styles:
- grid:
- - grid-template-areas: '"gauge"'
- card:
- - padding: 0px
- margin: 0px
- height: 110px
- width: 110px
- background-color: transparent
- custom_fields:
- gauge:
- card:
- type: custom:modern-circular-gauge
- entity: sensor.alistair_bed_sensor_average_heart_rate
- secondary: {}
- max: >
- {{ states('input_number.alistair_heart_rate_max') | float
- }}
- gauge_foreground_style:
- color: adaptive
- width: 6
- gauge_background_style:
- width: 6
- color: adaptive
- opacity: 1
- show_header: false
- adaptive_icon_color: true
- icon: mdi:heart-pulse
- show_icon: true
- segments:
- - from: 50
- to: 100
- color:
- - 100
- - 210
- - 255
- - from: 100
- to: 150
- color:
- - 10
- - 132
- - 255
- - from: 150
- to: 150
- color:
- - 255
- - 69
- - 58
- unit: bpm
- smooth_segments: true
- needle: true
- min: >
- {{ states('input_number.alistair_heart_rate_min') | float
- }}
- show_unit: true
- show_state: true
- card_mod:
- style: |
- ha-card {
- background-color: transparent;
- font-size: 25px !important;
- width: 100% !important;
- height: 100% !important;
- }
- text.value {
- font-size: 35px !important;
- font-weight: 600;
- }
- .arc.clear {
- stroke: rgba(0,0,0,0.3) !important;
- }
- .icon-container {
- margin-top: 0px;
- margin-bottom: -10px !important;
- margin-right: 5px;}
- ha-state-icon {
- --mdc-icon-size: 150% !important;}
Advertisement
Add Comment
Please, Sign In to add comment