Trigger a script every half hour if a state remains unchanged

I have written a couple of scripts that send a complex sequence of IR signals from my blaster to an old dumb tv. The reason I need them is twofold

  1. When the TV is switched from its Chromecast input to the PC input, I have to switch the screen size to “Screen FIt” in order to see the edges of the PC’s video signal. The first of these scripts is triggered so that I don’t have to reach for the TV’s remote and bash out 15 (!) button presses

  2. Every 30 minutes thereafter, the TV switches automatically to 16x9, necessitating the need for the same script to trigger

The second script is triggered when the TV inputs switches back to the Chromecast where a 16x9 aspect ratio is far less problematic.

The yaml for automation I’m currently using to fudge the issue can be found here

The scripts I’m using to switch between screen sizes are both working great but the automation to trigger when I’m using the PC is a bit clunky as it cuts out after four half hour repeats. Obviously, I want it to repeat the relevant script every half hour but only so long as the TV input doesn’t change.

Is there a more elegant and long-lasting way to ensure the script triggers when needed? Manual triggering interrupts what I’m doing and I’m thoroughly sick of having to do that…

triggers:
  - trigger: time_pattern
    minutes: /30

…will trigger every half hour.

Yes, I’m aware of that. But I’m looking for a way to trigger a script if the state of a specific entity hasn’t changed for 30 minutes, then reset the clock so it stops repeating if the entity in question does change

There is a further complication. If the input_select entity switches back from the PC to the Chromecast within half an hour of the TV turning on, the TV saves the screen configuration for the PC’s HDMI input, then forgets it after half an hour.

There doesn’t appear any way of saving these screen settings permanently

The other complication is that the TV will reset to its default screen size settings for all HDMI inputs when the TV turns off. It’s a Samsung TV from 2010. I have another which doesn’t have this infuriating quality to it.

Fun Fact! Many dumb Samsung TV’s from this time period do not have a seperate HDMI remote button for each available HDMI port so any IR blaster config you use must cycle through all the ports you have connected using the HDMI remote control button to get to the one you want. You can select the HDMI port directly using the Source button, but that quickly turns into a scripting nightmare as you have to program in the right number of cursor ups and downs from each input to each input.

Add in a new HDMI source and everything changes

So, while I may have four HDMI inputs, practically speaking, I only use two or all my input switching automations go haywire

If you want it to run every 30 minutes, the time is the trigger.

Have you tried wait for trigger in the action block?

I used to have a Samsung from around that time and had to deal with this. There’s 2 ways you should be able to fix this natively on the tv without needing any automations at all:

  1. Enable the “Just Scan” option in your tv settings while you’re on that input.
  2. Rename the input on your HDMI (where the chromecast is plugged in) to “PC”. Most TVs (even modern day ones) have dedicated logic to enable Screen Fit permanently if your input is labelled as PC.

You might have to do both options above, but it should fix your issue and persist the setting even after turning off the tv.

1 Like

Negative. There is no such option in the settings on the TV in question.

Double Negative. The input was already renamed PC. I changed it and renamed it again, but no chocolates. :sob:

That sucks, sorry. Out of curiosity, which model is this?