Move config out of subfolder

This commit is contained in:
Georgi Gardev
2022-12-01 16:01:59 +02:00
parent addfa33f6f
commit 1ae0c6d0b8
221 changed files with 0 additions and 0 deletions
@@ -0,0 +1,2 @@
default:
template: [regular, with_state_background]
@@ -0,0 +1,16 @@
ac_button:
template: default
entity: climate.toshiba_ac
name: AC
state:
- value: 'off'
operator: '!='
styles:
card:
- background-color: var(--primary-color)
- color: black
icon:
- color: black
tap_action:
action: call-service
service: script.toshiba_ac_toggle
@@ -0,0 +1,53 @@
brita_water:
template: [default, with_state_indicator]
name: Brita water
entity: script.brita_pour_water
custom_fields:
remaining_liters: "[[[ return states['input_number.brita_remaining_liters'].state ]]]"
tap_action:
action: toggle
styles:
card:
- background: >
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = 100 - (remaining / 150 * 100);
const gradient = [
'180deg',
'var(--paper-card-background-color) 0%',
`var(--paper-card-background-color) ${percent}%`,
`var(--primary-color) ${percent}%`
]
return `linear-gradient(${gradient.join(',')})`;
]]]
- color: white
name:
- color: >
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = 100 - (remaining / 150 * 100);
return percent < 75 ? 'black' : 'white';
]]]
icon:
- color: >
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = 100 - (remaining / 150 * 100);
return percent < 25 ? 'black' : 'white';
]]]
custom_fields:
remaining_liters:
- position: absolute
- top: 8px
- right: 5px
- font-size: 12px
variables:
state_indicator_id: binary_sensor.brita_should_change_filter
state_indicator_size: 5px
state_indicator_off_size: 0px
state_indicator_on_color: var(--color-red)
state_on_indicator_on_color: var(--color-red)
@@ -0,0 +1,5 @@
cover:
icon: >
[[[
return entity.state === "open" ? "mdi:window-shutter-open" : "mdi:window-shutter";
]]]
@@ -0,0 +1,17 @@
hallway_dashboard_mode:
template: [small]
entity: input_select.hallway_dashboard_mode
show_state: true
show_name: false
styles:
state:
- position: relative
- top: -6px
icon:
- position: relative
- top: -2px
tap_action:
action: call-service
service: input_select.select_next
service_data:
entity_id: input_select.hallway_dashboard_mode
@@ -0,0 +1,18 @@
radiator_button:
template: [default]
name: "Radiator"
icon: mdi:radiator
state:
- value: "off"
operator: "!="
styles:
card:
- background-color: var(--primary-color)
- color: black
icon:
- color: black
tap_action:
action: call-service
service: script.toggle_radiator
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
@@ -0,0 +1,11 @@
humidity_button:
type: custom:button-card
template: [regular, progress]
state_display: "[[[ return Math.round(entity.state) + ' %' ]]]"
icon: mdi:water-percent
variables:
min_value: 25
max_value: 90
normal_value: 40
high_value: 65
low_color: "var(--color-red)"
@@ -0,0 +1,64 @@
progress:
variables:
min_value: 5
max_value: 40
normal_value: 19
high_value: 23
low_color: "var(--primary-color)"
normal_color: "var(--color-green)"
high_color: "var(--color-red)"
degrees: 180
triggers_update: all
show_state: true
show_name: true
styles:
name:
- position: absolute
- top: "[[[ return this.___config.show_state ? '65%' : 'initial' ]]]"
- display: flex
- align-items: center
- justify-content: center
- width: 100%
- height: "[[[ return this.___config.show_state ? 'initial' : '100%' ]]]"
- font-size: 1em
state:
- position: absolute
- top: "[[[ return this.___config.show_name ? '22%' : 'initial' ]]]"
- display: flex
- align-items: center
- justify-content: center
- width: 100%
- height: "[[[ return this.___config.show_name ? 'initial' : '100%' ]]]"
- font-size: 1.9em
icon:
- position: absolute
- top: 4px
- right: -4px
- height: 16px
img_cell:
- position: initial
card:
- background: >
[[[
const temp = entity.state;
const color = temp < variables.normal_value
? variables.low_color
: temp < variables.high_value
? variables.normal_color
: variables.high_color;
const min = variables.min_value;
const max = variables.max_value;
const percent = Math.round((temp - min)/(max - min) * 100);
const gradientPercent = 100 - percent;
const gradient = [
`${variables.degrees}deg`,
'var(--paper-card-background-color) 0%',
`var(--paper-card-background-color) ${gradientPercent}%`,
`${color} ${gradientPercent}%`
]
return `linear-gradient(${gradient.join(',')})`;
]]]
@@ -0,0 +1,24 @@
scene:
variables:
scene_color_1:
scene_color_2:
degrees: 315
tap_action:
action: call-service
service: scene.turn_on
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
styles:
card:
- background: >
[[[
const color_1 = variables.scene_color_1;
const color_2 = variables.scene_color_2 || variables.scene_color_1;
const degrees = variables.degrees;
return "linear-gradient("
+ degrees + "deg, "
+ color_1 + " 7%, "
+ color_2 + " 7%, "
+ color_2 + " 11%, var(--paper-card-background-color) 11%)"
]]]
@@ -0,0 +1,30 @@
with_state_background:
state:
- value: 'on'
styles:
card:
- background-color: var(--primary-color)
- color: black
icon:
- color: black
- value: 'home'
styles:
card:
- background-color: var(--primary-color)
- color: black
icon:
- color: black
- value: 'recording'
styles:
card:
- background-color: var(--primary-color)
- color: black
icon:
- color: black
- value: 'open'
styles:
card:
- background-color: var(--primary-color)
- color: black
icon:
- color: black
@@ -0,0 +1,57 @@
with_state_indicator:
variables:
state_indicator_id: # defaults to entity_id
state_indicator_size: 2px
state_indicator_off_size: # If set, used when the state_indicator entity is off
# state indicators are used when the entity's state is not 'on'
state_indicator_on_color: white
state_indicator_off_color: transparent
# state_on_indicator_s are used when the entity's state is 'on':
state_on_indicator_on_color: white
state_on_indicator_off_color: transparent
triggers_update: all # unfortunately a template doesn't seem to work here :/
double_tap_action:
action: call-service
service: homeassistant.toggle
service_data:
entity_id: "[[[ return variables.state_indicator_id || entity.entity_id ]]]"
styles:
name:
- transform: >
[[[
const state_indicator_entity = variables.state_indicator_id || entity.entity_id;
const size = states[state_indicator_entity].state === 'on'
? variables.state_indicator_size
: variables.state_indicator_off_size || variables.state_indicator_size
return 'translateY(' + size + ')'
]]]
card:
- border-bottom: >-
[[[
let color;
const state_indicator_entity = variables.state_indicator_id || entity.entity_id;
const is_state_indicator_on = Boolean(states[state_indicator_entity].state === 'on');
if (entity.state === 'on') {
color = is_state_indicator_on
? variables.state_on_indicator_on_color
: variables.state_on_indicator_off_color;
} else {
color = is_state_indicator_on
? variables.state_indicator_on_color
: variables.state_indicator_off_color;
}
const size = is_state_indicator_on
? variables.state_indicator_size
: variables.state_indicator_off_size || variables.state_indicator_size
return size + ' solid ' + color;
]]]
@@ -0,0 +1,10 @@
half:
template: with_state_background
size: 30px
show_icon: false
hold_action:
action: more-info
styles:
card:
- height: 45px
- font-size: 14px
@@ -0,0 +1,14 @@
regular:
size: 30px
hold_action:
action: more-info
styles:
card:
- height: 100px
- font-size: 14px
grid:
- height: 90px
img_cell:
- height: 60px
name:
- height: 30px
@@ -0,0 +1,14 @@
small:
size: 24px
hold_action:
action: more-info
styles:
card:
- height: 70px
- font-size: 14px
grid:
- height: 60px
img_cell:
- height: 40px
name:
- height: 24px
@@ -0,0 +1,10 @@
xs:
size: 20px
hold_action:
action: more-info
styles:
card:
- height: 70px
- font-size: 12px
name:
- height: 24px
@@ -0,0 +1,22 @@
v3_badge:
variables:
state_size: 14px
show_name: false
show_icon: false
show_state: true
hold_action:
action: more-info
styles:
card:
- width: 60px
- height: 60px
- font-size: 15px
- border-radius: 60px
- box-shadow: none
- --ha-card-background: transparent
- border: 2px solid rgba(255, 255, 255, 0.5)
state:
- text-overflow: initial
- width: 80%
- font-weight: bold
- font-size: "[[[ return variables.state_size ]]]"
@@ -0,0 +1,17 @@
v3_badge_icon:
template: v3_badge
show_state: false
show_icon: true
styles:
icon:
- transform: translateX(-4px) translateY(11px)
- --mdc-icon-size: 30px
- color: white
state:
- value: 'on'
styles:
card:
- background-color: white
- color: black
icon:
- color: var(--primary-color)
@@ -0,0 +1,64 @@
v3_button:
variables:
value_has_error: false
background_color: 'var(--v3-background)'
show_state: true
show_icon: true
show_name: true
size: 120px
card_size: 2
hold_action:
action: more-info
styles:
card:
- width: 120px
- height: 120px
- box-shadow: none
- --ha-card-background: "[[[ return variables.background_color ]]]"
icon:
- position: absolute
- top: 8px
- left: 16px
- width: 30px
- height: 30px
- --mdc-icon-size: 30px
- color: white
state:
- position: absolute
- bottom: 10px
- left: 16px
- font-weight: bold
- font-size: 14px
- color: "[[[ return variables.value_has_error ? 'red' : 'white' ]]]"
name:
- position: absolute
- left: 16px
- bottom: "[[[ return this.___config.show_state ? '28px' : '10px'; ]]]"
- white-space: normal
- word-wrap: break-word
- word-break: break-word
- width: 90px
- text-align: left
- font-weight: bold
- font-size: 15px
state:
- value: 'on'
styles: &on_styles
card:
- background-color: white
- color: black
icon:
- color: var(--primary-color)
state:
- color: "[[[ return variables.value_has_error ? 'red' : 'var(--v3-btn-state-color)' ]]]"
- value: 'home'
styles: *on_styles
- value: 'recording'
styles: *on_styles
- value: 'open'
styles: *on_styles
- value: 'playing'
styles: *on_styles
- value: 'heat'
styles: *on_styles
@@ -0,0 +1,29 @@
v3_pill:
show_name: true
show_icon: true
show_state: false
card_size: 5
hold_action:
action: more-info
styles:
card:
- width: 380px
- margin-left: 8px
- height: 60px
- font-size: 15px
- border-radius: 8px
- background-color: 'rgba(70, 70, 70, 1)'
icon:
- position: absolute
- left: 16px
- width: 30px
- --mdc-icon-size: 30px
- display: flex
- align-items: center
name:
- position: absolute
- top: 22px
- left: 60px
- width: 180px
- font-weight: bold
- text-align: left
@@ -0,0 +1,6 @@
v3_popup_button:
variables:
background_color: rgba(60, 60, 60, 1)
styles:
card:
- margin-bottom: 8px
@@ -0,0 +1,48 @@
v3_scene:
variables:
scene_color_1: rgb(255, 255, 255)
scene_color_2: rgb(255, 255, 255)
degrees: 315
show_name: true
show_icon: true
show_state: false
card_size: 5
tap_action:
action: call-service
service: scene.turn_on
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
hold_action:
action: more-info
styles:
card:
- width: 250px
- height: 60px
- font-size: 15px
- box-shadow: none
- background: >
[[[
const color_1 = variables.scene_color_1;
const color_2 = variables.scene_color_2 || variables.scene_color_1;
const degrees = variables.degrees;
return "linear-gradient("
+ degrees + "deg, "
+ color_1 + " 14%, "
+ color_2 + " 14%, "
+ color_2 + " 24%, var(--v3-background) 24%)"
]]]
icon:
- position: absolute
- left: 16px
- width: 30px
- --mdc-icon-size: 30px
- display: flex
- align-items: center
name:
- position: absolute
- top: 22px
- left: 60px
- width: 180px
- font-weight: bold
- text-align: left
@@ -0,0 +1,21 @@
v3_tablet_button:
template: v3_button
styles:
card:
- width: 100px
- height: 100px
- border-radius: 16px
icon:
- top: 4px
- left: 12px
- width: 20px
- height: 20px
- --mdc-icon-size: 20px
state:
- bottom: 4px
- left: 12px
name:
- left: 12px
- bottom: 22px
- width: 60px
- font-size: 13px
@@ -0,0 +1,22 @@
v3_xs_button:
template: v3_button
show_state: false
styles:
card:
- width: 75px
- height: 75px
- border-radius: 12px
icon:
- top: 4px
- left: 12px
- width: 20px
- height: 20px
- --mdc-icon-size: 20px
name:
- left: 12px
- bottom: 8px
- white-space: normal
- word-wrap: break-word
- word-break: break-word
- width: 60px
- font-size: 13px
@@ -0,0 +1,3 @@
v3_badge_humidity:
template: v3_badge
state_display: "[[[ return Number.parseFloat(entity.state.split(' ')[0]).toFixed(1) + '%' ]]]"
@@ -0,0 +1,3 @@
v3_badge_temp:
template: v3_badge
state_display: "[[[ return Number.parseFloat(entity.state.split(' ')[0]).toFixed(1) + '°' ]]]"
@@ -0,0 +1,27 @@
v3_button_ac:
template: v3_button
icon: mdi:air-conditioner
state_display: |
[[[
if (!entity) {
return "Unavailable";
}
if (entity.state === "off") {
return "Off";
}
return entity.attributes.hvac_action.charAt(0).toUpperCase() +
entity.attributes.hvac_action.slice(1) + ' to ' +
entity.attributes.temperature + '°';
]]]
state:
- value: 'off'
operator: '!='
styles:
card:
- background-color: white
- color: black
icon:
- color: var(--primary-color)
state:
- color: black
@@ -0,0 +1,80 @@
v3_button_brita_water:
template: v3_button
name: Brita water
entity: script.brita_pour_water
variables:
long_state: true
state_display: |
[[[
return Math.round(states['input_number.brita_remaining_liters'].state) +
(variables.long_state ? 'L Remaining' : 'L')
]]]
tap_action:
action: toggle
styles:
card:
- background: >
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = 100 - (remaining / 150 * 100);
const gradient = [
'180deg',
'var(--v3-background) 0%',
`var(--v3-background) ${percent}%`,
`white ${percent}%`
]
return `linear-gradient(${gradient.join(',')})`;
]]]
name:
- color: |
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = remaining / 150 * 100;
return percent > 25 ? 'black' : 'white';
]]]
- background-color: |
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = remaining / 150 * 100;
return percent > 25 ? 'white' : 'transparent';
]]]
- border-radius: 4px
icon:
- color: |
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = remaining / 150 * 100;
return percent > 65 ? 'var(--primary-color)' : 'white';
]]]
- background-color: |
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = remaining / 150 * 100;
return percent > 65 ? 'white' : 'transparent';
]]]
- border-radius: 4px
state:
- position: absolute
- bottom: 10px
- left: 16px
- font-weight: bold
- font-size: 13px
- color: |
[[[
if (states['binary_sensor.brita_should_change_filter'].state === 'on') { return 'red'; }
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = remaining / 150 * 100;
return percent > 10 ? 'var(--v3-btn-state-color)' : 'white';
]]]
- background-color: |
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = remaining / 150 * 100;
return percent > 10 ? 'white' : 'transparent';
]]]
- border-radius: 4px
@@ -0,0 +1,7 @@
v3_button_cover:
template: [v3_button, cover]
state_display: |
[[[
if (entity.state === 'closed') { return 'Closed' }
return entity.attributes.current_position + '% Open';
]]]
@@ -0,0 +1,7 @@
v3_button_light:
template: v3_button
state_display: |
[[[
if (entity.state === 'off') { return 'Off'; }
return Math.round(entity.attributes.brightness * 100 / 255) + "%";
]]]
@@ -0,0 +1,22 @@
v3_button_person:
template: v3_badge
show_state: false
show_icon: false
show_name: false
hold_action:
action: more-info
styles:
card:
- width: 60px
- height: 60px
- border-radius: 60px
- background-repeat: no-repeat
- background-position: center center
- background-size: cover
- border-color: var(--accent-color)
state:
- value: 'off'
styles:
card:
- filter: grayscale(100%)
- border-color: black
@@ -0,0 +1,13 @@
v3_button_power:
template: v3_button
variables:
power_sensor:
state_display: |
[[[
if (entity.state === 'off') return 'Off';
return states[variables.power_sensor].state + " W";
]]]
icon: mdi:power-socket
tap_action:
action: more-info
entity: "[[[return variables.power_sensor]]]"
@@ -0,0 +1,13 @@
v3_button_purifier:
template: v3_button
state_display: |
[[[
if (entity.state === 'off') { return 'Off'; }
if (!entity.attributes.preset_mode) { return 'Unknown preset'; }
return entity.attributes.preset_mode.charAt(0).toUpperCase() + entity.attributes.preset_mode.slice(1);
]]]
variables:
value_has_error: |
[[[
return states['binary_sensor.purifier_filter_needs_change'].state === 'on';
]]]
@@ -0,0 +1,15 @@
v3_button_radiator:
template: v3_button
icon: mdi:radiator
state_display: |
[[[
if (entity.state === 'off') { return 'Off'};
return entity.state.charAt(0).toUpperCase() +
entity.state.slice(1) + " to " +
entity.attributes.temperature + '°';
]]]
tap_action:
action: call-service
service: script.toggle_radiator
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
@@ -0,0 +1,21 @@
v3_button_tv:
template: v3_button
tap_action:
action: toggle
icon: mdi:television
state:
- value: 'playing'
styles: &on_styles
card:
- background-color: white
- color: black
icon:
- color: var(--primary-color)
- value: 'standby'
styles: *on_styles
- value: 'on'
styles: *on_styles
- value: 'home'
styles: *on_styles
- value: 'idle'
styles: *on_styles