Jump to Step: The Pi | First Boot | SSH | Install | Configure | Colors | Advanced

Advanced Options

First we'll start simple: If you are able to TURN OFF your Streaming Box -- OR if you have an HDMI Splitter with an ON/OFF switch -- this option may be all we need to configure, and it's the simplest.

I recommend setting this up anyway though, as this also covers any event where your input device is not providing signal (perhaps a "sleep mode").

Bonus: Many TVs (TCL, Samsung) turn OFF the USB port's power when the TV is switched off. So use that port to power the HDMI splitter. Doing this ensures that the capture device receives "No Signal" whenever the TV is off!

Calibrate Signal Detection

Going back to the Video Capturing section on the left, scroll down to where you see Auto Resume, Automatic Signal Detection, and Save Resources. Make sure ALL of these options are CHECKED.

Below that, set the Noise Tolerance to 9, Cognition Tolerance to 90%, and Sleep and Wake times should be around 1 second (1000 ms) and half a second (500 ms) respectively. These numbers seem to work well on both of my TV setups.

Now, UNPLUG the HDMI cable from your Source device. Your TV itself may go blank or change inputs after having no signal for a few seconds -- ignore this for now.

If you used the capture device I recommended, what it does is output a color-bar pattern when no signal is present. You may even notice a sort-of rainbow across the top row of LEDs. Now, we can click on Calibrate.

Follow the instructions. HyperHDR will go through a sequence, essentially capturing the "no signal" image so that it can recognize it later. When this process is finished, click OK.

So now, anytime there is NO SIGNAL going into the Capture Device, the LEDs will shut off. This may be enough if you can in fact turn off the signal from your source device all together.

Many streaming devices, however, never actually "turn off" and always send image data over the HDMI cable...

If you make any other settings changes in this section later, you will need to repeat this calibration step as it may affect how HyperHDR sees the "no signal" screen.

Non-Smart TV or Monitor

Click Here (or scroll down) if none of these Advanced options will work.

A "dumb" TV, or a TV / Monitor with no WiFi or Ethernet -- these cases will require the above to be done, and then a power switch for your Splitter device to be used. See below if these apply to you.

More Advanced

Now, let's say we want to detect when the TV is ON or OFF. This can be done on MOST Televisions, using one of a couple of different methods.
▶ Note: Using this script, when the LEDs are OFF, HyperHDR will NOT be running. So you will NOT be able to access HyperHDR's configuration through a web browser. This should be fine, since you won't be using the TV...
In any case, we need the IP address of the Television itself. So, going back to Step 2 if needed, find your Television's IP address.

Just like we did with the Pi, we want to configure the Router to "assign" or "fix" that address to that device, so we'll always know its address.

Now, if you happen to have a Sony Bravia or a VIZIO TV, things get much easier.

In either of those cases, you will want to find a setting within the TV itself that keeps the WiFi (or Ethernet, if you're hard-wired) enabled while the TV is off. This is what allows apps and home automation devices to "Turn On" your TV when it's off..

If you have any OTHER brand of TV, or if the Sony- or VIZIO-specific options don't work, you actually want the Network DISABLED when the TV is off.

In either case this setting is either under NETWORK, or perhaps ECO or POWER-SAVE somewhere... consult your television's manual if you can't find this setting (hint: not all TVs offer this option; most Samsungs for example ALWAYS turn the network OFF when powered off -- which for us is a good thing).

Regardless, our next step is to log back into our Raspberry Pi. You don't have to be in the same room as the TV for the first few steps, so if you did your setup in another room, leave your streaming box ON, and turn the TV itself OFF, and now go back to the PC where we ran the Shell commands earlier.

Now, execute the following commands, following each with ENTER. If you're still logged in, just be sure you are in your HOME directory by typing cd and pressing ENTER.

I wrote a script that simplifies the process. If you want to view the raw script contents, click here. Otherwise, simply continue below.

Let's start by running these three commands to download and configure my script onto your Pi:

wget https://justinnelsonsprojects.com/hyperion/checktv.gz
📋 COPY - then PASTE, then press ENTER

gunzip checktv.gz
📋 COPY - then PASTE, then press ENTER

chmod +x checktv
📋 COPY - then PASTE, then press ENTER

Now to customize this for YOUR TV (Required!):

nano checktv
📋 COPY - then PASTE, then press ENTER

There are instructions in this script that should help. Read them, and make sure to set the following variables: Then there is TVPORT -- this ONLY matters for the Sony and VIZIO sets. For Sony it should always be 20060. For VIZIO, first try 7345, and if that doesn't work, try 9000.

Then press CTRL+S followed by CTRL+X.

Testing

This part may involve some trial and error. Type in the following, keeping in mind this is a DOT (period) and FORWARD slash (/)
▶ Hint: Forward Slash is the one next to period key on most US keyboards

./checktv

Wait a few seconds. The script will print out one of the following: Printing out its status is helpful if you aren't in the same room as the Television.

If it successfully shuts down HyperHDR, go check that the LEDs turned off. Now, turn the TV back on, wait a few seconds, and type the command again. HINT: Press the Up Arrow in the terminal, and press enter. Again, if it doesn't detect the TV being on right away, wait a few more seconds and try again.

It sometimes helps to have someone else in the TV room while figuring this out...

If this all worked, we're halfway there! Jump to the final bit to automate this process!

If this didn't work, and you're using a VIZIO, try the other port; simply nano checktv and change TVPORT to 9000. Then CTRL+S and CTRL+X to save and exit, and run the ./checktv command again.

The "Other" Method

If you have any OTHER TV brand, or if this did NOT work for your Sony or VIZIO, we'll have to use the "other" method: a simple 'ping' command.

In order to make a Sony/VIZIO work with this method, you'll need to go back, and set the TV to TURN OFF THE NETWORK / WiFi whenever the TV is powered OFF. Again, this will be under NETWORK, ECO or POWER SAVE somewhere in the TV's menu. You may need to turn off any "quick startup" setting, which keeps the TV in a low-powered sleep mode instead of actually turning it off.

On some LG TVs, you'll need to go to the Settings menu, then General and then Mobile TV On and set that to OFF -- this ensures that the WiFi in fact shuts down when the TV is powered off.

Now, edit that script again (nano checktv) and change the TVTYPE to 0 (the number ZERO). Then CTRL+S and CTRL+X to save and exit.

Now, repeat the steps as before; with the TV OFF, run ./checktv. If the LEDs go out and the script returns Stopping HyperHDR..., turn the TV back on, *wait a few seconds*, and run the command again. If the LEDs don't come back on, wait a few more seconds and try the command again.

The 'ping' method may take longer, as the TV has to power up, enable and get back on the network before it can reply to a 'ping'.

Hopefully, ONE of these methods worked for you. The more direct Sony/VIZIO method is preferred, but the 'ping' method can work with many, if not most, internet-connected televisions.

If none of these methods work, or if you have a non-Smart TV, see this page for details on how to manually turn the LEDs on and off.

▶ More TV brands will be added when I am able to test a more direct approach on different models...

Automate This!

So, IF the above worked, you'll want to add ONE MORE little step: have the Raspberry Pi check the status of the TV every FIVE SECONDS. To do this, we cheat and use a simple cron job.

Back to our shell, we type the following:

crontab -e
📋 COPY - then PASTE, then press ENTER

You may be asked which Editor you wish to use - choose 'nano' as it is the simplest one. This should be option 1 (press '1' and then ENTER).

You will be greeted with a bunch of information in the form of comments. Arrow all the way down past that, to the very end of the file, and paste in the following:

# The following checks the status of the TV every five seconds and redirects
# any output text to /dev/null:


* * * * * ~/checktv >/dev/null 2>&1
* * * * * ( sleep 5 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 10 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 15 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 20 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 25 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 30 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 35 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 40 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 45 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 50 ; ~/checktv >/dev/null 2>&1 )
* * * * * ( sleep 55 ; ~/checktv >/dev/null 2>&1 )
📋 [COPY CODE]

What this does is, every minute, runs the first 12 commands; each is spaced apart by 5 seconds using the 'sleep' command. The 'checktv' script ensures it isn't already running by creating 'tv.lock', so these instances can't overlap.

It is a bit crude, but it works pretty flawlessly in my experience!

Now simply CTRL+S and CTRL+X and you should see the following:

crontab: installing new crontab
your_username@raspberrypi:~$


Back in the TV room, power the TV off and on a couple times, waiting at least 15 to 20 seconds in between, to ensure everything is fully automatic at this point. If so, congratulations! Now it's time to have some fun, and play around with other HyperHDR settings to your liking!

None Of This Will Work!

Never fear -- there is ONE last thing we can do. Especially if you have a "non-Smart", no Internet/WiFi Television (or monitor), we can simply add a switch.

The best thing to do is add an inline switch to your splitter. This way, turning off the splitter will cause HyperHDR to have the "No Input" rainbow pattern, and will turn itself (and your LEDs) off.

Figure out which type of USB power port is on your splitter, and then choose one of these: Do not use one of these to turn off the Pi -- firstly, it's not good practice, and you'll have to wait for it to fully boot up every time. But secondly, turning off the Pi will NOT (necessarily) turn off the LEDs!

It's best to simply turn off the Splitter, letting HyperHDR see no signal, and gracefully shutting down the LEDs.

Also do not attempt to use an inexpensive inline switch on the big 5-Volt power supply, as it likely will NOT handle the 10- or 15-Amps!

▶ Next: Final Thoughts

◀ Prev: Color Calibration

↩ Back to the Beginning

.

Valid CSS!

Buy Me A Coffee

Home | About Me | More Info

Privacy Policy