[BETA] Vizio SmartCast Display Driver

[BETA] Vizio SmartCast Display Driver

This is an initial implementation of a device driver for Vizio SmartCast enabled displays. It relies on local https requests issued directly to the display API to provide the device control. Since the displays do not report status, you will need to rely on a polling routine to refresh the device states or call the refresh within your routine in RM when creating automations.

This driver uses elements from the unofficial SmartCast API documentation compiled by github user exviva (Travis LaMarr): https://github.com/exiva/Vizio_SmartCast_API

Current Functionality:

  • on/off
  • mute/unmute
  • volume up/down
  • volume set
  • channel up/down
  • refresh
  • child devices for input switching

Not Yet Implemented:

  • channel set
  • other cool stuff...

Known Issues:

  • Setting the volume level directly can cause erratic behavior when there is a soundbar or other audio device connected to and controlled by the HDMI ARC output of the display. This may or may not be something that can be addressed in future releases as it is dependent on the specific audio components involved and the limitations of CEC.

Requirements:

  1. HE Platform Version 2.1.8 or later as it utilizes the "ignoreSSLIssues" functionality introduced in that release.
  2. Your physical device must have a Static IP or DHCP reservation. This implementation does not include any device discovery functionality.
  3. Your HE Hub must be able to communicate with with your display on port 7345 or 9000 depending on the firmware of the display. If either the hub or your display are in an isolated network or vlan you must configure your network appropriately to allow this communication.
  4. In order to control the on/off state of the display, the display must be in "Quick Start" mode. If the display is set to "Eco Mode" the listening port is disabled when the display is off.
    .

Installation:

  1. Back up your hub and save a local copy before proceeding.
  2. Import the driver into the "Drivers Code" section of Hubitat:
  • Install driver code:

Display:
https://raw.githubusercontent.com/DixieChckn/Hubitat/master/drivers/VizioSmartCastDisplay/Vizio-SmartCast-Display.groovy

Input Child Device:
https://raw.githubusercontent.com/DixieChckn/Hubitat/master/drivers/VizioSmartCastInput/Vizio-SmartCast-Input.groovy

Initial Device Setup:

*You MUST have physical access to the display device to complete the initial setup. Pairing the driver with the display requires a numeric code that is displayed on-screen and must be entered into the driver settings to complete the pairing operation. All access to the API is authenticated and if the driver is not paired with the display it will not function.

  1. Create a new Virtual Device and select the "Vizio SmartCast Display" driver
  2. Enter the IP Address of your SmartCast display in the "SmartCast IP Address" field under "Preferences"
  3. If your display is running firmware version 4.0 or older, enter "9000" in the "SmartCast Port" field. If your display is running a firmware newer than 4.0, use the default value of "7345".
  4. Verify that the "Enable Pairing" setting is turned on in the "Preferences" of the virtual device.
  5. "Save Preferences"

Pairing

  1. Ensure your Vizio Display is turned on and you can view the screen.
  2. Click or Tap the "Pair" command button in the virtual device
  3. A numeric PIN code should appear on the screen of your Vizio Display. This PIN code will only appear for a short time. If the code disappears from the display before you complete step 9, you will need to Click or Tap the "Pair" command again to display a new code.
  4. Enter the code in the "pin" field of the "Complete Pairing" button in the device driver and then Click or Tap the button. If pairing was successful, the PIN displayed on the screen of the display will disappear and you will see an entry for "authCode" in the "State Variables" section of the device driver.
  5. "Save Preferences"
  6. At this point I recommend turning off the "Enable Pairing" option in the "Preferences" and saving. This will prevent the pairing code in the driver from running if the "Pair" command is unintentionally activated. If you need to re-pair the device in the future. Turn the "Enable Pairing" option on and "Save Preferences". You can then begin the pairing process again.
  7. Done!

Enabling Child Devices For Input Switching

  1. Ensure you've completed the initial pairing process. If this has been not been completed, the child device creation will fail.
  2. Verify that you've installed the "Vizio SmartCast Input" driver for the child devices.
  3. Enable the "Create Input child device" option in the device preferences and save.
  4. The driver will detect the inputs available on your display and create associated child devices for each input.
  • Each Input child device will act as a momentary switch and appear as a switch for automation purposes.
  • Inputs that are set to "Hidden" on the display will be created as child devices but will not be controllable.
  • The Input child devices can be deleted individually but deleted child devices will be recreated each time the preferences are saved if the "Create Input child devices" option is not turned off.

Multiple Hubs or Virtual Devices

  • If you plan to control the display from multiple HE Hubs or create multiple virtual devices to control the same display you will need to generate a unique "authCode" association for each instance. This accomplished by modifying the "Pairing ID" and "Pairing Name" and saving the device preferences prior to starting the pairing process. The "Pairing ID" must be numeric. The "Pairing Name" should be alpha. Do not use special characters in either. These values should be unique for each hub or virtual device.

Other Stuff

  • If enabled, Debug Logging can generate a copious amount of log data especially during status refreshes. This is by design to assist with troubleshooting during the beta test period. If enabled, it will disable itself after 30 minutes. Unless you are experiencing a specific issue, I recommend leaving this setting disabled.
  • Testers needed for Channel Set functionality. I wrote this against my display (E60-E3) which does not have an integrated tuner. I'll need testers to assist by providing JSON output from the channel portion of the API so I can parse it properly. I'll provide a modified driver to collect this data when I begin to add that functionality to the driver.
  • My goal for this driver is to have it work as universally as possible with as many SmartCast enabled display models as possible. As result, it may not ever control that one specific feature you're looking for, especially if it's unique to your display model. Feel free to ask politely but understand that I may politely decline.

Repositories:
https://github.com/DixieChckn/Hubitat/tree/master/drivers/VizioSmartCastDisplay
https://github.com/DixieChckn/Hubitat/tree/master/drivers/VizioSmartCastInput

5 Likes

Change Log

2020-02-21 - v0.02 - Added Child Device Functionality for Input Switching.
2020-01-28 - v0.01 - Initial Release

I just installed your driver and set my device up my Vizio Tv so that it has a static ip. I 'm able to turn off and on the tv with no problems and will be glad to help you test other feature if you like. I have an Vizio V505-G9. I also have an Sono's Beam attached to the HDMI Arc but haven't tested it yet other than to set volume in the preferences. Thanks for create this driver and if I can help please let me know. Thanks

I would be happy to help with data. I have a VIZIO P-Series Quantum that I'm using this driver on. I would love to have the ability to change inputs, but other than that, the current driver works great for turning it off and on! Thank you!

1 Like

Thanks for all the positive feedback!

I should be ready to do some initial coding for the input change commands later this week once work settles down. The API accepts changing the input in two ways.

  1. Cycling through them in order
  2. Setting the input directly.

Cycling the inputs is much easier to implement but not as functional or user friendly in my opinion.

Setting the input directly is ideal but more difficult to implement. I believe the best way to go about it would be to have the driver create a child button device for each input so you could then call that action directly from an automation routine. It would also allow the virtual buttons to be added to Alexa or Google Home for voice integration. i.e. "turn on HDMI-1".

I'm not familiar with how child devices are implemented yet so this will be a good learning experience. :slight_smile:

2 Likes

I have an "M" series. I don't use the tuner; and disabled speakers, using an external sound system.

The functions I use, and would like to test are the change input, and apps. I only use a few of the available apps. I could see using a child device to select the app to start; but only the few that are used, not one child for the dozen or so that are not used. Ideally, there would be a mechanism to select the interesting apps, creating child apps for those only.

As you suggested, direct selection of input would be preferable to stepping through the list.

Evening sir,

Just checking to see if you needed any testing or logs for your project. :slight_smile:

I'll be posting an updated driver and instructions in the next few days. This update will include the child device driver to create inputs as momentary switches. This should allow the ability to change inputs via RM, Dashboard Tiles, Voice Assistants, etc. It will dynamically generate up to 10 child devices based on the inputs the display reports via the API so it should work universally for all displays.

There are a few more test scenarios I want to run through and some general code cleanup before it's published but the new functionality is working well even it's current state.

Thanks to everyone for their support!

Thank you! Looking forward to it! :slight_smile:

My apologies on the delay. Work got much busier than anticipated this week.

The updated Display Driver has been published to GitHub:
https://raw.githubusercontent.com/DixieChckn/Hubitat/master/drivers/VizioSmartCastDisplay/Vizio-SmartCast-Display.groovy

The Child Device driver has also been published:
https://raw.githubusercontent.com/DixieChckn/Hubitat/master/drivers/VizioSmartCastInput/Vizio-SmartCast-Input.groovy

I'll work through updating the documentation but the short version for those updating is:

  1. Update the Vizio SmartCast Display driver
  2. Install the Vizio SmartCast Input driver
  3. Once installed, there will be a new option in the preferences for the Display named "Create Input child devices". Turn this on and Save Preferences to create the child devices for the input switches.

The child devices should be auto-created from the inputs available on your display. It will only create them if they do not already exist. The child devices can be deleted individually but make sure you disable the "Create Input child devices" option or the deleted child devices will be re-created each time you save the Display device preferences.

Each child device acts as a momentary switch. Turning on an input that is already "on" will have no effect.

If you find that you are unable to switch to a specific input make sure that the input is not set to "hidden" in the settings of your display. The input must be enabled and "visible" on the display itself to function properly.

1 Like

Thank You!

1 Like

Have you thought of something for Samsung TV's? I have several connected through my SmartThings hub and HubConnect. In my main hub through HubConnect, I'm using shackrat's AVR driver, but it doesn't really do much besides on/off...

Anyway, just though I'd ask... :slight_smile:

I might be able to do something for Samsung once I've got the Vizio one mostly ironed out. It depends largely on what control methods are available. I am due for a new TV in the guest room... :slight_smile:

This is the first driver I've written so it's still a bit of a learning process.

I'm trying to learn myself... Thank you again. :slight_smile:

1 Like

Worked great. Easy to follow documentation. Thank you!

Does this detect input or on/off status changes that come outside of using your driver, like a remote or Alexa command? I am trying to use the power status of the TV as a trigger for my motion sensors.

Thank you for the excellent driver.

I have it working nicely with my HE. I also have it synced with my Alexa but only power on/off works. Is there a way to get input and volume to work as well?

Alexa sees the tv as an on/off switch right now.

Thank you.

1 Like

This is really clean with great instructions - thanks! I can get it all connected and the dashboard tile up for on off through a switch attribute. But my volume attribute tile does not work at all. I only have the TV, no external speaker or anything. wrong tile type?

Have you considered adding support for Vizio SmartCast sound bars?