[RELEASE] Advanced Television Application - Predictive Engine, Acoustic Management, and ROI Tracking

Hey everyone! I’m sharing my Advanced Television Application , a comprehensive tool for anyone who wants their entertainment centers to behave more like a smart, integrated part of the home rather than just a standalone screen.

This app is built to handle up to 10 televisions with granular logic for cinema lighting, acoustic interference, and even utility cost tracking.

Key Features

  • Live System Dashboard & Financials:
    • A real-time table showing power state, the active application (Netlfix, YouTube, etc.), and daily watch time for every TV in the house.
    • ROI & Cost Tracking : Enter your TV's average wattage and local electricity rate to see exactly how much your daily entertainment is costing you.
  • Acoustic Management (Cinema Mode):
    • HVAC Volume Boost : Automatically increases TV volume by a set number of "clicks" when your A/C or heater starts blowing, then reduces it when the room goes quiet again.
    • Noisy Appliance Suppression : Automatically turns off air purifiers or fans when the TV turns on to ensure the best audio environment.
  • Safety & Security Interruption:
    • Auto-Mute : Instantly mutes all active TVs if a doorbell is pressed or specific safety contacts (like a nursery door or front window) are opened.
  • Intelligent Lighting & Audio Sync:
    • Cinema Lighting : Turns off specific lights when the TV powers on.
    • Environmental Logic : Optionally only restores those lights when the TV turns off if your blinds are closed or it's after a certain time.
    • Sonos Sync : Pauses background music when you start watching a movie and automatically resumes it when you’re done.
  • Scheduling & Routines:
    • TV Show Favorites : Schedule specific shows to automatically power the TV and tune to the correct channel, then shut the TV off when the show ends.
    • Morning Dashboard : Triggers your news or weather channel of choice the first time motion is detected in the morning within a set time window.
  • Severe Weather Overrides:
    • Forces all TVs in the house to turn on and tune to an emergency broadcast channel when a virtual weather alert switch is triggered.
  • Hardware Safety:
    • Volume Normalization : Sets soundbars to a fixed startup volume or tapers Roku speakers down during shutdown to prevent "loud wake-ups".
    • Inactivity Timeout : Shuts off the screen automatically if no one has moved in the room for a user-defined period.

How to Use

  1. TV Setup : Configure each TV (up to 10) with its primary device driver and optional soundbar/audio device.
  2. Enable Modules : Toggle on specific features like Acoustic Management, Safety Mute, or Sonos Sync only for the rooms that need them.
  3. Monitor ROI : Check the Live Dashboard to see your "Top App Today" and total entertainment costs for the household.

Licensing & Support

This application is completely free to use, edit, and "steal." I built this to solve a need for high-end automation in my own home, and I'm happy to share it with the community.

If you run into any issues, need a specific fix for your TV driver, or have a feature idea, please feel free to ask! I’m happy to help keep the code updated.

raw.githubusercontent.com/ShaneAllen334/Hubitat_Apps/refs/heads/main/Advanced_Television_Application/Advanced_Television_Application.groovy

5 Likes

This looks like quite the app, but TVs are probably one of the only things I have had no interest in connecting to Hubitat, past turning them on and off, and even with that ability, I use the remote 99% of the time.

I'm a bit surprised anyone would want this much automation for TVs, but to each their own. I automate just about everything else in my house except TVs.

In my house, anything that can be automated gets automated (except the garage door, F that thing). Please never talk to my wife. :rofl:

1 Like

I can say the same, but with the exception being TVs :grimacing: To me, it seems like anything beyond the remote control is just complicating things with TVs.

I do like universal remotes, though, to combine everything together, and IR blasters to just turn them on and off with voice control and for my bedroom goodnight scene. I don't use cable channels, and I just can't see needing any automations for my Roku sticks.

This looks awesome. Hopefully, this will solve some of my issues. If it can determine what app is running on my Samsung Frame...and if it's in TV mode or Ambient...alone that would be awesome. I have 4 TV's in different rooms.

I'm amazed that of all things "Smart TV's" are actually pretty dumb.

What device type are you using for your Samsung Frame? I will more than likely have to add its capabilities to the Application. Right now, this is mostly RokuTV supported.

Ahhh...need to work on my proof reading skills!

Samsung TV Remote

I find it kind of hilarious that since Samsung made Smarting's...that their TV's are pretty dumb.

I'm in. My main TV's sound is overridden when the furnace fires up. I wrote my own rule but would much rather use some of the additional features mentioned in the app to control this.

Can't wait to try this out!

Thank you.

  • Don

If you run into any issues let me know, or come up with any great Ideas!

1 Like

Smartthings made Samsung TVs smarter, and then Samsung made Smartthings dumber :rofl:

1 Like

Agree. I like the quality of the video but their TVs are about as dumb as they get :-(.

I will be testing the new app out this evening and will follow up.

As I setup my first device (A Pioneer Elite SC-LX801 I was thinking in addition to the number of HVAC Volume Boost (Clicks) it would nice to have an option to input the actual target volume number. For example 149 for the amplifier. That is to say if I am using the field correctly.

  • Don

Similar to this option but for the TVs, Amplifier, and other devices. I think I am using the HVAC clicks incorrectly??

What are you using to command your AV equipment?

Hubitat Rule Machine

Sorry I meant to ask what device type? The TV and the AV, Sound bar have to support absolute volume commands.

In my use case I have a RokuTV that doesn't allow for me to set a specific volume it only accepts volume up and down like a remote. My Sonos soundbar supports an absolute volume setpoint so I can set it to 30% throught the Soundbar option.

I might be able to adapt the application to support whatever device your using to command volume and control of your television and AV receiver.

If you believe it adds value to your larger target audience and use cases.

In my case all devices connect to the pioneer amp inputs (Roku, TV, AppleTV, Xbox, Turntable), you get the idea. The amp is then used as the central source to control the volume for all sources with all speakers for the house connected to it.

The driver used for the amp is:

The scrip I am currently using to control the volume when the thermostat turns on is below. Notice the command to directly set the volume:

There is no need to make any changes to your application if you believe I am an isolated case. Just sharing for your information.

Hope this helps.

  • Don

:rocket: New Feature Update: Advanced Television Application

Hey everyone! I’ve just pushed a major update to the Advanced Television Application. This release introduces some heavy-hitting features specifically designed for users with complex home theater setups, advanced audio receivers, and energy-saving smart plugs.

Here is what's new:

:electric_plug: Smart Plug Power Sequencing & State Restoration

  • The Boot-Up Buffer: You can now assign a physical Smart Plug to your TV to save on phantom power drain. When automated routines trigger (like Morning News, Scheduled Shows, or Severe Weather Alerts), the app will now automatically turn the smart plug on, wait exactly 20 seconds for the TV to establish a Wi-Fi connection, and then send the power and channel commands.
  • Intelligent Auto-Restore: The app acts as a perfect steward of your power. If the smart plug was off before a routine started, it remembers that state, lets the TV power down gracefully after the routine ends, and then kills the smart plug power again. If the plug was already on, it leaves it on.

:loud_sound: Onkyo AVR & Absolute Volume Support

  • Absolute vs. Relative Volume: Added a new toggle for Onkyo AVRs (and other advanced receivers). Instead of sending a loop of "volume up/down" click commands, the app now dynamically calculates absolute volume math.
  • Seamless Acoustic Management: If your HVAC kicks on and you requested a 5-click volume boost, the app pings the Onkyo for its current level (e.g., 50%), calculates the exact jump, caps it to prevent speaker damage, and sends a single, precise setLevel(55) command. When the HVAC turns off, it drops it right back to setLevel(50).
  • Hardware Agnostic: Fully backward-compatible! Standard Roku TVs or basic soundbars will still use standard, paced click-commands. The app detects your hardware limits and adjusts its logic automatically.

:gear: Hubitat Core Stability Enhancements

  • Sequential Processing (singleThreaded: true): Upgraded the core definition block to force Hubitat to process events sequentially rather than concurrently. This eliminates race conditions. Now, if someone walks into the room, the HVAC kicks on, and a scheduled TV show starts at the exact same millisecond, the app processes everything in perfect order without corrupting your state variables.

*** Let me know what you guys think, and drop any feature requests or feedback below!

raw.githubusercontent.com/ShaneAllen334/Hubitat_Apps/refs/heads/main/Advanced_Television_Application/Advanced_Television_Application.groovy

I used a virtual Onkyo AVR device and it worked, but you will have to let me know how it works in a real-world use case, as unfortunately I don't have a AVR setup at this time.

Wow. Thank you. I do see the option for Onkyo AVR but I don't see an option to up the volume for HVAC on and then off. I still only see click up and click down??

See below.

The HVAC volume boost option will automatically apply the number to your setpoint that you choose.

Example

Audio is at 50% you choose 10 clicks, when the HVAC runs it will send a 60% command.