Skip to content

mkshb/ha_av_scenes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

40 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AV Scenes - Home Assistant Integration

hacs_badge GitHub Release License

Home Assistant Integration fรผr aktivitรคtsbasierte Steuerung von AV-Gerรคten. Eine Open-Source-Alternative zu Logitech Harmony und Roomie Remote.

English | Deutsch


Deutsch

๐ŸŽฏ Features

Kernfunktionen:

  • ๐Ÿ  Multiroom-Unterstรผtzung - Unabhรคngige Steuerung mehrerer Rรคume
  • ๐ŸŽฌ Aktivitรคtsbasierte Szenen - "Film schauen", "Musik hรถren", "Gaming", etc.
  • ๐Ÿš€ Schritt-fรผr-Schritt-Konfiguration - Granulare Kontrolle mit 11 verschiedenen Schritt-Typen
  • ๐ŸŽฏ Intelligentes Aktivitรคtswechsel-Management - Automatisches Ausschalten ungenutzter Gerรคte
  • ๐ŸŽ›๏ธ Mehrere Entity-Typen - Media Player, Lichter, Steckdosen und Rolllรคden
  • ๐Ÿ”ข Schritt-Reihenfolge - Prรคzise Kontrolle รผber die Ausfรผhrungssequenz
  • ๐Ÿ’พ Persistente Konfiguration - Alle Einstellungen bleiben nach HA-Neustart erhalten
  • ๐Ÿ”Š Lautstรคrke & Sound Mode - Lautstรคrke und Tonmodus pro Aktivitรคt konfigurierbar
  • ๐Ÿ’ก Lichtsteuerung - Helligkeit, Farbtemperatur und รœbergรคnge
  • ๐ŸชŸ Rollladen-Steuerung - Position und Neigung basierend auf Aktivitรคt
  • โšก Flexible Delays - Individuelle Wartezeit nach jedem Schritt (0-60 Sekunden)
  • ๐ŸŽ›๏ธ Input Source Management - Automatischer Input-Wechsel
  • โš™๏ธ Call Action - Beliebige Home Assistant Services in Aktivitรคten einbinden
  • โœ๏ธ Edit Step - Nachtrรคgliche Bearbeitung aller Schritt-Parameter
  • ๐Ÿ“‹ Aktivitรคt kopieren - Schnelles Duplizieren bestehender Aktivitรคten
  • ๐Ÿ—‘๏ธ Raum lรถschen - Vollstรคndige Entfernung von Rรคumen mit allen Aktivitรคten
  • ๐Ÿ“Š Sensor Entities - Vollstรคndige Transparenz รผber Konfiguration in Lovelace
  • ๐Ÿ–ฅ๏ธ UI-basierte Konfiguration - Kein YAML erforderlich
  • ๐Ÿ‡ฉ๐Ÿ‡ช Vollstรคndig auf Deutsch - Komplette deutsche รœbersetzung

๐Ÿš€ Installation

HACS (Empfohlen)

  1. ร–ffne HACS in Home Assistant
  2. Gehe zu "Integrationen"
  3. Klicke auf die drei Punkte oben rechts
  4. Wรคhle "Benutzerdefinierte Repositories"
  5. Fรผge hinzu:
    • Repository: https://github.com/mkshb/ha_av_scenes
    • Kategorie: Integration
  6. Klicke auf "AV Scenes" in der Liste
  7. Klicke auf "Herunterladen"
  8. Starte Home Assistant neu

Manuell

  1. Lade die neueste Version von Releases herunter
  2. Entpacke die Dateien
  3. Kopiere den custom_components/av_scenes Ordner in dein config/custom_components/ Verzeichnis
  4. Starte Home Assistant neu

โš™๏ธ Konfiguration

  1. Gehe zu Einstellungen โ†’ Gerรคte & Dienste
  2. Klicke auf + Integration hinzufรผgen
  3. Suche nach "AV Scenes"
  4. Klicke auf Konfigurieren um Rรคume und Aktivitรคten einzurichten

Raum hinzufรผgen

  1. Wรคhle einen bestehenden Home Assistant Bereich oder erstelle einen eigenen Raum
  2. Klicke auf Neuen Raum hinzufรผgen

Aktivitรคt erstellen

  1. Wรคhle einen Raum
  2. Klicke auf Neue Aktivitรคt hinzufรผgen
  3. Gib einen Namen ein (z.B. "Film schauen")
  4. Fรผge Schritte hinzu:
    • Wรคhle Schritt-Typ aus 11 verfรผgbaren Optionen:
      • Turn on device - Gerรคt einschalten
      • Set input source - Eingangsquelle wรคhlen (Media Player)
      • Set volume - Lautstรคrke setzen (Media Player)
      • Set sound mode - Tonmodus setzen (Media Player) ๐Ÿ†•
      • Set brightness/color - Helligkeit/Farbe setzen (Light)
      • Set color temperature - Farbtemperatur setzen (Light)
      • Set position - Position setzen (Cover)
      • Set tilt - Neigung setzen (Cover)
      • Call action - Beliebige Home Assistant Action aufrufen ๐Ÿ†•
      • Wait/Delay - Wartezeit einfรผgen
    • Wรคhle Gerรคt (auรŸer bei Wait/Delay und Call Action)
    • Konfiguriere schritt-spezifische Parameter
    • Setze Verzรถgerung nach dem Schritt (0-60 Sekunden)
  5. Schritte bearbeiten (optional):
    • Wรคhle "Edit step" um Parameter anzupassen
    • Alle Einstellungen kรถnnen nachtrรคglich geรคndert werden
  6. Schritt-Reihenfolge anpassen (optional):
    • Wรคhle "Change step order"
    • Verschiebe Schritte nach oben/unten
    • Schritte werden von oben nach unten ausgefรผhrt
  7. Aktivitรคt kopieren (optional):
    • Nutze "Copy activity" um eine Aktivitรคt zu duplizieren
    • Alle Schritte und Einstellungen werden kopiert
    • Ideal fรผr รคhnliche Aktivitรคten (z.B. "Film HD" โ†’ "Film 4K")

๐Ÿ“– Verwendung

Szenen

Fรผr jede Aktivitรคt wird automatisch eine Szene erstellt:

# Beispiel: Szene aktivieren
service: scene.turn_on
target:
  entity_id: scene.wohnzimmer_film_schauen

Services

Aktivitรคt starten:

service: av_scenes.start_activity
data:
  room: wohnzimmer
  activity: film_schauen

Aktivitรคt stoppen:

service: av_scenes.stop_activity
data:
  room: wohnzimmer

Neu laden:

service: av_scenes.reload

Switches

Jeder Raum erhรคlt einen Switch fรผr den Aktivitรคtsstatus:

# Status prรผfen
{{ states('switch.wohnzimmer_activity') }}

# Aktuelle Aktivitรคt
{{ state_attr('switch.wohnzimmer_activity', 'current_activity') }}

# Aktivitรคt stoppen
service: switch.turn_off
target:
  entity_id: switch.wohnzimmer_activity

Sensors

Jeder Raum erhรคlt einen Konfigurations-Sensor fรผr vollstรคndige Transparenz:

# Aktueller Status
{{ states('sensor.wohnzimmer_configuration') }}

# Alle Aktivitรคten
{{ state_attr('sensor.wohnzimmer_configuration', 'activity_names') }}

# Detaillierte Aktivitรคts-Info
{{ state_attr('sensor.wohnzimmer_configuration', 'activities') }}

# Lovelace Entity Card
type: entity
entity: sensor.wohnzimmer_configuration

# Lovelace Markdown fรผr formatierte Anzeige
type: markdown
content: |
  ## {{ states('sensor.wohnzimmer_configuration') }}

  **Aktivitรคten:** {{ state_attr('sensor.wohnzimmer_configuration', 'total_activities') }}

  {% for activity in state_attr('sensor.wohnzimmer_configuration', 'activity_names') %}
  - {{ activity }}
  {% endfor %}

Sensor Attributes enthalten:

  • activity_names - Liste aller Aktivitรคten
  • activities - Vollstรคndige Details mit Gerรคten, Reihenfolge und allen Einstellungen
  • current_activity - Name der aktuell laufenden Aktivitรคt
  • status - "active" oder "idle"
  • total_activities - Anzahl der konfigurierten Aktivitรคten

๐ŸŽฌ Beispiel-Szenarien

Szenario 1: Filmabend

Gerรคte:

  • Receiver (Input: BD/DVD, Lautstรคrke: 65%)
  • Beamer (Input: HDMI1)
  • Blu-ray Player

Was passiert:

  1. Alle Gerรคte werden eingeschaltet
  2. Verzรถgerungen werden eingehalten
  3. Receiver-Lautstรคrke wird auf 65% gesetzt
  4. Receiver wechselt auf BD/DVD Input
  5. Beamer wechselt auf HDMI1

Szenario 2: Von Apple TV zu Sonos wechseln

Laufende Aktivitรคt "Apple TV":

  • Beamer einschalten
  • AV Receiver einschalten
  • AV Receiver Input: Apple TV
  • AV Receiver Lautstรคrke: 60%
  • Apple TV einschalten

Neue Aktivitรคt "Sonos":

  • AV Receiver einschalten
  • AV Receiver Input: Sonos
  • AV Receiver Lautstรคrke: 50%
  • Sonos einschalten

Intelligentes Aktivitรคtswechsel-Management:

  • โŒ Beamer wird AUSGESCHALTET (nicht mehr benรถtigt)
  • โŒ Apple TV wird AUSGESCHALTET (nicht mehr benรถtigt)
  • โœ… AV Receiver bleibt AN โ†’ Nur Input-Wechsel Apple TVโ†’Sonos, Lautstรคrke 60%โ†’50%
  • โœ… Sonos wird eingeschaltet

Szenario 3: Schritt-Reihenfolge fรผr Abhรคngigkeiten

Problem:

  • TV ist an Steckdose angeschlossen
  • TV schaltet sich ein bevor Steckdose aktiv ist
  • TV startet nicht richtig

Lรถsung mit Schritt-Reihenfolge:

  1. Turn on Steckdose (delay_after: 5s)
  2. Set position Rollladen 60% (delay_after: 1s)
  3. Set brightness Licht 8% (delay_after: 1s)
  4. Turn on TV (delay_after: 2s)
  5. Set source TV โ†’ HDMI_IN_4 (delay_after: 1s)
  6. Turn on Apple TV (delay_after: 2s)

Was passiert:

  1. Steckdose wird eingeschaltet โ†’ Wartet 5 Sekunden
  2. Rollladen fรคhrt auf 60% โ†’ Wartet 1 Sekunde
  3. Licht geht auf 8% โ†’ Wartet 1 Sekunde
  4. TV schaltet sich ein (hat jetzt Strom!) โ†’ Wartet 2 Sekunden
  5. TV wechselt auf HDMI_IN_4 โ†’ Wartet 1 Sekunde
  6. Apple TV schaltet sich ein โ†’ Wartet 2 Sekunden

๐Ÿ”ง Erweiterte Konfiguration

Lovelace Card Beispiel

type: vertical-stack
cards:
  - type: entities
    title: Wohnzimmer Aktivitรคten
    entities:
      - entity: switch.wohnzimmer_activity
        name: Aktueller Status
      - type: section
      - entity: scene.wohnzimmer_film_schauen
        name: ๐ŸŽฌ Film schauen
      - entity: scene.wohnzimmer_musik_hoeren
        name: ๐ŸŽต Musik hรถren
      - entity: scene.wohnzimmer_gaming
        name: ๐ŸŽฎ Gaming
      - entity: scene.wohnzimmer_tv
        name: ๐Ÿ“บ TV schauen

Automatisierung Beispiel

automation:
  - alias: "Film um 20 Uhr"
    trigger:
      - platform: time
        at: "20:00:00"
    condition:
      - condition: state
        entity_id: binary_sensor.jemand_zuhause
        state: "on"
    action:
      - service: av_scenes.start_activity
        data:
          room: wohnzimmer
          activity: film_schauen

๐Ÿ› Bekannte Einschrรคnkungen

  • Source-Wechsel funktioniert nur wenn das Gerรคt das source_list Attribut unterstรผtzt
  • Lautstรคrkeregelung funktioniert nur wenn das Gerรคt den volume_set Service unterstรผtzt
  • Rolllรคden mit Neigungsfunktion benรถtigen Unterstรผtzung fรผr set_cover_tilt_position Service

๐Ÿ†• Unterstรผtzte Entity-Typen

  • Media Player (media_player.*) - Vollstรคndige Unterstรผtzung mit Input-Auswahl und Lautstรคrkeregelung
  • Lichter (light.*) - Helligkeit, Farbtemperatur und รœbergangszeit
  • Steckdosen (switch.*) - Ein/Aus Steuerung mit konfigurierbarer Verzรถgerung
  • Rolllรคden (cover.*) - Position und Neigungssteuerung

๐Ÿค Beitragen

Contributions sind willkommen! Bitte:

  1. Forke das Repository
  2. Erstelle einen Feature Branch (git checkout -b feature/AmazingFeature)
  3. Committe deine ร„nderungen (git commit -m 'Add some AmazingFeature')
  4. Pushe zum Branch (git push origin feature/AmazingFeature)
  5. ร–ffne einen Pull Request

๐Ÿ“ Changelog

Siehe CHANGELOG.md fรผr Details zu ร„nderungen.

๐Ÿ“„ Lizenz

Dieses Projekt ist unter der MIT-Lizenz lizenziert - siehe LICENSE fรผr Details.

๐Ÿ’ฌ Support


English

๐ŸŽฏ Features

Core Functionality:

  • ๐Ÿ  Multi-room Support - Independent control of multiple rooms
  • ๐ŸŽฌ Activity-based Scenes - "Watch Movie", "Listen to Music", "Gaming", etc.
  • ๐Ÿš€ Step-by-Step Configuration - Granular control with 11 different step types
  • ๐ŸŽฏ Intelligent Activity Switching Management - Automatic shutdown of unused devices
  • ๐ŸŽ›๏ธ Multiple Entity Types - Media Players, Lights, Switches and Covers
  • ๐Ÿ”ข Step Order Control - Precise control over execution sequence
  • ๐Ÿ’พ Persistent Configuration - All settings persist after HA restart
  • ๐Ÿ”Š Volume & Sound Mode - Volume and sound mode configurable per activity
  • ๐Ÿ’ก Light Control - Brightness, color temperature and transitions
  • ๐ŸชŸ Cover Control - Position and tilt based on activity
  • โšก Flexible Delays - Individual wait time after each step (0-60 seconds)
  • ๐ŸŽ›๏ธ Input Source Management - Automatic input switching
  • โš™๏ธ Call Action - Integrate any Home Assistant service in activities
  • โœ๏ธ Edit Step - Modify all step parameters afterwards
  • ๐Ÿ“‹ Copy Activity - Quick duplication of existing activities
  • ๐Ÿ—‘๏ธ Delete Room - Complete removal of rooms with all activities
  • ๐Ÿ“Š Sensor Entities - Complete transparency of configuration in Lovelace
  • ๐Ÿ–ฅ๏ธ UI-based Configuration - No YAML required
  • ๐Ÿ‡ฉ๐Ÿ‡ช Fully Translated - Complete German translation

๐Ÿš€ Installation

HACS (Recommended)

  1. Open HACS in Home Assistant
  2. Go to "Integrations"
  3. Click the three dots in the top right
  4. Select "Custom repositories"
  5. Add:
    • Repository: https://github.com/mkshb/ha_av_scenes
    • Category: Integration
  6. Click on "AV Scenes" in the list
  7. Click "Download"
  8. Restart Home Assistant

Manual

  1. Download the latest release from Releases
  2. Unzip the files
  3. Copy the custom_components/av_scenes folder to your config/custom_components/ directory
  4. Restart Home Assistant

โš™๏ธ Configuration

  1. Go to Settings โ†’ Devices & Services
  2. Click + Add Integration
  3. Search for "AV Scenes"
  4. Click Configure to set up rooms and activities

Add a Room

  1. Select an existing Home Assistant area or create a custom room
  2. Click Add new room

Create an Activity

  1. Select a room
  2. Click Add new activity
  3. Enter a name (e.g., "Watch Movie")
  4. Add steps:
    • Choose step type from 11 available options:
      • Turn on device - Turn on a device
      • Set input source - Select input source (Media Player)
      • Set volume - Set volume (Media Player)
      • Set sound mode - Set sound mode (Media Player) ๐Ÿ†•
      • Set brightness/color - Set brightness/color (Light)
      • Set color temperature - Set color temperature (Light)
      • Set position - Set position (Cover)
      • Set tilt - Set tilt (Cover)
      • Call action - Call any Home Assistant action ๐Ÿ†•
      • Wait/Delay - Insert wait time
    • Select device (except for Wait/Delay and Call Action)
    • Configure step-specific parameters
    • Set delay after step (0-60 seconds)
  5. Edit steps (optional):
    • Select "Edit step" to adjust parameters
    • All settings can be modified afterwards
  6. Adjust step order (optional):
    • Select "Change step order"
    • Move steps up/down
    • Steps execute from top to bottom
  7. Copy activity (optional):
    • Use "Copy activity" to duplicate an activity
    • All steps and settings are copied
    • Ideal for similar activities (e.g., "Movie HD" โ†’ "Movie 4K")

๐Ÿ“– Usage

Scenes

A scene is automatically created for each activity:

# Example: Activate scene
service: scene.turn_on
target:
  entity_id: scene.living_room_watch_movie

Services

Start activity:

service: av_scenes.start_activity
data:
  room: living_room
  activity: watch_movie

Stop activity:

service: av_scenes.stop_activity
data:
  room: living_room

Reload:

service: av_scenes.reload

Switches

Each room gets a switch for activity status:

# Check status
{{ states('switch.living_room_activity') }}

# Current activity
{{ state_attr('switch.living_room_activity', 'current_activity') }}

# Stop activity
service: switch.turn_off
target:
  entity_id: switch.living_room_activity

Sensors

Each room gets a configuration sensor for full transparency:

# Current status
{{ states('sensor.living_room_configuration') }}

# All activities
{{ state_attr('sensor.living_room_configuration', 'activity_names') }}

# Detailed activity info
{{ state_attr('sensor.living_room_configuration', 'activities') }}

# Lovelace Entity Card
type: entity
entity: sensor.living_room_configuration

# Lovelace Markdown for formatted display
type: markdown
content: |
  ## {{ states('sensor.living_room_configuration') }}

  **Activities:** {{ state_attr('sensor.living_room_configuration', 'total_activities') }}

  {% for activity in state_attr('sensor.living_room_configuration', 'activity_names') %}
  - {{ activity }}
  {% endfor %}

Sensor Attributes contain:

  • activity_names - List of all activities
  • activities - Complete details with devices, order and all settings
  • current_activity - Name of currently running activity
  • status - "active" or "idle"
  • total_activities - Number of configured activities

๐ŸŽฌ Example Scenarios

Scenario 1: Movie Night

Devices:

  • Receiver (Input: BD/DVD, Volume: 65%)
  • Projector (Input: HDMI1)
  • Blu-ray Player

What happens:

  1. All devices power on
  2. Delays are respected
  3. Receiver volume is set to 65%
  4. Receiver switches to BD/DVD input
  5. Projector switches to HDMI1

Scenario 2: Switch from Apple TV to Sonos

Running Activity "Apple TV":

  • Turn on Projector
  • Turn on AV Receiver
  • AV Receiver Input: Apple TV
  • AV Receiver Volume: 60%
  • Turn on Apple TV

New Activity "Sonos":

  • Turn on AV Receiver
  • AV Receiver Input: Sonos
  • AV Receiver Volume: 50%
  • Turn on Sonos

Intelligent Activity Switching Management:

  • โŒ Projector turns OFF (no longer needed)
  • โŒ Apple TV turns OFF (no longer needed)
  • โœ… AV Receiver stays ON โ†’ Only input change Apple TVโ†’Sonos, Volume 60%โ†’50%
  • โœ… Sonos turns on

Scenario 3: Step Order for Dependencies

Problem:

  • TV is connected to power outlet
  • TV powers on before outlet is active
  • TV doesn't start properly

Solution with Step Order:

  1. Turn on Outlet (delay_after: 5s)
  2. Set position Cover 60% (delay_after: 1s)
  3. Set brightness Light 8% (delay_after: 1s)
  4. Turn on TV (delay_after: 2s)
  5. Set source TV โ†’ HDMI_IN_4 (delay_after: 1s)
  6. Turn on Apple TV (delay_after: 2s)

What happens:

  1. Outlet powers on โ†’ Waits 5 seconds
  2. Cover moves to 60% โ†’ Waits 1 second
  3. Light dims to 8% โ†’ Waits 1 second
  4. TV powers on (now has power!) โ†’ Waits 2 seconds
  5. TV switches to HDMI_IN_4 โ†’ Waits 1 second
  6. Apple TV powers on โ†’ Waits 2 seconds

๐Ÿ”ง Advanced Configuration

Lovelace Card Example

type: vertical-stack
cards:
  - type: entities
    title: Living Room Activities
    entities:
      - entity: switch.living_room_activity
        name: Current Status
      - type: section
      - entity: scene.living_room_watch_movie
        name: ๐ŸŽฌ Watch Movie
      - entity: scene.living_room_listen_music
        name: ๐ŸŽต Listen to Music
      - entity: scene.living_room_gaming
        name: ๐ŸŽฎ Gaming
      - entity: scene.living_room_watch_tv
        name: ๐Ÿ“บ Watch TV

Automation Example

automation:
  - alias: "Movie at 8 PM"
    trigger:
      - platform: time
        at: "20:00:00"
    condition:
      - condition: state
        entity_id: binary_sensor.someone_home
        state: "on"
    action:
      - service: av_scenes.start_activity
        data:
          room: living_room
          activity: watch_movie

๐Ÿ› Known Limitations

  • Source switching only works if device supports source_list attribute
  • Volume control only works if device supports volume_set service
  • Covers with tilt function require support for set_cover_tilt_position service

๐Ÿ†• Supported Entity Types

  • Media Players (media_player.*) - Full support with input selection and volume control
  • Lights (light.*) - Brightness, color temperature and transition time
  • Switches (switch.*) - On/off control with configurable delay
  • Covers (cover.*) - Position and tilt control

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ Changelog

See CHANGELOG.md for details on changes.

๐Ÿ“„ License

This project is licensed under the MIT License - see LICENSE for details.

๐Ÿ’ฌ Support

About

Custom Home Assistant integration to control multi audio/video devices as dynamic scenes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages