Se7enair
(Se7enair)
November 10, 2021, 9:03pm
2031
The sidebar is able to show specific entites like battery ones.
battery: |
{% set entities = [
'sensor.bad_fenster_links_batterie',
'sensor.bad_heizung_batterie',
'sensor.bad_temperatursensor_batterie', ] %}
{%- for sensor in entities if states(sensor) | int(0) <= 30 and states(sensor) != 'unknown' %}
{%- if loop.first %} {{-'\u26A0\uFE0F'}} Batteriealarm: {% else %}, {% endif -%}
{{ state_attr(sensor, 'friendly_name') + ' ' + states(sensor) + '%' }}
{%- endfor %}
But I have to add every entitiy manually. Is there a way to add a template-name? All my battery entites end up with “_batterie”.
1 Like
How many batteries do you have?
I’m currently using this template to create a list of devices with low battery level, less than 20%:
{% set ns = namespace(below=[]) %}
{% for s in states.sensor
if 'battery_level' in s.entity_id and s.state != 'unknown' and s.state|int < 20 %}
{% set ns.below = ns.below + [s.entity_id] %}
{% endfor %}
{{ ns.below | reject('in', ['sensor.person1_phone_battery_level', 'sensor.person2_phone_iphone_battery_level'] ) | join(', ') }}
I’m using reject() to exclude two phones, as I’m only concern…
2 Likes
From my old setup:
Easy way to keep track of all batteries, and which ones to keep in stock
1 Like
bonondo
(B)
November 10, 2021, 9:55pm
2034
Do you need link the font folder in the configuration.yaml? And from the font.css it uses the file names SF-UI-Display-weight .otf, but I think Apple changed the file names to SF-Pro-Display-weight .otf
Br3b
(Br3b)
November 11, 2021, 8:43am
2035
hey there,
I am pretty sure I didn’t change anything by intention. But i do have problems with the color of the sidebar bottom buttons…
EDIT: It was already working before
themes.yaml:
#conditional color
"$hui-button-card:last-of-type$": |
{% if is_state('binary_sensor.sidebar_update_color', 'on') %}
ha-card, ha-icon {
color: rgb(35, 78 ,106) !important;
opacity: 1 !important;
animation: update 1.5s ease-out infinite;
}
ha-card:hover {
filter: brightness(130%);
animation-play-state: paused;
}
{% endif %}
@keyframes update {
0% {
transform: scale(1);
}
40% {
transform: scale(1.08);
}
50% {
transform: scale(0.98);
}
55% {
transform: scale(1.02);
}
60% {
transform: scale(0.98);
}
100% {
transform: scale(1);
}
}
sidebar.sensor:
The animation is working, but not the color Any ideas, how to troubleshoot this?
Thanks in advance!
Se7enair
(Se7enair)
November 11, 2021, 8:59am
2036
How many? All!
Thanks for the hint. It’s working for me. This was more because of forgetting to add a new sensor. But it also saves a few lines of code.
battery: |
{% set entities = states.sensor
|selectattr("entity_id", "search", "batterie")
|rejectattr("entity_id", "search", ".*indicator_led$")
|map(attribute="entity_id")
|list %}
{%- for sensor in entities if states(sensor) | int(0) <= 30 and states(sensor) != 'unknown' %}
{%- if loop.first %} {{-'\u26A0\uFE0F'}} Batteriealarm: {% else %}, {% endif -%}
{{ state_attr(sensor, 'friendly_name') + ' ' + states(sensor) + '%' }}
{%- endfor %}
You’re right, that is better
odiv
(Duta Ovidiu)
November 11, 2021, 10:56am
2039
Can you share the code for displaying the icons in one row?
Br3b
(Br3b)
November 11, 2021, 11:02am
2040
I just added additional "-button"s to the mattias grid.
type: vertical-stack
cards:
- type: custom:button-card
entity: sensor.template_sidebar
template: sidebar_template
- type: conditional
conditions:
- entity: timer.default
state: active
card:
type: custom:button-card
entity: timer.default
template: laundry
- type: grid
cards:
- type: button
tap_action:
action: call-service
service: automation.toggle
service_data:
entity_id: automation.telegram_door_open
entity: sensor.door_automation_status
show_name: false
show_state: false
show_icon: true
- type: button
...
- type: button
...
- type: button
...
- type: button
crow1093
(Crow1093)
November 11, 2021, 4:14pm
2041
You can probably come close with slider-button-card#styles
EDIT:
or make your own…
type: custom:button-card
tap_action:
slider: function
custom_fields:
slider: >
<input type="range">
odiv
(Duta Ovidiu)
November 11, 2021, 5:18pm
2043
I tried like you, but the icons doesn’t appear on the same line.
1 Like
odiv
(Duta Ovidiu)
November 11, 2021, 7:33pm
2045
@Mattias_Persson , I’m ashamed
But also I’m thankful because you give us, the beginners good advices!
Thank you very much!
Se7enair
(Se7enair)
November 12, 2021, 11:05am
2046
@Mattias_Persson why did you changed to apex-charts?
committed 11:36PM - 03 Nov 21 UTC
Do you have any additional benefits?
Just discovered this card
LINES NETWORK
Convert kB/s and MB/s with custom legend
[1]
yaml type: custom:apexcharts-card
layout: minimal
graph_span: 1h
apex_config:
tooltip:
style:
fontSize: 14px
x:
show: true
formatter: |
EVAL:(timestamp) => {
let date = new Date(timestamp).toLocaleString('sv-SE',{weekday: 'long', hour: '2-digit', minute:'2-digit'}).toString();
return date.charAt(0).toUpperCase(…
Yes, just in the first example I used to use two template sensors adjusted with card mod over a mini graph card. Now it’s just a single apexcharts card
Se7enair
(Se7enair)
November 12, 2021, 11:41am
2048
Looks wonderful
Maybe when I have some spare time…
Br3b
(Br3b)
November 12, 2021, 12:10pm
2049
I just got a fire HD 10 to complete my HA setup. Therefore I’m also integrating your tablet configuration.
The Entities Lovelace card says “wrong time format” Any hints on how to change the time format in a proper way? Thanks in advance
- unique_id: fullykiosk_last_app_start
icon: mdi:update
device_class: timestamp
state: >
{{ states('sensor.fire_tablet_last_app_start') | replace(' ','T') | replace('.','-') }}
EDIT: I tried to solve it by replacing 12.11.21 to 12-11-21 but it’s not enough. Probably need 2021-11-12
Yeah, mine’s like that
strptime → timestamp_custom?
{% set time = '12-11-21 12:19:54' %}
{{ strptime(time, '%d-%m-%y %H:%M:%S') | timestamp_custom | replace(' ','T') }}
2 Likes