Skip to content

Commit 698df76

Browse files
authored
Merge branch 'dev' into main
2 parents 7cfe9a5 + 9da94ac commit 698df76

File tree

36 files changed

+1185
-91
lines changed

36 files changed

+1185
-91
lines changed

config/minimalist-templates/EN.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ ulm_language_variables:
1818
ulm_popups_brightness: "Brightness"
1919
ulm_popups_color_temp: "Color temp"
2020
ulm_popups_color: "Color"
21+
ulm_unknown: "unknown"
22+
ulm_alarm_armed_home: "Armed home"
23+
ulm_alarm_armed_away: "Armed away"
24+
ulm_alarm_disarmed: "Disarmed"
25+
ulm_alarm_arming: "Arming"
26+
ulm_alarm_triggered: "TRIGGERED"

config/minimalist-templates/button_card_templates.yaml

+53-33
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,34 @@ chip_temperature:
66
label: |
77
[[[
88
var icon = "🌡️";
9-
if (states[variables.ulm_chip_temperature_weather].state == "clear-night"){
9+
var weather_state = states[variables.ulm_chip_temperature_weather].state;
10+
if (weather_state == "clear-night"){
1011
var icon = "🌙";
11-
} else if(states[variables.ulm_chip_temperature_weather].state == "cloudy"){
12+
} else if(weather_state == "cloudy"){
1213
var icon = "☁️";
13-
} else if(states[variables.ulm_chip_temperature_weather].state == "exceptional"){
14+
} else if(weather_state == "exceptional"){
1415
var icon = "🌞";
15-
} else if(states[variables.ulm_chip_temperature_weather].state == "fog"){
16+
} else if(weather_state == "fog"){
1617
var icon = "🌫️";
17-
} else if(states[variables.ulm_chip_temperature_weather].state == "hail"){
18+
} else if(weather_state == "hail"){
1819
var icon = "⛈️";
19-
} else if(states[variables.ulm_chip_temperature_weather].state == "lightning"){
20+
} else if(weather_state == "lightning"){
2021
var icon = "⚡";
21-
} else if(states[variables.ulm_chip_temperature_weather].state == "lightning-rainy"){
22+
} else if(weather_state == "lightning-rainy"){
2223
var icon = "⛈️";
23-
} else if(states[variables.ulm_chip_temperature_weather].state == "partlycloudy"){
24+
} else if(weather_state == "partlycloudy"){
2425
var icon = "⛅";
25-
} else if(states[variables.ulm_chip_temperature_weather].state == "pouring"){
26+
} else if(weather_state == "pouring"){
2627
var icon = "🌧️";
27-
} else if(states[variables.ulm_chip_temperature_weather].state == "rainy"){
28+
} else if(weather_state == "rainy"){
2829
var icon = "💧";
29-
} else if(states[variables.ulm_chip_temperature_weather].state == "snowy"){
30+
} else if(weather_state == "snowy"){
3031
var icon = "❄️";
31-
} else if(states[variables.ulm_chip_temperature_weather].state == "snowy-rainy"){
32+
} else if(weather_state == "snowy-rainy"){
3233
var icon = "🌨️";
33-
} else if(states[variables.ulm_chip_temperature_weather].state == "sunny"){
34+
} else if(weather_state == "sunny"){
3435
var icon = "☀️";
35-
} else if(states[variables.ulm_chip_temperature_weather].state == "windy"){
36+
} else if(weather_state == "windy"){
3637
var icon = "🌪️";
3738
}
3839
function convertTemperature(temp) {
@@ -166,6 +167,7 @@ chip_navigate:
166167
grid:
167168
- grid-template-areas: "'i'"
168169
chips_icon_label:
170+
template: "chips"
169171
show_icon: true
170172
show_name: false
171173
show_label: true
@@ -194,23 +196,36 @@ chips_alarm:
194196
template:
195197
- "chips"
196198
- "chips_icon_label"
199+
- "ulm_language_variables"
197200
label: |
198201
[[[
199-
var alarm_label = "unknown";
202+
var alarm_label = variables.ulm_unknown;
200203
if (entity.state == "armed_home"){
201-
var alarm_label = "Armed";
204+
var alarm_label = variables.ulm_alarm_armed_home;
205+
} else if(entity.state == "armed_away"){
206+
var alarm_label = variables.ulm_alarm_armed_away;
202207
} else if(entity.state == "disarmed"){
203-
var alarm_label = "Disarmed";
208+
var alarm_label = variables.ulm_alarm_disarmed;
209+
} else if(entity.state == "arming"){
210+
var alarm_label = variables.ulm_alarm_arming;
211+
} else if(entity.state == "triggered"){
212+
var alarm_label = variables.ulm_alarm_triggered;
204213
}
205214
return alarm_label;
206215
]]]
207216
icon: |
208217
[[[
209218
var alarm_icon = "mdi:shield-outline";
210219
if (entity.state == "armed_home"){
220+
var alarm_icon = "mdi:shield-home";
221+
} else if(entity.state == "armed_away"){
211222
var alarm_icon = "mdi:shield-lock";
212223
} else if(entity.state == "disarmed"){
224+
var alarm_icon = "mdi:shield-off";
225+
} else if(entity.state == "arming"){
213226
var alarm_icon = "mdi:shield";
227+
} else if(entity.state == "triggered"){
228+
var alarm_icon = "mdi:shield-alert";
214229
}
215230
return alarm_icon;
216231
]]]
@@ -221,8 +236,14 @@ chips_alarm:
221236
var alarm_color = "yellow";
222237
if (entity.state == "armed_home"){
223238
var alarm_color = "red";
239+
} else if(entity.state == "armed_away"){
240+
var alarm_color = "red";
224241
} else if(entity.state == "disarmed"){
225242
var alarm_color = "green";
243+
} else if(entity.state == "arming"){
244+
var alarm_color = "orange";
245+
} else if(entity.state == "triggered"){
246+
var alarm_color = "red";
226247
}
227248
return alarm_color;
228249
]]]
@@ -930,25 +951,23 @@ card_battery:
930951
]]]
931952
styles:
932953
icon:
933-
- color: >
954+
- color: |
934955
[[[
935-
// --color-theme as default
936-
var color = 'rgba(var(--color-theme),0.9)';
937-
var battery_level = variables.ulm_card_battery_attribute !== null
938-
? states[entity.entity_id].attributes[variables.ulm_card_battery_attribute]
939-
: states[entity.entity_id].state;
956+
var color = "rgba(var(--color-theme),0.9)";
957+
var battery_level = variables.ulm_card_battery_attribute !== null
958+
? states[entity.entity_id].attributes[variables.ulm_card_battery_attribute]
959+
: states[entity.entity_id].state;
940960
941-
// color based on battery_level
942-
if(variables.ulm_card_battery_battery_level_danger !== null
943-
|| variables.ulm_card_battery_battery_level_warning !== null ) {
944-
color = variables.ulm_card_battery_color_battery_level_ok ;
945-
if(variables.ulm_card_battery_battery_level_warning>=battery_level) {
946-
color = variables.ulm_card_battery_color_battery_level_warning
947-
}
948-
if(variables.ulm_card_battery_battery_level_danger>=battery_level) {
949-
color = variables.ulm_card_battery_color_battery_level_danger
950-
}
961+
// color based on battery_level
962+
if (battery_level !== "unavailable" && (variables.ulm_card_battery_battery_level_danger !== null || variables.ulm_card_battery_battery_level_warning !== null)) {
963+
if (battery_level <= variables.ulm_card_battery_battery_level_danger) {
964+
color = variables.ulm_card_battery_color_battery_level_danger;
965+
} else if (battery_level <= variables.ulm_card_battery_battery_level_warning) {
966+
color = variables.ulm_card_battery_color_battery_level_warning;
967+
} else {
968+
color = variables.ulm_card_battery_color_battery_level_ok;
951969
}
970+
}
952971
return color;
953972
]]]
954973
label:
@@ -1213,6 +1232,7 @@ card_graph:
12131232
card_media_player_with_controls:
12141233
variables:
12151234
ulm_card_media_player_with_controls_name: "No name set"
1235+
ulm_card_media_player_with_controls_entity:
12161236
triggers_update: "all"
12171237
styles:
12181238
grid:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
custom_card_httpedo13_thermostat_language_variables:
3+
variables:
4+
custom_card_httpedo13_thermostat_off: "wyłączone"
5+
custom_card_httpedo13_thermostat_on: "włączone"
6+
custom_card_httpedo13_thermostat_heating: "grzanie"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
custom_card_httpedo13_thermostat_language_variables:
3+
variables:
4+
custom_card_httpedo13_thermostat_off: "desligado"
5+
custom_card_httpedo13_thermostat_on: "ligado"
6+
custom_card_httpedo13_thermostat_heating: "A aquecer"

custom_cards/custom_card_light_icon_info/card_light_icon_info.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ card_light_icon_info:
4747
return icon ;
4848
]]]
4949
tap_action:
50-
action: " more-info"
50+
action: "more-info"
5151
item2:
5252
card:
5353
type: "custom:button-card"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
custom_card_mpse_dual_graph:
3+
variables:
4+
ulm_card_graph_name: ""
5+
ulm_card_graph_color: "var(--google-blue)"
6+
ulm_card_graph_color_2: "var(--google-green)"
7+
triggers_update: "all"
8+
styles:
9+
grid:
10+
- grid-template-areas: "'item1' 'item2'"
11+
- grid-template-columns: "1fr"
12+
- grid-template-rows: "min-content min-content"
13+
card:
14+
- border-radius: "var(--border-radius)"
15+
- box-shadow: "var(--box-shadow)"
16+
- padding: "0px"
17+
custom_fields:
18+
item1:
19+
card:
20+
type: "custom:button-card"
21+
template:
22+
- "icon_info"
23+
- "card_generic"
24+
styles:
25+
card:
26+
- box-shadow: "none"
27+
- border-radius: "var(--border-radius) var(--border-radius) 0px 0px"
28+
- padding: "12px"
29+
entity: "[[[ return variables.ulm_card_graph_entity ]]]"
30+
name: "[[[ return variables.ulm_card_graph_name ]]]"
31+
label: >
32+
[[[
33+
var unit = states[variables.ulm_card_graph_entity].attributes.unit_of_measurement != null ? ' ' +states[variables.ulm_card_graph_entity].attributes.unit_of_measurement
34+
: ''
35+
var unit2 = states[variables.ulm_card_graph_entity_2].attributes.unit_of_measurement != null ? ' ' +states[variables.ulm_card_graph_entity_2].attributes.unit_of_measurement
36+
: ''
37+
return states[variables.ulm_card_graph_entity].state + unit + ' / ' + states[variables.ulm_card_graph_entity_2].state + unit2;
38+
]]]
39+
item2:
40+
card:
41+
type: "custom:mini-graph-card"
42+
entities:
43+
- entity: "[[[ return variables.ulm_card_graph_entity ]]]"
44+
- entity: "[[[ return variables.ulm_card_graph_entity_2 ]]]"
45+
line_color:
46+
- "[[[ return variables.ulm_card_graph_color ]]]"
47+
- "[[[ return variables.ulm_card_graph_color_2 ]]]"
48+
show:
49+
name: false
50+
icon: false
51+
legend: false
52+
state: false
53+
style: |
54+
ha-card {
55+
box-shadow: none;
56+
border-radius: var(--border-radius);
57+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Custom-card "Printer"
2+
3+
The `custom_card_mpse_dual_graph` is an extension of the standard graph card and can show 2 graphs in the same card. I wanted to show both upload/download speed in the same image. The variable names follow the same standard as the base card to make it easier to change.
4+
5+
![Dual Graph](./custom_dual_graph.png)
6+
7+
## Credits
8+
Author: mpse
9+
Version: 0.1.0
10+
11+
## Changelog
12+
<details>
13+
<summary>0.1.0</summary>
14+
Initial release.
15+
</details>
16+
17+
## Usage
18+
19+
```yaml
20+
- type: 'custom:button-card'
21+
template: custom_card_mpse_graph2
22+
variables:
23+
ulm_card_graph_name: "Internet - Download / Upload"
24+
ulm_card_graph_color: "var(--google-blue)"
25+
ulm_card_graph_color_2: "var(--google-green)"
26+
ulm_card_graph_entity: sensor.speedtest_download
27+
ulm_card_graph_entity_2: sensor.speedtest_upload
28+
```
29+
30+
## Requirements
31+
32+
## Variables
33+
<table>
34+
<tr>
35+
<th>Variable</th>
36+
<th>Example</th>
37+
<th>Required</th>
38+
<th>Explanation</th>
39+
</tr>
40+
<tr>
41+
<td>ulm_card_graph_name</td>
42+
<td>"Internet - Download / Upload"</td>
43+
<td>no</td>
44+
<td>Name to show on card.</td>
45+
</tr>
46+
<tr>
47+
<td>ulm_card_graph_color</td>
48+
<td>var(--google-blue)</td>
49+
<td>no</td>
50+
<td>Color of the first graph (blue is default)</td>
51+
</tr>
52+
<tr>
53+
<td>ulm_card_graph_color_2</td>
54+
<td>var(--google-green)</td>
55+
<td>no</td>
56+
<td>Color of the second graph (green is default)</td>
57+
</tr>
58+
<tr>
59+
<td>ulm_card_graph_entity</td>
60+
<td>sensor.speedtest_download</td>
61+
<td>yes</td>
62+
<td>Name of the first sensor</td>
63+
</tr>
64+
<tr>
65+
<td>ulm_card_graph_entity_2</td>
66+
<td>sensor.speedtest_upload</td>
67+
<td>yes</td>
68+
<td>Name of the second sensor</td>
69+
</tr>
70+
</table>
71+
72+
## Template code
73+
74+
```yaml
75+
---
76+
custom_card_mpse_dual_graph:
77+
variables:
78+
ulm_card_graph_name: ""
79+
ulm_card_graph_color: "var(--google-blue)"
80+
ulm_card_graph_color_2: "var(--google-green)"
81+
triggers_update: "all"
82+
styles:
83+
grid:
84+
- grid-template-areas: "'item1' 'item2'"
85+
- grid-template-columns: "1fr"
86+
- grid-template-rows: "min-content min-content"
87+
card:
88+
- border-radius: "var(--border-radius)"
89+
- box-shadow: "var(--box-shadow)"
90+
- padding: "0px"
91+
custom_fields:
92+
item1:
93+
card:
94+
type: "custom:button-card"
95+
template:
96+
- icon_info
97+
- card_generic
98+
styles:
99+
card:
100+
- box-shadow: "none"
101+
- border-radius: "var(--border-radius) var(--border-radius) 0px 0px"
102+
- padding: "12px"
103+
entity: "[[[ return variables.ulm_card_graph_entity ]]]"
104+
name: "[[[ return variables.ulm_card_graph_name ]]]"
105+
label: >
106+
[[[
107+
var unit = states[variables.ulm_card_graph_entity].attributes.unit_of_measurement != null ? ' ' +states[variables.ulm_card_graph_entity].attributes.unit_of_measurement : ''
108+
var unit2 = states[variables.ulm_card_graph_entity_2].attributes.unit_of_measurement != null ? ' ' +states[variables.ulm_card_graph_entity_2].attributes.unit_of_measurement : ''
109+
return states[variables.ulm_card_graph_entity].state + unit + ' / ' + states[variables.ulm_card_graph_entity_2].state + unit2;
110+
]]]
111+
item2:
112+
card:
113+
type: "custom:mini-graph-card"
114+
entities:
115+
- entity: "[[[ return variables.ulm_card_graph_entity ]]]"
116+
- entity: "[[[ return variables.ulm_card_graph_entity_2 ]]]"
117+
line_color:
118+
- "[[[ return variables.ulm_card_graph_color ]]]"
119+
- "[[[ return variables.ulm_card_graph_color_2 ]]]"
120+
show:
121+
name: false
122+
icon: false
123+
legend: false
124+
state: false
125+
style: |
126+
ha-card {
127+
box-shadow: none;
128+
border-radius: var(--border-radius);
129+
}
130+
```

0 commit comments

Comments
 (0)