Samsung Hubitat TV Integration (2016 and later)

Pardon my ignorance as a new Hubitat user, but I'm trying to set up an automation to my The Frame TV to turn on to Art Mode at sunrise and in Rule Machine do not see my TV listed in switches to toggle the on state.

However, if I use the Devices page or set a switch in a dashboard the power on/off toggle is working as expected.

If I could get a nudge in the right direction on how to find the switch/toggle/button code to set up in my Rule it would be much appreciated.

Welcome to the quagmire and I hope the community is helpful. I will be updating the driver today and add Capability "Switch".

Dave Gutheinz

1 Like

Excellent! You are a fscking rockstar.

I installed this the other day and I haven’t played with it much yet.

I have a 2019 UN55RU7100 and for the first time since switching it from wifi to Ethernet I am able to turn the damn thing on remotely!! Outside of HE I previously attempted to use a magic packet WOL with no success so I am surprised that this is working. Awesome.

Ok my real question and I think I know the answer.

I added the device to the list of devices available to Alexa but the TV is not showing up in the Alexa app.

I assume it is not supported directly through this interface and I need to create virtual switches to trigger an RM to do the function I want.

I just originally assumed I could add the device directly to support on and off functions.

Using the alexa app or alexa skill in HE?

Nice to see progress being made on this! Being away from it for some time.

Please any luck/update with the Smartthings API inclusion? Would love to be able to see the current source and application running:

Just a heads up, I currently use HubConnect to get my TV info. I created a custom driver that has the inputSource and the tvChannelName (current app running). I also had to edit the HubConnect code in 1 location to deal with nulls (when no app is running, tvChannelName becomes null and HE doesn't like nulls so it gives it the previous value).

It had been working pretty well but for some reason, recently, HubConnect has been missing updates from the TV. In ST, I see the updates but not in my device in HubConnect. Before that, it worked perfectly. Can also share the driver info if you guys want.

@lewis.heidrick does yours (using the AVR driver) consistently update? Trying to understand why mine is misbehaving.

I haven't noticed any issues but I also don't really pay much attention to it. I spend too much time here on the forums to notice when something isn't working. It's usually my wife that lets me know if something isn't working.

Thanks. So you have your TV set up in ST? And in ST, can you see the current app running and the current input source?

Yes

1 Like

Version 1.3.4 (NOW) adds Capability Switch. This will allow direct link to Alexa,

New BETA 1.3.4 Available. Addresses (attempts):

  • WiFI to/from Wired Interface: Updating MAC after converting wired to/from WiFi. Simply do a save preferences and the settings (including MAC) will update.
  • ArtMode: Toggle not working. Update preferences and try again. It may take two pushes to initialize the toggle (get the latest state).
    • Open: Getting artMode state directly from TV. Need code feedback with debug log while trying artMode. I think I found the issue, but.,,,,
  • Capability Switch: Enabled. Allows rule machine, Alexa, etc to access on/off function.

Paths, etc. are in top post of this thread.

Hint: There are three ways to update:

  • Use HPM
  • Copy file directly from GitHub Link
  • Open code in Hubitat editor and use Import function.
3 Likes

MAC update worked perfectly. WOL is working again. Thanks!

1 Like

I should have been specific.

The Amazon Echo Skill and I should also note that I am in Canada and I know there are some differences between US and here.

Last note. I installed the Samsung TV os on the other hub connected via hub mesh.

Awesome !!!

Do you have a test sequence to help debug? I cycled between Art mode and TV mode a couple times with logging on, will send you logs in DM.

artModeStatus in the device page is populating now (used to just say NULL). It reports "on" when the device is actually in Art mode and also when the TV is on. There's a brief moment when you switch from TV to Art mode where the status will report NULL before switching to "on" again.

Let me know what other info you need. Thanks again, this is awesome.

1 Like

Sorry guys, I lost you on the last few changes. How to I make a dashboard button to say power on or off since these command buttons interfaces have been removed?

Can I use your code to integrate with mine. Plan is to add a preference to use SmartThings data that will enable the associated commands. I will integrate to fill-in the capabilities herein,

Dave

Capability Switch is now enabled. The template is switch.

FYI,

I did the below without any virtual devices or buttons (there is a button interface built into the code). The only search was the images for the backgrounds.

2 Likes

When I said I created a custom driver, I was referring to a HubConnect Custom Driver. So it doesn't query the ST API or do anything like that. It just enables some capabilities to look for in the ST device. As such, it won't actually be helpful to you. I've pasted it below though.

/*
 *	Copyright 2019-2020 Steve White, Retail Media Concepts LLC.
 *
 *	Licensed under the Apache License, Version 2.0 (the "License"); you may not
 *	use this file except in compliance with the License. You may obtain a copy
 *	of the License at:
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 *	License for the specific language governing permissions and limitations
 *	under the License.
 *
 *
 */
def getDriverVersion() {[platform: "Universal", major: 2, minor: 0, build: 0]}

metadata
{
	definition(name: "HubConnect TV", namespace: "shackrat", author: "Steve White", importUrl: "https://raw.githubusercontent.com/HubitatCommunity/HubConnect/master/UniversalDrivers/HubConnect-AVR.groovy")
	{
		capability "Switch"
		capability "Refresh"
		capability "Actuator"
		capability "Telnet"
		capability "Initialize"
		capability "AudioVolume"

		attribute "inputSource", "string"
        attribute "tvChannelName", "string"
        attribute "soundMode", "string"
		attribute "version", "string"

		command "setInputSource", [[name:"MediaSource", type: "STRING", description: "Media Source" ]]
        command "setTvChannel", [[name:"channel", type: "STRING", description: "Application ID" ]]
        command "channelUp"
        command "channelDown"
		command "sync"
	}
}


/*
	installed

	Doesn't do much other than call initialize().
*/
def installed()
{
	initialize()
}


/*
	updated

	Doesn't do much other than call initialize().
*/
def updated()
{
	initialize()
}


/*
	initialize

	Doesn't do much other than call refresh().
*/
def initialize()
{
	refresh()
}


/*
	uninstalled

	Reports to the remote that this device is being uninstalled.
*/
def uninstalled()
{
	// Report
	parent?.sendDeviceEvent(device.deviceNetworkId, "uninstalled")
}


/*
	parse

	In a virtual world this should never be called.
*/
def parse(String description)
{
	log.trace "Msg: Description is $description"
}


/*
	setVolume

	Does what it says.
*/
def setVolume(value)
{
	parent.sendDeviceEvent(device.deviceNetworkId, "setVolume", [value])
}


/*
	editCurrentInputName

	Does what it says.
*/
def editCurrentInputName(value)
{
	parent.sendDeviceEvent(device.deviceNetworkId, "editCurrentInputName", [value])
}


/*
	setInputSource

	Does what it says.
*/
def setInputSource(value)
{
	parent.sendDeviceEvent(device.deviceNetworkId, "setInputSource", [value])
}

/*
	setTvChannel

	Does what it says.
*/
def setTvChannel(value)
{
	parent.sendDeviceEvent(device.deviceNetworkId, "setTvChannel", [value])
}

/*
	ChannelUp

	Does what it says.
*/
def channelUp(value)
{
	parent.sendDeviceEvent(device.deviceNetworkId, "channelUp")
}

/*
	ChannelDown

	Does what it says.
*/
def channelDown(value)
{
	parent.sendDeviceEvent(device.deviceNetworkId, "channelDown")
}

/*
	mute

	Mutes the device.
*/
def mute()
{
	// The server will update on/off status
	parent.sendDeviceEvent(device.deviceNetworkId, "mute")
}


/*
	unmute

	Unmutes the device.
*/
def unmute()
{
	// The server will update on/off status
	parent.sendDeviceEvent(device.deviceNetworkId, "unmute")
}


/*
	on

	Turns the device on.
*/
def on()
{
	// The server will update on/off status
	parent.sendDeviceEvent(device.deviceNetworkId, "on")
}


/*
	off

	Turns the device off.
*/
def off()
{
	// The server will update on/off status
	parent.sendDeviceEvent(device.deviceNetworkId, "off")
}


/*
	volumeUp

	volumeUp on the device.
*/
def volumeUp()
{
	// The server will update status
	parent.sendDeviceEvent(device.deviceNetworkId, "volumeUp")
}


/*
	volumeDown

	volumeDown on the device.
*/
def volumeDown()
{
	// The server will update status
	parent.sendDeviceEvent(device.deviceNetworkId, "volumeDown")
}


/*
	refresh

	Refreshes the device by requesting an update from the client hub.
*/
def refresh()
{
	// The server will update status
	parent.sendDeviceEvent(device.deviceNetworkId, "refresh")
}


/*
	sync

	Synchronizes the device details with the parent.
*/
def sync()
{
	// The server will respond with updated status and details
	parent.syncDevice(device.deviceNetworkId, "switch")
    parent.syncDevice(device.deviceNetworkId, "inputSource")
    parent.syncDevice(device.deviceNetworkId, "tvChannelName")
	sendEvent([name: "version", value: "v${driverVersion.major}.${driverVersion.minor}.${driverVersion.build}"])
}