Plex theatre light dimmer (Tautulli)

A blueprint for dimming the lights when a movie or TV-show on Plex starts - and turn back on when paused or stopped.
This is developed for use with Tautulli add-on but it is really just an mqtt listener so in theory, it can be used with anything.

Parameters are configurable - brightness on each state and mqtt topic to listen for.

The automation will only run after sunset so the light won’t be affected unnecessarily.

Attention
The payload of the mqtt packet must contain the key “body” which has the value of one of the following states:

{"body": state}

Where state can be one of the following:

  • resumed
  • paused
  • stopped
  • started

This is very easy to configure in Tautulli by setting the “text” notification in the control panel of Tautulli and setting the “Message body”.

Tested and working with a Philips Hue Cher lamp (works with other bulbs too) connected through zigbee2mqtt. But any lamp can be connected from the drop down menu on configuration

7 Likes
Your body must be 

started 

stopped

paused

resumed

I think there’s a translation error here, unless you want me to perform CPR on myself.

6 Likes

Perhaps I could be more clear, but your payload must contain the key “body” and the value must be one of the listed.
When starting the movie and you want the light to fade, you would send this payload:

{ "topic": "tautulli", "body": "started" }

But I can edit the post so it is more clear. Thank you.

You can take a step further and create sensors based on users and devices to take action in certain areas. Example body {user} ({player}) started playing {title}. This way i know my son Cole Cole RokuTV started playing Teen Titans Go!. Then i can control lights or another example is alert a google home when he watches something he shouldn’t.

Thanks for your suggestion! I will look into implementing this feature soon :slight_smile:

If you want a notification for your son watching a movie, then you would set the “condition” in Tautulli to seperate your son and yourself or devices. Then you can set different topics. Your son (based on account or device) could be “tautulli_son” and yourself could be “tautulli_living_room” or whatever. See the picture below.

But I could look into making this blueprint action based. I have had trouble making the lights fade to a certain brightness when using actions, but the way this script is written, makes the fading work … I will see what I can do.

Works perfectly! Thank you very much! :slight_smile:

1 Like

thank you, works great :+1:

1 Like

@Methical36 @connoleg Thank you! I’m glad it worked for you :smile:

instant succes, i really appreciate the brightness settings and transition
i do wish i could select the scene’s when playing, idle, paused or stopped

Would that be possible?

Yes, I will look into that. I’ll tag you, when I have had the chance to implement scenes.

1 Like

Hello! Can You help me configure this? Im stuck on tautulli mqtt settings. Thank You!

1 Like

Hi,

Thanks for this! I wonder if it’s possible to select a whole room? For example the living room. I have about 20 zigbee bulbs in my ceiling in the living room and would like to set them to the same state when playing/pause/resuming etc. Am i supposed to make a automation for each bulb? I can’t select multiple lights?

Make a light group for them.

Or probably better a zigbee group in the intergration you are using.

Is it possible to only make it run when using a specific device for playing?

If I recall it right, you can include/exclude devices from the trigger in Tautulli. Please try this. I don’t think it is possible to obtain this information for use in Home Assistant and handle it that way.

Fantastic blueprint! I just tried it and got it working almost perfectly within 15 minutes. One feature request if possible: I love that we can set the brightness of the bulb at each state, but would it be possible to also set the colour of the bulbs? For example, a deep red during playback, warm white on pause and bright white upon stopping? Is that something I can easily add to the yaml?

1 Like

Hi. Thanks for reaching out. Unfortunately, I don’t have any color bulbs to test this with. It should be possible to implement this feature, so if you have the time and want, please make a fork, and I will happily merge the changes into this blueprint :smiley:

i’ve managed to import this blueprint on Home Assistant - Automations - Blueprints Models.
Then i added as an automation.

But its not working…

Can someone please help out with a “step-by-step” on how to configure it and add on HA, or Tautulli…
im not understanding how this works…

@Captain_Slow Im new to blueprints. Most of my lights show up as entities rather than device type “Light”.
How can I modify this to work with all entities instead of “lights” specifically?

For anyone else, I had a hard time getting this to work for whatever reason even though I could see the MQTT payloads coming through in MQTT Explorer.

I ended up creating an automation that does the same thing. I can’t figure out where the blueprint is causing the issue. I think it might be the payload condition statement. My payload comes from tautulli as

tautulli = {"subject": "Tautulli_Playback", "body": "paused", "topic": "tautulli"}

If you are trying to troubleshoot I would recommend MQTT Explorer to see what messages your broker is receiving.

Below is what I used.

alias: Media Lights Plex Automation
description: ""
trigger:
  - platform: mqtt
    topic: tautulli
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ trigger.payload_json.body == \"paused\"}}"
        sequence:
          - type: turn_on
            device_id: 7727cddd9452a7174e84994381567fd4
            entity_id: 39429ebd19389c784b13ed60774228ae
            domain: light
            brightness_pct: 70
      - conditions:
          - condition: template
            value_template: "{{ trigger.payload_json.body == \"resumed\"}}"
        sequence:
          - type: turn_on
            device_id: 7727cddd9452a7174e84994381567fd4
            entity_id: 39429ebd19389c784b13ed60774228ae
            domain: light
            brightness_pct: 10
      - conditions:
          - condition: template
            value_template: "{{ trigger.payload_json.body == \"stopped\"}}"
        sequence:
          - type: turn_on
            device_id: 7727cddd9452a7174e84994381567fd4
            entity_id: 39429ebd19389c784b13ed60774228ae
            domain: light
            brightness_pct: 100
      - conditions:
          - condition: template
            value_template: "{{ trigger.payload_json.body == \"started\"}}"
        sequence:
          - delay:
              hours: 0
              minutes: 0
              seconds: 5
              milliseconds: 0
          - type: turn_on
            device_id: 7727cddd9452a7174e84994381567fd4
            entity_id: 39429ebd19389c784b13ed60774228ae
            domain: light
            brightness_pct: 10
mode: single

2 Likes