updates
This commit is contained in:
39
ui_lovelace_minimalist/custom_cards/custom_card_httpedo13.yaml
Executable file
39
ui_lovelace_minimalist/custom_cards/custom_card_httpedo13.yaml
Executable file
@ -0,0 +1,39 @@
|
||||
---
|
||||
custom_card_httpedo13_sun:
|
||||
show_icon: false
|
||||
show_name: false
|
||||
show_label: false
|
||||
variables:
|
||||
darkMode: "[[[ return hass.themes.darkMode; ]]]"
|
||||
language: "[[[ return hass.language; ]]]"
|
||||
showAzimuth: false
|
||||
showElevation: false
|
||||
timeFormat: "24h"
|
||||
title:
|
||||
tap-action:
|
||||
action: "none"
|
||||
styles:
|
||||
grid:
|
||||
- grid-template-areas: "'item1'"
|
||||
- grid-template-columns: "1fr"
|
||||
- grid-template-rows: "min-content"
|
||||
card:
|
||||
- border-radius: "var(--border-radius)"
|
||||
- box-shadow: "var(--box-shadow)"
|
||||
- padding: "12px"
|
||||
custom_fields:
|
||||
item1:
|
||||
card:
|
||||
type: "custom:sun-card"
|
||||
darkMode: "[[[ return variables.darkMode; ]]]"
|
||||
language: "[[[ return variables.language; ]]]"
|
||||
showAzimuth: "[[[ return variables.showAzimuth; ]]]"
|
||||
showElevation: "[[[ return variables.showElevation; ]]]"
|
||||
timeFormat: "[[[ return variables.timeFormat; ]]]"
|
||||
title: "[[[ return variables.title; ]]]"
|
||||
card_mod:
|
||||
style: |
|
||||
ha-card.type-custom-sun-card {
|
||||
border-radius: 14px;
|
||||
box-shadow: none;
|
||||
}
|
172
ui_lovelace_minimalist/custom_cards/custom_card_input_datetime.yaml
Executable file
172
ui_lovelace_minimalist/custom_cards/custom_card_input_datetime.yaml
Executable file
@ -0,0 +1,172 @@
|
||||
---
|
||||
card_input_datetime:
|
||||
show_name: false
|
||||
show_icon: false
|
||||
variables:
|
||||
ulm_card_input_datetime_name: "n/a"
|
||||
triggers_update: "all"
|
||||
styles:
|
||||
grid:
|
||||
- grid-template-areas: "'item1' 'item2'"
|
||||
- grid-template-columns: "1fr"
|
||||
- grid-template-rows: "min-content min-content"
|
||||
- row-gap: "12px"
|
||||
card:
|
||||
- border-radius: "var(--border-radius)"
|
||||
- box-shadow: "var(--box-shadow)"
|
||||
- padding: "12px"
|
||||
custom_fields:
|
||||
item1:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template:
|
||||
- "icon_info"
|
||||
- "ulm_translation_engine"
|
||||
- "input_datetime"
|
||||
tap_action:
|
||||
action: "more-info"
|
||||
entity: "[[[ return entity.entity_id ]]]"
|
||||
name: "[[[ return variables.ulm_card_input_datetime_name ]]]"
|
||||
item2:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "list_3_items"
|
||||
custom_fields:
|
||||
item1:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "widget_icon"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: "input_datetime.set_datetime"
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
time: >
|
||||
[[[
|
||||
var timestamp = entity.attributes.timestamp
|
||||
|
||||
let unix_timestamp = timestamp - 4500;
|
||||
// Create a new JavaScript Date object based on the timestamp
|
||||
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
|
||||
var date = new Date(unix_timestamp * 1000);
|
||||
// Hours part from the timestamp
|
||||
var hours = date.getHours();
|
||||
// Minutes part from the timestamp
|
||||
var minutes = "0" + date.getMinutes();
|
||||
// Seconds part from the timestamp
|
||||
var seconds = "0" + date.getSeconds();
|
||||
|
||||
// Will display time in 10:30:23 format
|
||||
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
|
||||
|
||||
return formattedTime;
|
||||
]]]
|
||||
icon: "mdi:arrow-down"
|
||||
item2:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "widget_text"
|
||||
entity: "[[[ return entity.entity_id ]]]"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: "input_datetime.set_datetime"
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
time: >
|
||||
[[[
|
||||
var timestamp = entity.attributes.timestamp
|
||||
|
||||
let unix_timestamp = timestamp - 3540;
|
||||
// Create a new JavaScript Date object based on the timestamp
|
||||
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
|
||||
var date = new Date(unix_timestamp * 1000);
|
||||
// Hours part from the timestamp
|
||||
var hours = date.getHours();
|
||||
// Minutes part from the timestamp
|
||||
var minutes = "0" + date.getMinutes();
|
||||
// Seconds part from the timestamp
|
||||
var seconds = "0" + date.getSeconds();
|
||||
|
||||
// Will display time in 10:30:23 format
|
||||
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
|
||||
|
||||
return formattedTime;
|
||||
]]]
|
||||
hold_action:
|
||||
action: "call-service"
|
||||
service: "input_datetime.set_datetime"
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
time: >
|
||||
[[[
|
||||
var timestamp = entity.attributes.timestamp
|
||||
|
||||
let unix_timestamp = timestamp - 3660;
|
||||
// Create a new JavaScript Date object based on the timestamp
|
||||
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
|
||||
var date = new Date(unix_timestamp * 1000);
|
||||
// Hours part from the timestamp
|
||||
var hours = date.getHours();
|
||||
// Minutes part from the timestamp
|
||||
var minutes = "0" + date.getMinutes();
|
||||
// Seconds part from the timestamp
|
||||
var seconds = "0" + date.getSeconds();
|
||||
|
||||
// Will display time in 10:30:23 format
|
||||
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
|
||||
|
||||
return formattedTime;
|
||||
]]]
|
||||
|
||||
item3:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "widget_icon"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: "input_datetime.set_datetime"
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
time: >
|
||||
[[[
|
||||
var timestamp = entity.attributes.timestamp
|
||||
|
||||
let unix_timestamp = timestamp - 2700;
|
||||
var date = new Date(unix_timestamp * 1000);
|
||||
var hours = date.getHours();
|
||||
var minutes = "0" + date.getMinutes();
|
||||
var seconds = "0" + date.getSeconds();
|
||||
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
|
||||
|
||||
return formattedTime;
|
||||
]]]
|
||||
icon: "mdi:arrow-up"
|
||||
|
||||
input_datetime:
|
||||
tap_action:
|
||||
action: "more-info"
|
||||
show_last_changed: true
|
||||
|
||||
widget_text:
|
||||
tap_action:
|
||||
action: "toggle"
|
||||
template:
|
||||
- "ulm_translation_engine"
|
||||
show_icon: false
|
||||
show_label: true
|
||||
show_name: false
|
||||
label: "[[[ return variables.ulm_translation_state_unit ]]]"
|
||||
styles:
|
||||
grid:
|
||||
- grid-template-areas: "'l'"
|
||||
card:
|
||||
- box-shadow: "none"
|
||||
- padding: "0px"
|
||||
- background-color: "rgba(var(--color-theme),0.05)"
|
||||
- border-radius: "14px"
|
||||
- place-self: "center"
|
||||
- height: "42px"
|
||||
state:
|
||||
- color: "rgba(var(--color-theme),0.9)"
|
||||
size: "20px"
|
||||
color: "var(--google-grey)"
|
107
ui_lovelace_minimalist/custom_cards/custom_card_input_number.yaml
Executable file
107
ui_lovelace_minimalist/custom_cards/custom_card_input_number.yaml
Executable file
@ -0,0 +1,107 @@
|
||||
---
|
||||
card_input_number:
|
||||
variables:
|
||||
ulm_card_input_number_name: "[[[ return entity.attributes.friendly_name ]]]"
|
||||
triggers_update: "all"
|
||||
show_icon: false
|
||||
show_label: false
|
||||
show_name: false
|
||||
styles:
|
||||
grid:
|
||||
- grid-template-areas: "'item1' 'item2'"
|
||||
- grid-template-columns: "1fr"
|
||||
- grid-template-rows: "min-content min-content"
|
||||
- row-gap: "12px"
|
||||
card:
|
||||
- border-radius: "var(--border-radius)"
|
||||
- box-shadow: "var(--box-shadow)"
|
||||
- padding: "12px"
|
||||
custom_fields:
|
||||
item1:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template:
|
||||
- "icon_info"
|
||||
- "ulm_translation_engine"
|
||||
- "input_number"
|
||||
tap_action:
|
||||
action: "more-info"
|
||||
entity: "[[[ return entity.entity_id ]]]"
|
||||
name: "[[[ return variables.ulm_card_input_number_name ]]]"
|
||||
item2:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "list_3_items"
|
||||
custom_fields:
|
||||
item1:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "widget_icon"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: |
|
||||
[[[
|
||||
if( entity.entity_id.startsWith("input_number.") )
|
||||
return "input_number.decrement";
|
||||
if( entity.entity_id.startsWith("counter.") )
|
||||
return "counter.decrement";
|
||||
return "";
|
||||
]]]
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
icon: "mdi:arrow-down"
|
||||
item2:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "widget_text"
|
||||
entity: "[[[ return entity.entity_id ]]]"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: "cover.stop_cover"
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
item3:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "widget_icon"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: |
|
||||
[[[
|
||||
if( entity.entity_id.startsWith("input_number.") )
|
||||
return "input_number.increment";
|
||||
if( entity.entity_id.startsWith("counter.") )
|
||||
return "counter.increment";
|
||||
return "";
|
||||
]]]
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
icon: "mdi:arrow-up"
|
||||
|
||||
input_number:
|
||||
tap_action:
|
||||
action: "more-info"
|
||||
show_last_changed: true
|
||||
|
||||
widget_text:
|
||||
tap_action:
|
||||
action: "toggle"
|
||||
template:
|
||||
- "ulm_translation_engine"
|
||||
show_icon: false
|
||||
show_label: true
|
||||
show_name: false
|
||||
label: "[[[ return variables.ulm_translation_state_unit ]]]"
|
||||
styles:
|
||||
grid:
|
||||
- grid-template-areas: "'l'"
|
||||
card:
|
||||
- box-shadow: "none"
|
||||
- padding: "0px"
|
||||
- border-radius: "14px"
|
||||
- place-self: "center"
|
||||
- height: "42px"
|
||||
state:
|
||||
- color: "rgba(var(--color-theme),0.9)"
|
||||
size: "20px"
|
||||
color: "var(--google-grey)"
|
243
ui_lovelace_minimalist/custom_cards/custom_card_scenes.yaml
Executable file
243
ui_lovelace_minimalist/custom_cards/custom_card_scenes.yaml
Executable file
@ -0,0 +1,243 @@
|
||||
---
|
||||
card_scenes:
|
||||
show_icon: false
|
||||
show_name: false
|
||||
show_label: false
|
||||
variables:
|
||||
entity_1:
|
||||
entity_id:
|
||||
icon: "mdi:help-circle-outline"
|
||||
icon_color: "gray"
|
||||
name: "n/a"
|
||||
bg_color: "gray"
|
||||
entity_2:
|
||||
entity_id:
|
||||
icon: "mdi:help-circle-outline"
|
||||
icon_color: "gray"
|
||||
name: "n/a"
|
||||
bg_color: "gray"
|
||||
entity_3:
|
||||
entity_id:
|
||||
icon: "mdi:help-circle-outline"
|
||||
icon_color: "gray"
|
||||
name: "n/a"
|
||||
bg_color: "gray"
|
||||
entity_4:
|
||||
entity_id:
|
||||
icon: "mdi:help-circle-outline"
|
||||
icon_color: "gray"
|
||||
name: "n/a"
|
||||
bg_color: "gray"
|
||||
entity_5:
|
||||
entity_id:
|
||||
icon: "mdi:help-circle-outline"
|
||||
icon_color: "gray"
|
||||
name: "n/a"
|
||||
bg_color: "gray"
|
||||
styles:
|
||||
grid:
|
||||
- grid-template-areas: "'item1 item2 item3 item4 item5'"
|
||||
- grid-template-columns: "1fr 1fr 1fr 1fr 1fr"
|
||||
- grid-template-rows: "min-content"
|
||||
- justify-items: "center"
|
||||
- column-gap: "auto"
|
||||
card:
|
||||
- border-radius: "var(--border-radius)"
|
||||
- box-shadow: "var(--box-shadow)"
|
||||
- padding: "12px"
|
||||
custom_fields:
|
||||
item1:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "card_scenes_pill"
|
||||
entity: "[[[ return variables.entity_1.entity_id ]]]"
|
||||
icon: "[[[ return variables.entity_1.icon ]]]"
|
||||
name: "[[[ return variables.entity_1.name ]]]"
|
||||
variables:
|
||||
color_icon: "[[[ return variables.entity_1.icon_color ]]]"
|
||||
color_bg: "[[[ return variables.entity_1.bg_color ]]]"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: |
|
||||
[[[
|
||||
let domain = variables.entity_1.entity_id.substr(0, variables.entity_1.entity_id.indexOf("."));
|
||||
if (domain == "automation") {
|
||||
return "automation.trigger"
|
||||
} else {
|
||||
return "homeassistant.turn_on"
|
||||
}
|
||||
]]]
|
||||
service_data:
|
||||
entity_id: "[[[ return variables.entity_1.entity_id ]]]"
|
||||
item2:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "card_scenes_pill"
|
||||
entity: "[[[ return variables.entity_2.entity_id ]]]"
|
||||
icon: "[[[ return variables.entity_2.icon ]]]"
|
||||
name: "[[[ return variables.entity_2.name ]]]"
|
||||
variables:
|
||||
color_icon: "[[[ return variables.entity_2.icon_color ]]]"
|
||||
color_bg: "[[[ return variables.entity_2.bg_color ]]]"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: |
|
||||
[[[
|
||||
let domain = variables.entity_2.entity_id.substr(0, variables.entity_2.entity_id.indexOf("."));
|
||||
if (domain == "automation") {
|
||||
return "automation.trigger"
|
||||
} else {
|
||||
return "homeassistant.turn_on"
|
||||
}
|
||||
]]]
|
||||
service_data:
|
||||
entity_id: "[[[ return variables.entity_2.entity_id ]]]"
|
||||
item3:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "card_scenes_pill"
|
||||
entity: "[[[ return variables.entity_3.entity_id ]]]"
|
||||
icon: "[[[ return variables.entity_3.icon ]]]"
|
||||
name: "[[[ return variables.entity_3.name ]]]"
|
||||
variables:
|
||||
color_icon: "[[[ return variables.entity_3.icon_color ]]]"
|
||||
color_bg: "[[[ return variables.entity_3.bg_color ]]]"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: |
|
||||
[[[
|
||||
let domain = variables.entity_3.entity_id.substr(0, variables.entity_3.entity_id.indexOf("."));
|
||||
if (domain == "automation") {
|
||||
return "automation.trigger"
|
||||
} else {
|
||||
return "homeassistant.turn_on"
|
||||
}
|
||||
]]]
|
||||
service_data:
|
||||
entity_id: "[[[ return variables.entity_3.entity_id ]]]"
|
||||
item4:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "card_scenes_pill"
|
||||
entity: "[[[ return variables.entity_4.entity_id ]]]"
|
||||
icon: "[[[ return variables.entity_4.icon ]]]"
|
||||
name: "[[[ return variables.entity_4.name ]]]"
|
||||
variables:
|
||||
color_icon: "[[[ return variables.entity_4.icon_color ]]]"
|
||||
color_bg: "[[[ return variables.entity_4.bg_color ]]]"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: |
|
||||
[[[
|
||||
let domain = variables.entity_4.entity_id.substr(0, variables.entity_4.entity_id.indexOf("."));
|
||||
if (domain == "automation") {
|
||||
return "automation.trigger"
|
||||
} else {
|
||||
return "homeassistant.turn_on"
|
||||
}
|
||||
]]]
|
||||
service_data:
|
||||
entity_id: "[[[ return variables.entity_4.entity_id ]]]"
|
||||
item5:
|
||||
card:
|
||||
type: "custom:button-card"
|
||||
template: "card_scenes_pill"
|
||||
entity: "[[[ return variables.entity_5.entity_id ]]]"
|
||||
icon: "[[[ return variables.entity_5.icon ]]]"
|
||||
name: "[[[ return variables.entity_5.name ]]]"
|
||||
variables:
|
||||
color_icon: "[[[ return variables.entity_5.icon_color ]]]"
|
||||
color_bg: "[[[ return variables.entity_5.bg_color ]]]"
|
||||
tap_action:
|
||||
action: "call-service"
|
||||
service: |
|
||||
[[[
|
||||
let domain = variables.entity_5.entity_id.substr(0, variables.entity_5.entity_id.indexOf("."));
|
||||
if (domain == "automation") {
|
||||
return "automation.trigger"
|
||||
} else {
|
||||
return "homeassistant.turn_on"
|
||||
}
|
||||
]]]
|
||||
service_data:
|
||||
entity_id: "[[[ return variables.entity_5.entity_id ]]]"
|
||||
|
||||
card_scenes_pill:
|
||||
show_icon: true
|
||||
show_label: false
|
||||
show_name: true
|
||||
variables:
|
||||
color_icon: "gray"
|
||||
color_bg: "gray"
|
||||
styles:
|
||||
grid:
|
||||
- grid-template-areas: "'i' 'n'"
|
||||
- grid-template-columns: "min-content"
|
||||
- grid-template-rows: "1fr 1fr"
|
||||
- row-gap: "12px"
|
||||
- justify-items: "center"
|
||||
- column-gap: "auto"
|
||||
card:
|
||||
- box-shadow: "none"
|
||||
- padding: "5px"
|
||||
- box-shadow: >
|
||||
[[[
|
||||
if (hass.themes.darkMode){
|
||||
return "0px 2px 4px 0px rgba(0,0,0,0.80)";
|
||||
} else {
|
||||
return "var(--box-shadow)";
|
||||
}
|
||||
]]]
|
||||
- border-radius: "50px"
|
||||
- place-self: "center"
|
||||
- width: "52px"
|
||||
- height: "84px"
|
||||
icon:
|
||||
- color: >
|
||||
[[[
|
||||
var color = [variables.color_icon];
|
||||
if (color == "gray"){
|
||||
var color = "rgba(var(--color-theme),0.20)";
|
||||
} else if(color == "yellow"){
|
||||
var color = "rgba(var(--color-yellow),1)";
|
||||
} else if(color == "blue"){
|
||||
var color = "rgba(var(--color-blue),1)";
|
||||
} else if(color == "purple"){
|
||||
var color = "rgba(var(--color-purple),1)";
|
||||
} else if(color == "green"){
|
||||
var color = "rgba(var(--color-green),1)";
|
||||
} else if(color == "red"){
|
||||
var color = "rgba(var(--color-red),1)";
|
||||
}
|
||||
return color;
|
||||
]]]
|
||||
img_cell:
|
||||
- background-color: >
|
||||
[[[
|
||||
var color = [variables.color_bg];
|
||||
if (color == "gray"){
|
||||
var color = "rgba(var(--color-theme),0.05)";
|
||||
} else if(color == "yellow"){
|
||||
var color = "rgba(var(--color-yellow),0.20)";
|
||||
} else if(color == "blue"){
|
||||
var color = "rgba(var(--color-blue),0.20)";
|
||||
} else if(color == "purple"){
|
||||
var color = "rgba(var(--color-purple),0.20)";
|
||||
} else if(color == "green"){
|
||||
var color = "rgba(var(--color-green),0.20)";
|
||||
} else if(color == "red"){
|
||||
var color = "rgba(var(--color-red),0.20)";
|
||||
}
|
||||
return color;
|
||||
]]]
|
||||
- border-radius: "50%"
|
||||
- width: "42px"
|
||||
- height: "42px"
|
||||
name:
|
||||
- font-weight: "bold"
|
||||
- font-size: "9.5px"
|
||||
- width: "33px"
|
||||
- padding-bottom: "7px"
|
||||
state:
|
||||
- color: "rgba(var(--color-theme),0.9)"
|
||||
color: "var(--google-grey)"
|
Reference in New Issue
Block a user