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:
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?
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:
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.
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.
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.
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: