Schoettli HomeLab

Wissensdatenbank

Schalter für Vollbild-Modus oder andere Funktionen

Methode 1: Via UI (Benutzeroberfläche)

Schritte

  1. Einstellungen öffnen
    • Einstellungen → Geräte & Dienste
  2. Helfer-Bereich öffnen
    • Oben auf den Tab „Helfer“ klicken
  3. Neuen Helper erstellen
    • Rechts unten: „+ HELFER ERSTELLEN“ klicken
  4. Typ auswählen
    • „Schalter“ (oder auf Englisch: „Toggle“) auswählen
  5. Konfigurieren
    • Name: Fullscreen (oder Vollbild)
    • Icon: mdi:arrow-expand (oder mdi:fullscreen)
    • Entity ID prüfen: Sollte automatisch input_boolean.fullscreen sein
  6. Erstellen
    • Auf „ERSTELLEN“ klicken
  7. Fertig!
    • Helper ist jetzt verfügbar als input_boolean.fullscreen

Methode 2: Via YAML (configuration.yaml)

Schritte

  1. configuration.yaml öffnen
    • File Editor → /config/configuration.yaml
  2. Code einfügen
input_boolean:
  fullscreen:
    name: Fullscreen
    icon: mdi:arrow-expand
    initial: off
  1. Speichern
    • Datei speichern
  2. Home Assistant neu laden
    • Einstellungen → System → YAML-Konfiguration neu laden
    • Oder: Entwicklerwerkzeuge → YAML → „Helfer neu laden“
  3. 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