Guide: Cinema Lighting

← Back to Projects

Creating Smart Cinema Lighting Automations

This guide will show you how to create a set of automations that dim the lights when a movie starts playing on an Apple TV, turn them on when paused, and adjust the color based on the streaming app in use.

Prerequisites

Key Entities and States

Before building the automation, it's crucial to understand the entities we'll be working with. You can find their exact names under Developer Tools > States.


Automation Guide (GUI Mode)

We'll create two separate automations for easier management.

1. Movie Playing: Dim Lights

[Captura de pantalla de la configuración del disparador en la GUI de HA]

Create an automation that triggers when the Apple TV state changes to playing. In the actions, use a "Choose" block to create different sequences based on the app_name attribute (e.g., one for "Netflix" and another for "Hulu").

2. Movie Paused: Brighten Lights

[Captura de pantalla de la configuración de la acción en la GUI de HA]

Create a second automation that triggers when the Apple TV state changes to paused. The action should be a simple service call to turn on your main lights to a comfortable brightness.


YAML Configuration

For those who prefer code, here are the same automations in YAML format. You can add them to your automations.yaml file.


# automations.yaml

- alias: "Cinema - Movie Playing"
  trigger:
    - platform: state
      entity_id: media_player.apple_tv_family_room
      to: "playing"
  action:
    - choose:
        # Option for Netflix
        - conditions:
            - condition: state
              entity_id: media_player.apple_tv_family_room
              attribute: app_name
              state: "Netflix"
          sequence:
            - service: light.turn_on
              target:
                entity_id: light.ambient_lightstrip
              data:
                rgb_color: [255, 0, 0] # Red
                brightness_pct: 50
            - service: light.turn_on
              target:
                entity_id: light.family_room_lights
              data:
                brightness_pct: 10
      # Default option for other apps
      default:
        - service: light.turn_off
          target:
            entity_id: light.family_room_lights

- alias: "Cinema - Movie Paused"
  trigger:
    - platform: state
      entity_id: media_player.apple_tv_family_room
      to: "paused"
  action:
    - service: light.turn_on
      target:
        entity_id: light.family_room_lights
      data:
        brightness_pct: 80
        transition: 1
            

References and Resources

To dive deeper, check out these official documents and community tutorials.