Helper-Triggered Automation: Is Helper Value Live or Stored?

I have an automation that controls the aspect ratio of my projector. I have an input select helper with a list of the possible aspect ratios, and it’s set as part of the “start playback” and “end playback” automations. It will adjust the projector to the correct aspect ratio of the film, and then set it back to 1.78 when the film finishes. Works well.

But for non-1.78 TV shows, this is a problem: I don’t want it resetting to 1.78 at the end of each episode, then shifting back to the show’s AR at the start of the next. I just want it to continue to sit in the show’s AR until I’ve finished watching the show.

The aspect ratio adjustment within the projector is its own automation, triggered by a state change in the helper:

trigger: state
entity_id:
  - input_select.aspect_ratio

My initial theory was that the next episode of a show should load pretty quickly, so simply waiting to execute the action, if the change is to 1.78, should suffice. In theory, it waits the five seconds, then adjusts the aspect ratio to whatever the helper says the aspect ratio is, which by that time should be the aspect ratio of the new episode, no longer 1.78:

actions:
  - if:
      - condition: state
        entity_id: input_select.aspect_ratio
        state: AR 1.78
    then:
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
          milliseconds: 0
  - action: scene.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: >-
        scene.{{ states.input_select.aspect_ratio.state.replace(".",
        "_").replace(" ", "_") | lower }}

But…this doesn’t work. Every time an episode ends, it resets to 1.78, and then that’s it, it doesn’t even open back up to a wider ratio later. Is it remembering the helper value from when the action was first triggered, rather than checking it in the final step? If so, is there a way I can get it to check again after the delay?

When happens in your “end playback” automation?

1 Like

And what did the trace say and what does dev tools show for that entity…

The indentation is wrong.
The scene turn on is always running, it’s not part of the if/then

Correct, the wait-five-seconds is the only part of the conditional, but that’s on purpose:

2.00:1 episode ends.
AR helper is set to 1.78.
AR control automation sees the change and is triggered.
Automation sees that the helper value is 1.78, waits 5 seconds.
Next 2.00 episode starts during that 5 seconds.
Helper is set to 2.00 during that 5 seconds.
Automation now executes the scene change to whatever is defined in the helper, which should now be back to 2.00 and therefore result in nothing happening.

Do you mean what, rather than when, or are you asking about how the end playback is triggered, or the sequence of actions in that automation?

This happened several days ago and I haven’t had the time to sit down and go through it until now, so I don’t have traces that I can easily get to at the moment (and there would be multiple automations involved and I don’t know what would be most relevant, either). I’m unsure what I would look for in dev tools?

An automation’s debug trace is accessed through the Automation settings, either from the automations list by clicking the breadcrumbs to the right of the automation:

Or from within the editor at the top right:


FWIW, you could simplify the template using slugify:

scene.{{ states('input_select.aspect_ratio') | slugify }}

Yes, I’m aware of that, but @NathanCu mentioned both traces and dev tools.

But even with traces, as I said there are multiple interacting automations here and I don’t really know what I would be looking for.

Not sure what this means?

I asked for dev tools so we could see what yojr actual entity thinks it’s states are

Settings, scroll to the bottom, dev tools the. Go tk states and look up your entity this view shows the raw state of the ent and what you should be using in any comparison. I asked so we know for real what it thinks it is.

Slugify is a filter In jinja it lowercases a string, trims it and reaches any special char with an underscore in a predictable way.

{{ 'My Wierd s#ring' | slugify()}}


== 'my_wierd_s_ring' 

Yeah sorry about that. I meant what. I just wanted to know what both automations looked like.

I’m not sure how that helps here.

I have a widget on my home screen with the input selector—in case I need to manually override for whatever reason—would that suffice?

No. Dev tools.

It bypasses all decoration and localization.

If youbhave a switch with state on off the that’s localized into your language but if you don’t use on/off ina compare by code (how it’s actually stored) and use the localized version then it fails.

Unless your component SPECIFICALLY does the same…

Thats why I asked for it from dev tools.

It’s triggered by a webhook from my media server, and checks if the Harmony activity is correct, sets the volume to whatever it was before I started the movie (in case I’ve made adjustments), sets the receiver back to 5.1 mode (in case Atmos had been enabled), turns the lights on, and changes the input select.

actions:
  - action: media_player.volume_set
    metadata: {}
    target:
      entity_id: media_player.denon_avc_x3800h
    data:
      volume_level: "{{ states('input_number.originalvolume') }}"
  - action: denonavr.get_command
    metadata: {}
    data:
      command: /goform/formiPhoneAppDirect.xml?MSQUICK1
    target:
      entity_id: media_player.denon_avc_x3800h
    enabled: true
  - action: script.lights_no_movie
    metadata: {}
    data: {}
  - action: input_select.select_option
    metadata: {}
    data:
      option: AR 1.78
    target:
      entity_id: input_select.aspect_ratio
    enabled: true
mode: single

At what point in the process?

It’s a tool use it when you need it.

But imho. And I dunno I’m just guessing… Read the entity and see what the actual values are before you start coding.

But for this case I wanted to see what it said so I could compare to your code above before I answer anything I need to see what is correct.

Right, that’s what I was asking about. What precisely I need to look at for this troubleshooting process.

Well, if you’re worried that the code and the values available to the sensor don’t match, it’s definitely not that. It correctly adjusts the aspect ratio at the beginning and end of movies, it’s just the wait-for-next-episode-to-start thing that’s misfiring. So,

2.00:1 episode starts.
Projector shifts correctly to 2.00:1.
2.00:1 episode ends.
Next 2.00:1 episode starts.
Projector shifts to 1.78:1, even though it shouldn’t.

Episode aspect ratios are stored in the file names, and were done using Bulk Rename Utility so it’s not possible for there to be a typo in the AR of one episode.

Here’s what it looks like at the moment, which also displays all the valid options:
Screenshot 2026-02-13 00.55.13

Great! Now where’s the trace. :slight_smile:

Gotta fire up the theater for that, so it’ll have to wait a bit.

I’m also not sure how best to share a trace on here? It’s a lot of information on a lot of different pages.

You can download a yaml from any run of any script and paste it here if short enough or your favorite cloud provider if it’s huge.

Well, I just went through several episodes of a show, and…everything worked exactly as it’s supposed to? So now I have no idea what’s going on…

Just in case it helps with anything.

1 Like