Sorry für die späte antwort. Dann musst du statt die Titel Karte die Markdown karte nehmen. Sollten ziemlich ähnlich aussehen. Hier ein Beispiel und States einzufärben:
**<font color=#c5e566> {{ states('sensor.temperatursensor', with_unit=True) }}</font>**
Falls du mehr Hilfe, benötigst sag bescheid
ich habe schon einige Versuche durch mit allen möglichen, die markdown hatte ich auch probiert ist mir aber nicht gelungen,
Zerschießt das gesamte Layout oben… zumindest bei mir
Hm okay, bei mir macht das kein unterschied ausser die Textfarbe aber das kann man ja wieder anpassen mit card-mod. Wie sieht das denn bei dir aus und wie sieht der code dann aus?
So würde der code bei mir für markdown aussehen:
- type: markdown
title: Wetter
content: >-
Hier der Text
card_mod:
style: 'ha-card {background: none;}'
anon3402357:
vielen Dank jetzt habe ich das hinbekommen, ich habe jede Menge Einrückungsfehler gehabt und dadurch hatte er mir eben eine fehlerhafte Karte angezeigt.
Ich habe deinen Code eingegeben und schon hat es funktioniert nachdem ich eben einige Zeilen anders eingerückt habe, waren einige.
Und subtitle funktioniert dann auch nicht das zerschießt das gesamte Layout der Karte.
Ich muss mir mal die markdown anschauen wie ich das alles fomatieren kann.
Jetzt muss ich nur noch die Schriften wieder anpassen, ich hoffe das geht jetzt alles im card-mod.
–primary-text-color funktioniert aber --secondary-text-color funktioniert nicht.
Er färbt alles gleich ein.
Versuch es mal damit:
--ha-card-header-color: orange;
--primary-text-color: blue;
Hier ist meins ich nutze nur 3 Addons:
mushroom template card, mini-graph-card, card-mod. Das genutzte Theme ist customized.
Mega clean und das theme ist der Hammer gefällt mir Mega mit den Farben
Hallo
ich hätte auch Interesse an der Rollladensteuerung!
kg
Flo
@killwilli
Top im einfachen liegt die Kraft, gefällt mir sehr gut.
Aber sicher steht da noch einiges im Hintergrund, zeig es doch mal gerne
Die Rollladensteuerung ist ein wenig kompliziert. Da die Automatisierung, Skripte und auch das Dashboard sehr stark an mein Heim angepasst sind. Ich kann das gerne hier zur Verfügung stellen, jedoch muss dann jeder die Yaml Files auf sein Zuhause anpassen. Dabei kann ich dann nicht helfen.
EDIT:
Anbei der YAML Code meiner Rollladen-Steuerung.
Helfer:
Dashboard:
type: vertical-stack
title: Steuerung
cards:
- type: entities
entities:
- entity: input_select.rollladen_betriebsart
name: Betriebsart
icon: mdi:power
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
type: divider
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
entity: sensor.sun_solar_elevation
name: Sonnenstand
icon: mdi:weather-sunny
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
entity: input_number.rollladen_sonnenaufgang
name: Sollwert Sonnenaufgang
icon: mdi:weather-sunset-up
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
entity: input_number.rollladen_sonnenuntergang
name: Sollwert Sonnenuntergang
icon: mdi:weather-sunset-down
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
type: divider
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
entity: input_boolean.rollladen_wetterdaten
name: Wetterdaten berücksichtigen?
icon: mdi:weather-partly-cloudy
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
entity: input_number.rollladen_temperatur
name: Grenzwert Themperatur
icon: mdi:thermometer
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
entity: input_number.rollladen_sonnenstunden
name: Grenzwert Sonnenstunden
icon: mdi:white-balance-sunny
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
type: divider
- type: conditional
conditions:
- entity: input_select.rollladen_betriebsart
state: Automatik
row:
entity: input_boolean.rollladen_ausschlafen
name: Ausschlafen
icon: mdi:sleep
- type: conditional
conditions:
- entity: input_boolean.rollladen_ausschlafen
state: 'on'
row:
entity: input_datetime.rollladen_ausschlafen
name: Uhrzeit
icon: mdi:clock-outline
show_header_toggle: false
- type: horizontal-stack
cards:
- type: tile
entity: input_button.rollladen_eg_auf
name: Rollläden EG auf
hide_state: true
color: primary
- type: tile
entity: input_button.rollladen_eg_ab
name: Rollläden EG ab
hide_state: true
color: primary
tap_action:
action: more-info
- type: horizontal-stack
cards:
- type: tile
entity: input_button.rollladen_og_auf
name: Rollläden OG auf
hide_state: true
color: primary
tap_action:
action: more-info
- type: tile
entity: input_button.rollladen_og_ab
name: Rollläden OG ab
hide_state: true
color: primary
tap_action:
action: more-info
- type: horizontal-stack
cards:
- type: tile
entity: input_button.rollladen_beschattung
name: Beschattung
hide_state: true
color: primary
- type: tile
entity: input_button.rollladen_schlafzimmer
name: Schlafzimmer ab
hide_state: true
color: primary
Automation Automatik:
alias: Automatik
description: ""
trigger:
- platform: state
entity_id:
- sun.sun
attribute: elevation
alias: Sonnenstand
id: "1"
- platform: time
at: input_datetime.rollladen_ausschlafen
alias: Funktion Ausschlafen
id: "2"
condition:
- alias: Bedingungen Automatik
condition: and
conditions:
- condition: state
entity_id: input_select.rollladen_betriebsart
state: Automatik
alias: Automatikbetrieb
- condition: or
conditions:
- alias: Dämmerung
condition: numeric_state
entity_id: sun.sun
attribute: elevation
above: -10
below: 10
- condition: trigger
id:
- "2"
alias: Bedingungen Ausschlafen
alias: Dämmerung oder Ausschlafen
action:
- alias: Rollläden hochfahren
if:
- condition: and
conditions:
- condition: trigger
id:
- "1"
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
above: input_number.rollladen_sonnenaufgang
- condition: time
after: "00:00:00"
before: "12:00:00"
then:
- alias: Erdgeschoss
if:
- condition: state
entity_id: input_select.rollladen_status_eg
state: Geschlossen
then:
- if:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.rollladen_wetterdaten
state: "on"
- condition: numeric_state
entity_id: sensor.home_realfeel_temperatur_max_heute
above: input_number.rollladen_temperatur
- condition: numeric_state
entity_id: sensor.home_sonnenstunden_heute
above: input_number.rollladen_sonnenstunden
then:
- service: script.rollladen
data:
state: eg_beschattung
else:
- service: script.rollladen
data:
state: eg_hochfahren
- alias: Obergeschoss
if:
- condition: state
entity_id: input_select.rollladen_status_og
state: Geschlossen
then:
- if:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.rollladen_wetterdaten
state: "on"
- condition: numeric_state
entity_id: sensor.home_realfeel_temperatur_max_heute
above: input_number.rollladen_temperatur
- condition: numeric_state
entity_id: sensor.home_sonnenstunden_heute
above: input_number.rollladen_sonnenstunden
then:
- service: script.rollladen
data:
state: og_beschattung
else:
- service: script.rollladen
data:
state: og_hochfahren
- alias: Rollläden runterfahren
if:
- condition: and
conditions:
- condition: trigger
id:
- "1"
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: input_number.rollladen_sonnenuntergang
- condition: time
after: "12:00:00"
before: "00:00:00"
then:
- if:
- condition: and
conditions:
- condition: state
entity_id: input_select.rollladen_status_eg
state: Offen
- condition: numeric_state
entity_id: sun.sun
below: input_number.rollladen_sonnenuntergang
attribute: elevation
then:
- service: script.rollladen
data:
state: eg_runterfahren
- if:
- condition: and
conditions:
- condition: state
entity_id: input_select.rollladen_status_og
state: Offen
- condition: numeric_state
entity_id: sun.sun
below: input_number.rollladen_sonnenuntergang
attribute: elevation
then:
- service: script.rollladen
data:
state: og_runterfahren
- alias: Funktion Ausschlafen
if:
- condition: and
conditions:
- condition: trigger
id:
- "2"
- condition: state
entity_id: input_boolean.rollladen_ausschlafen
state: "on"
then:
- if:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.rollladen_wetterdaten
state: "on"
- condition: numeric_state
entity_id: sensor.home_realfeel_temperatur_max_heute
above: input_number.rollladen_temperatur
- condition: numeric_state
entity_id: sensor.home_sonnenstunden_heute
above: input_number.rollladen_sonnenstunden
then:
- service: script.rollladen
data:
state: ausschlafen_beschattung
else:
- service: script.rollladen
data:
state: ausschlafen_hochfahren
mode: single
Automation Hand:
alias: Hand
description: ""
trigger:
- platform: state
entity_id:
- input_button.rollladen_eg_auf
id: "1"
alias: Rollladen EG auf
- platform: state
entity_id:
- input_button.rollladen_og_auf
id: "2"
alias: Rollladen OG auf
- platform: state
entity_id:
- input_button.rollladen_eg_ab
id: "3"
alias: Rollladen EG ab
- platform: state
entity_id:
- input_button.rollladen_og_ab
id: "4"
alias: Rollladen OG ab
- platform: state
entity_id:
- input_button.rollladen_beschattung
id: "5"
alias: Beschattung
condition: []
action:
- alias: Rollladen EG auf
if:
- condition: trigger
id:
- "1"
then:
- service: script.rollladen
data:
state: eg_hochfahren
- alias: Rollladen OG auf
if:
- condition: trigger
id:
- "2"
then:
- service: script.rollladen
data:
state: og_hochfahren
- alias: Rollladen EG ab
if:
- condition: trigger
id:
- "3"
then:
- service: script.rollladen
data:
state: eg_runterfahren
- alias: Rollladen OG ab
if:
- condition: trigger
id:
- "4"
then:
- service: script.rollladen
data:
state: og_runterfahren
- alias: Beschattung
if:
- condition: trigger
id:
- "5"
then:
- service: script.rollladen
data:
state: eg_beschattung
- service: script.rollladen
data:
state: og_beschattung_hand
mode: single
Skript:
alias: Rollladen
sequence:
- alias: "EG: Hochfahren"
if:
- condition: template
value_template: "{{ state == 'eg_hochfahren' }}"
then:
- service: cover.open_cover
target:
device_id:
- dff548a4ec21c6f57447c5d42cc28f1d
- 8402460f3ec39856ad4cc652fbb339f3
- b4649f5785dd79c50b8e7222e6c6348b
- 60d03c1021aff58afeb6799c7fbc8002
- 3fdd403684cdbe4a35b809d61d08e13f
- 7b683f99f52e4447a156dcad2d0a97e5
- 92c634317b07ba3eec25470d86e29ccf
- 21e815b6617c248cf63d9facb9ffb39e
data: {}
alias: Alle Rollläden EG öffnen
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_select.select_option
data:
option: Offen
target:
entity_id: input_select.rollladen_status_eg
- alias: "EG: Runterfahren"
if:
- condition: template
value_template: "{{ state == 'eg_runterfahren' }}"
then:
- service: cover.close_cover
target:
device_id:
- dff548a4ec21c6f57447c5d42cc28f1d
- 8402460f3ec39856ad4cc652fbb339f3
- b4649f5785dd79c50b8e7222e6c6348b
- 60d03c1021aff58afeb6799c7fbc8002
- 3fdd403684cdbe4a35b809d61d08e13f
- 7b683f99f52e4447a156dcad2d0a97e5
- 92c634317b07ba3eec25470d86e29ccf
- 21e815b6617c248cf63d9facb9ffb39e
data: {}
alias: Alle Rollläden EG schließen
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_select.select_option
data:
option: Geschlossen
target:
entity_id: input_select.rollladen_status_eg
- alias: "EG: Beschattung"
if:
- condition: template
value_template: "{{ state == 'eg_beschattung' }}"
then:
- device_id: b4649f5785dd79c50b8e7222e6c6348b
domain: cover
entity_id: 3e806de769a52c3952971460c2fdfd8e
type: set_position
position: 35
- device_id: 3fdd403684cdbe4a35b809d61d08e13f
domain: cover
entity_id: 9771684a61900827cac740a346f7f03c
type: set_position
position: 35
- device_id: 92c634317b07ba3eec25470d86e29ccf
domain: cover
entity_id: 21e6f8b5e2fda640601bd3a568031369
type: set_position
position: 100
- device_id: 60d03c1021aff58afeb6799c7fbc8002
domain: cover
entity_id: 8efb52d89dc68ab7ea1cb35b1032fd57
type: set_position
position: 100
- device_id: 21e815b6617c248cf63d9facb9ffb39e
domain: cover
entity_id: 8a98cf480974388353ce1e0f00d9ef35
type: set_position
position: 100
- device_id: dff548a4ec21c6f57447c5d42cc28f1d
domain: cover
entity_id: 14225b401e137f428c9e5234977a9e21
type: set_position
position: 35
- device_id: 8402460f3ec39856ad4cc652fbb339f3
domain: cover
entity_id: 21e726187df3492e2fae0d28e435fce9
type: set_position
position: 35
- device_id: 7b683f99f52e4447a156dcad2d0a97e5
domain: cover
entity_id: 7d20fd1cd8c01d8cb1c4551e03d3cf2a
type: set_position
position: 45
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_select.select_option
data:
option: Offen
target:
entity_id: input_select.rollladen_status_eg
- alias: "OG: Hochfahren"
if:
- condition: template
value_template: "{{ state == 'og_hochfahren' }}"
then:
- service: cover.open_cover
target:
device_id:
- 4bc9f99e34367e7a345b732a50ce7bc7
- 8663759dffeb052b85632a81516ac520
data: {}
alias: Rollladen Flur & Kinderbad öffnen
- alias: Funktion Ausschlafen
if:
- condition: state
entity_id: input_boolean.rollladen_ausschlafen
state: "off"
then:
- service: cover.open_cover
target:
device_id:
- 83a3fb251c03f6f1a969ee72b2deb58c
- 009549408b24510bb5aac301aac13592
- dc6f7b51511939067d3cc7242321d386
- e027b140be7e6c51014ddf7b3e746f41
- 46c2b975d371d18b58de8c9b88f7f2cf
- da0497f9badfd1fce6dbd579c6a722d6
data: {}
alias: Restlichen Rollläden öffnen
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_select.select_option
target:
entity_id: input_select.rollladen_status_og
data:
option: Offen
- alias: "OG: Runterfahren"
if:
- condition: template
value_template: "{{ state == 'og_runterfahren' }}"
then:
- alias: Alle Rollläden OG schließen
service: cover.close_cover
target:
device_id:
- 83a3fb251c03f6f1a969ee72b2deb58c
- 8663759dffeb052b85632a81516ac520
- 4bc9f99e34367e7a345b732a50ce7bc7
- 009549408b24510bb5aac301aac13592
- dc6f7b51511939067d3cc7242321d386
- e027b140be7e6c51014ddf7b3e746f41
- 46c2b975d371d18b58de8c9b88f7f2cf
- da0497f9badfd1fce6dbd579c6a722d6
data: {}
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_select.select_option
target:
entity_id: input_select.rollladen_status_og
data:
option: Geschlossen
- alias: "OG: Beschattung"
if:
- condition: template
value_template: "{{ state == 'og_beschattung' }}"
then:
- device_id: 4bc9f99e34367e7a345b732a50ce7bc7
domain: cover
entity_id: 40f6203a35f56fcbd1715c08c18eabc3
type: set_position
position: 100
- device_id: 8663759dffeb052b85632a81516ac520
domain: cover
entity_id: b8486366a66f988174b861c96d089d81
type: set_position
position: 9
- alias: Funktion Ausschlafen
if:
- condition: state
entity_id: input_boolean.rollladen_ausschlafen
state: "off"
then:
- device_id: 009549408b24510bb5aac301aac13592
domain: cover
entity_id: 3239d830e1674f911a0d6b3754175929
type: set_position
position: 25
- device_id: dc6f7b51511939067d3cc7242321d386
domain: cover
entity_id: 0b45976a557455e24ded8feb35faf7e8
type: set_position
position: 100
- device_id: 46c2b975d371d18b58de8c9b88f7f2cf
domain: cover
entity_id: 972410eddcbcb21ad8927b3b4a27aa96
type: set_position
position: 9
- device_id: da0497f9badfd1fce6dbd579c6a722d6
domain: cover
entity_id: cfe23029b30910dda5e2844c0d36808f
type: set_position
position: 9
- device_id: e027b140be7e6c51014ddf7b3e746f41
domain: cover
entity_id: fe0e1b3504b0d649257b4a0ca0640b0b
type: set_position
position: 45
- device_id: 83a3fb251c03f6f1a969ee72b2deb58c
domain: cover
entity_id: e9c597fbee71a61d1ea5af7eb26acaad
type: set_position
position: 45
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_select.select_option
target:
entity_id: input_select.rollladen_status_og
data:
option: Offen
- alias: "OG: Beschattung (Hand)"
if:
- condition: template
value_template: "{{ state == 'og_beschattung_hand' }}"
then:
- device_id: 4bc9f99e34367e7a345b732a50ce7bc7
domain: cover
entity_id: 40f6203a35f56fcbd1715c08c18eabc3
type: set_position
position: 100
- device_id: 8663759dffeb052b85632a81516ac520
domain: cover
entity_id: b8486366a66f988174b861c96d089d81
type: set_position
position: 9
- device_id: 009549408b24510bb5aac301aac13592
domain: cover
entity_id: 3239d830e1674f911a0d6b3754175929
type: set_position
position: 25
- device_id: dc6f7b51511939067d3cc7242321d386
domain: cover
entity_id: 0b45976a557455e24ded8feb35faf7e8
type: set_position
position: 100
- device_id: 46c2b975d371d18b58de8c9b88f7f2cf
domain: cover
entity_id: 972410eddcbcb21ad8927b3b4a27aa96
type: set_position
position: 9
- device_id: da0497f9badfd1fce6dbd579c6a722d6
domain: cover
entity_id: cfe23029b30910dda5e2844c0d36808f
type: set_position
position: 9
- device_id: e027b140be7e6c51014ddf7b3e746f41
domain: cover
entity_id: fe0e1b3504b0d649257b4a0ca0640b0b
type: set_position
position: 45
- device_id: 83a3fb251c03f6f1a969ee72b2deb58c
domain: cover
entity_id: e9c597fbee71a61d1ea5af7eb26acaad
type: set_position
position: 45
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_select.select_option
target:
entity_id: input_select.rollladen_status_og
data:
option: Offen
- alias: "Ausschlafen: Beschattung"
if:
- condition: template
value_template: "{{ state == 'ausschlafen_beschattung' }}"
then:
- device_id: 009549408b24510bb5aac301aac13592
domain: cover
entity_id: 3239d830e1674f911a0d6b3754175929
type: set_position
position: 25
- device_id: dc6f7b51511939067d3cc7242321d386
domain: cover
entity_id: 0b45976a557455e24ded8feb35faf7e8
type: set_position
position: 100
- device_id: 46c2b975d371d18b58de8c9b88f7f2cf
domain: cover
entity_id: 972410eddcbcb21ad8927b3b4a27aa96
type: set_position
position: 9
- device_id: da0497f9badfd1fce6dbd579c6a722d6
domain: cover
entity_id: cfe23029b30910dda5e2844c0d36808f
type: set_position
position: 9
- device_id: e027b140be7e6c51014ddf7b3e746f41
domain: cover
entity_id: fe0e1b3504b0d649257b4a0ca0640b0b
type: set_position
position: 45
- device_id: 83a3fb251c03f6f1a969ee72b2deb58c
domain: cover
entity_id: e9c597fbee71a61d1ea5af7eb26acaad
type: set_position
position: 45
- alias: "Ausschlafen: Hochfahren"
if:
- condition: template
value_template: "{{ state == 'ausschlafen_hochfahren' }}"
then:
- device_id: 009549408b24510bb5aac301aac13592
domain: cover
entity_id: 3239d830e1674f911a0d6b3754175929
type: open
- device_id: dc6f7b51511939067d3cc7242321d386
domain: cover
entity_id: 0b45976a557455e24ded8feb35faf7e8
type: open
- device_id: 46c2b975d371d18b58de8c9b88f7f2cf
domain: cover
entity_id: 972410eddcbcb21ad8927b3b4a27aa96
type: open
- device_id: da0497f9badfd1fce6dbd579c6a722d6
domain: cover
entity_id: cfe23029b30910dda5e2844c0d36808f
type: open
- device_id: e027b140be7e6c51014ddf7b3e746f41
domain: cover
entity_id: fe0e1b3504b0d649257b4a0ca0640b0b
type: open
- device_id: 83a3fb251c03f6f1a969ee72b2deb58c
domain: cover
entity_id: e9c597fbee71a61d1ea5af7eb26acaad
type: open
mode: single
icon: mdi:window-shutter
Ergebnis ist dann das hier:
@Innovator
hast Du eine Idee, wo die 0W-Anzeige her kommt?
Beim Klick auf die 0W wird auch nicht, wie sonst üblich, die Entitätskarte geöffnet.
Hallo @ottokar , bei mir steht an der Stelle überhaupt kein Wert. Welche Power-Flow Variante (compact, light,…) nutzt Du denn?
Hallo @Innovator ,
der Wert wird bei allen drei Varianten angezeigt. Bei der Full-Variante sieht es so aus:
Sorry, aber da habe ich keine konkrete Idee. Vielleicht hilft ein Blick in die vollständige Konfiguration. Hast Du ev. aus Versehen 3-phasig aktiviert ohne einen dreiphasigen WR zu haben?
Ich hab seinerzeit schrittweise mit der Konfiguration begonnen, um zu sehen was da jeweils passiert und nur die Optionen verändert, die zwingend erforderlich waren.
Hallo @Innovator
Es lag tatsächlich an dieser Einstellung, obwohl mein FoxESS H3 dreiphasig sein soll. Hauptsache die 0 ist weg.
Danke für den Schubser!
Heyho,
nachdem ich ein bisschen Hin und Her mit den Zigbee Dongle p und E hatte, sowie Thread und dem Homepod, habe ich mein Dashboard mal ganz leicht eingerichtet (ist noch nicht alles drauf und wirklich nur die Basics, aber es ist ein Anfang)
Für mich ist Homeassistant wichtig, für meine Freundin HomeKit.
Da wir demnächst eh umziehen, ist es erstmal nur das wichtigste, was wir aktuell noch brauchen.
Ab Oktober wird richtig Arbeit reingesteckt
Grüße
_alex
25. Juli 2024 um 05:04
687
Hi, könntest du deinen yaml code teilen?
@_alex nur eben damit ich bescheid weiß, du meintest meinen?
Kann ich gerne machen, es sind halt nur die standart UI entitäten, die ich hinzugefügt habe in dem Dashboard.
EDIT:
Und wenn, welche yaml wäre denn interessant?
Ich bin Interessiert an Personenkarten hat jemand beisspiele schönes Wochenende
Ich habe zwar bereits meine Karte hier geteilt, da ich aber nochmal was angepasst habe und es sich jetzt anbietet, teile ich diese nochmals.
Bei dem von mir bereitgestellten Code muss dann lediglich an den Stellen mit <person_1> bzw. <person_2> und <device_1> bzw. <device_2> angepasst werden. Dort werden dann die von euch genutzten Entitäten eingetragen.
type: horizontal-stack
title: An-/Abwesenheit
cards:
- type: custom:button-card
entity: person.<person_1>
variables:
phone_battery_level_sensor: '[[[ return states["sensor.<device_1>_battery_level"].state ]]]'
phone_battery_state_sensor: '[[[ return states["sensor.<device_1>_battery_state"].state ]]]'
phone_wifi_sensor: '[[[ return states["sensor.<device_1>_wifi_connection"].state ]]]'
proximity_sensor: '[[[ return states["sensor.<device_1>_entfernung"].state ]]]'
aspect_ratio: 2/1
name: Person
show_entity_picture: true
show_name: false
hold_action:
action: none
state:
- value: home
styles:
custom_fields:
icon:
- border-color: var(--token-color-1)
- value: not_home
styles:
custom_fields:
icon:
- border-color: var(--token-color-6)
styles:
card:
- border-radius: 5%
- padding: 2% 2% 2% 2%
- font-size: 12px
- justify-self: center
- align-content: center
grid:
- grid-template-areas: '"icon status" "icon battery" "icon wifi" "icon proximity"'
- grid-template-columns: 1fr 1fr
- grid-template-rows: 1fr 1fr 1fr 1fr
- align-content: center
name:
- font-size: 15px
- align-self: middle
- justify-self: start
custom_fields:
icon:
- clip-path: circle()
- width: 50%
- pointer-events: none
- display: grid
- border: 3px solid
- border-color: '#808080'
- border-radius: 250px
- margin: 0 0 0 0
- opacity: 1
- align-self: center
- justify-self: center
status:
- align-self: middle
- justify-self: start
proximity:
- align-self: middle
- justify-self: start
wifi:
- justify-self: start
- '--text-wifi-color-sensor': >-
[[[ if (variables.phone_wifi_sensor == '<not connected>') return
"#aaaaaa"; ]]]
battery:
- align-self: middle
- justify-self: start
- '--text-color-sensor': >-
[[[ if (variables.phone_battery_level_sensor < 20) return
"#EF4F1A"; ]]]
custom_fields:
icon: >
[[[ return entity === undefined ? null : `<img
src="${states[entity.entity_id].attributes.entity_picture}"
width="100%">`; ]]]
status: |
[[[
if (entity.state == 'not_home') {
return `<ha-icon icon="mdi:home-off" style="width: 20px; height: 20px;"></ha-icon><span> Nicht Zuhause</span>`;
}
if (entity.state == 'home') {
return `<ha-icon icon="mdi:home" style="width: 20px; height: 20px;"></ha-icon><span> Zuhause</span>`;
}
]]]
battery: |
[[[
if (variables.phone_battery_state_sensor == 'charging') {
return `<ha-icon icon="mdi:battery-charging" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else if (variables.phone_battery_level_sensor == '100') {
return `<ha-icon icon="mdi:battery-high" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else if (variables.phone_battery_level_sensor <= '20') {
return `<ha-icon icon="mdi:battery-low" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else if (variables.phone_battery_level_sensor <= '60') {
return `<ha-icon icon="mdi:battery-medium" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else {
return `<ha-icon icon="mdi:battery-high" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
}
]]]
proximity: |
[[[
return `<ha-icon icon="mdi:map-marker-distance" style="width: 20px; height: 20px;"></ha-icon><span> ${parseFloat(variables.proximity_sensor).toFixed(1)} km</span></span>`
]]]
wifi: |
[[[
if (variables.phone_wifi_sensor == '<not connected>') {
return `<ha-icon icon="mdi:wifi-off" style="width: 20px; height: 20px;"></ha-icon><span> Getrennt</span>`;
} else {
return `<ha-icon icon="mdi:wifi" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_wifi_sensor}</span>`;
}
]]]
- type: custom:button-card
entity: person.<person_2>
variables:
phone_battery_level_sensor: '[[[ return states["sensor.<device_2>_battery_level"].state ]]]'
phone_battery_state_sensor: '[[[ return states["sensor.<device_2>_battery_state"].state ]]]'
phone_wifi_sensor: '[[[ return states["sensor.<device_2>_wifi_connection"].state ]]]'
proximity_sensor: '[[[ return states["sensor.<device_2>_entfernung"].state ]]]'
aspect_ratio: 2/1
name: Person
show_entity_picture: true
show_name: false
hold_action:
action: none
state:
- value: home
styles:
custom_fields:
icon:
- border-color: var(--token-color-1)
- value: not_home
styles:
custom_fields:
icon:
- border-color: var(--token-color-6)
styles:
card:
- border-radius: 5%
- padding: 2% 2% 2% 2%
- font-size: 12px
- justify-self: center
- align-content: center
grid:
- grid-template-areas: '"icon status" "icon battery" "icon wifi" "icon proximity"'
- grid-template-columns: 1fr 1fr
- grid-template-rows: 1fr 1fr 1fr 1fr
- align-content: center
name:
- font-size: 15px
- align-self: middle
- justify-self: start
custom_fields:
icon:
- clip-path: circle()
- width: 50%
- pointer-events: none
- display: grid
- border: 3px solid
- border-color: '#808080'
- border-radius: 250px
- margin: 0 0 0 0
- opacity: 1
- align-self: center
- justify-self: center
status:
- align-self: middle
- justify-self: start
proximity:
- align-self: middle
- justify-self: start
wifi:
- justify-self: start
- '--text-wifi-color-sensor': >-
[[[ if (variables.phone_wifi_sensor == '<not connected>') return
"#aaaaaa"; ]]]
battery:
- align-self: middle
- justify-self: start
- '--text-color-sensor': >-
[[[ if (variables.phone_battery_level_sensor < 20) return
"#EF4F1A"; ]]]
custom_fields:
icon: >
[[[ return entity === undefined ? null : `<img
src="${states[entity.entity_id].attributes.entity_picture}"
width="100%">`; ]]]
status: |
[[[
if (entity.state == 'not_home') {
return `<ha-icon icon="mdi:home-off" style="width: 20px; height: 20px;"></ha-icon><span> Nicht Zuhause</span>`;
}
if (entity.state == 'home') {
return `<ha-icon icon="mdi:home" style="width: 20px; height: 20px;"></ha-icon><span> Zuhause</span>`;
}
]]]
battery: |
[[[
if (variables.phone_battery_state_sensor == 'charging') {
return `<ha-icon icon="mdi:battery-charging" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else if (variables.phone_battery_level_sensor == '100') {
return `<ha-icon icon="mdi:battery-high" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else if (variables.phone_battery_level_sensor <= '20') {
return `<ha-icon icon="mdi:battery-low" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else if (variables.phone_battery_level_sensor <= '60') {
return `<ha-icon icon="mdi:battery-medium" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
} else {
return `<ha-icon icon="mdi:battery-high" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_battery_level_sensor} %</span>`;
}
]]]
proximity: |
[[[
return `<ha-icon icon="mdi:map-marker-distance" style="width: 20px; height: 20px;"></ha-icon><span> ${parseFloat(variables.proximity_sensor).toFixed(1)} km</span></span>`
]]]
wifi: |
[[[
if (variables.phone_wifi_sensor == '<not connected>') {
return `<ha-icon icon="mdi:wifi-off" style="width: 20px; height: 20px;"></ha-icon><span> Getrennt</span>`;
} else {
return `<ha-icon icon="mdi:wifi" style="width: 20px; height: 20px;"></ha-icon><span> ${variables.phone_wifi_sensor}</span>`;
}
]]]