Schalter für Vollbild-Modus oder andere Funktionen
Methode 1: Via UI (Benutzeroberfläche)
Schritte
- Einstellungen öffnen
- Einstellungen → Geräte & Dienste
- Helfer-Bereich öffnen
- Oben auf den Tab „Helfer“ klicken
- Neuen Helper erstellen
- Rechts unten: „+ HELFER ERSTELLEN“ klicken
- Typ auswählen
- „Schalter“ (oder auf Englisch: „Toggle“) auswählen
- Konfigurieren
- Name:
Fullscreen(oderVollbild) - Icon:
mdi:arrow-expand(odermdi:fullscreen) - Entity ID prüfen: Sollte automatisch
input_boolean.fullscreensein
- Name:
- Erstellen
- Auf „ERSTELLEN“ klicken
- Fertig!
- Helper ist jetzt verfügbar als
input_boolean.fullscreen
- Helper ist jetzt verfügbar als
Methode 2: Via YAML (configuration.yaml)
Schritte
- configuration.yaml öffnen
- File Editor →
/config/configuration.yaml
- File Editor →
- Code einfügen
input_boolean:
fullscreen:
name: Fullscreen
icon: mdi:arrow-expand
initial: off
- Speichern
- Datei speichern
- Home Assistant neu laden
- Einstellungen → System → YAML-Konfiguration neu laden
- Oder: Entwicklerwerkzeuge → YAML → „Helfer neu laden“
- Fertig!
Verwendung in Automationen
Beispiel: Fullscreen bei Klick
automation:
- alias: "Fullscreen Toggle"
trigger:
- platform: state
entity_id: input_boolean.fullscreen
to: 'on'
action:
- service: browser_mod.window_reload
data: {}
Verwendung in Dashboard
Als Button
type: button
entity: input_boolean.fullscreen
name: Vollbild
icon: mdi:arrow-expand
tap_action:
action: toggle
In der Sidebar
- type: custom:button-card
entity: input_boolean.fullscreen
show_state: false
show_icon: true
show_name: false
icon: mdi:arrow-expand
tap_action:
action: toggle
Weitere nützliche Input Boolean Beispiele
Kiosk-Mode Toggle
input_boolean:
kiosk_mode:
name: Kiosk Mode
icon: mdi:monitor
initial: off
Sidebar verstecken
input_boolean:
hide_sidebar:
name: Sidebar verstecken
icon: mdi:menu
initial: off
Dark Mode
input_boolean:
dark_mode:
name: Dark Mode
icon: mdi:theme-light-dark
initial: on
Mehrere auf einmal (YAML)
input_boolean:
fullscreen:
name: Fullscreen
icon: mdi:arrow-expand
hide_sidebar:
name: Sidebar verstecken
icon: mdi:menu
kiosk_mode:
name: Kiosk Mode
icon: mdi:monitor
Status abfragen
In Templates
# Jinja
{{ is_state('input_boolean.fullscreen', 'on') }}
# JavaScript
[[[ is_state('input_boolean.fullscreen', 'on') ]]]
Als Bedingung
condition:
- condition: state
entity_id: input_boolean.fullscreen
state: 'on'
Zustand setzen
Via Service
# Einschalten
service: input_boolean.turn_on
target:
entity_id: input_boolean.fullscreen
# Ausschalten
service: input_boolean.turn_off
target:
entity_id: input_boolean.fullscreen
# Toggle (umschalten)
service: input_boolean.toggle
target:
entity_id: input_boolean.fullscreen
Entity: input_boolean.fullscreen
