Drivers for Samsung Appliances controlled via SmartThings Cloud API

Hey @djgutheinz ,

Is there a way to turn off the trace logging? It's filling up my logs. I figured it was needed during the beta testing, but if this is a final version, can we turn it off?

This is on my washer/dryer and flex mini versions.

Just updated. Quickie fix. Update
HPM Repair or
Use import button in each driver's edit page.

1 Like

Thank you!

Update to 1.2. Sorry for the quick turn. Had some critical changes to invoke.

Changes:

  • fixed child install for Refrigerator
  • fixed logging to eliminate unnecessary log.trace messages
  • added capability AudioNotification (for user test) to Soundbar.
1 Like

I updated the Soundbar to include playText and playTrack for YOU to test. Embedded in the code at line 198 are some uri's for the playTrack. Format is the uri only. Example (without quotes)

"http://s3.amazonaws.com/smartapp-media/sonos/dogs.mp3"

Hi @djgutheinz ,
I hope I am testing the correct way.
I updated the driver - OK
Copied one of the URI's from the code and pasted on a local computer to make sure the PC can reach it - OK, I hear the sound on the PC.
Pasted the URI in the soundbar device page this way:

When I click 'Play Track' - No sound and the following log:

Are you refering to Samsung Automation Studio. It does work as i have been using it for over a year, but requires a few things. Beyond just creating the webhook endpoint you also need the endpoint to use SSL and be on the internet. This is why in my write up for Samsung Automation studio i include directions for setting up nginx proxy and using Duckdns for a host name online.

Once the webhoon is enabled you then create the app in the Samsung workspace by pointing to the webhook you created. Asumming you got it right the worspace will validate it and the. Just work.

You will also need to set youe phone app to developer mode so you can install your custom app.

Qhen thinga are good this will he near instant.

This was the NR I found, have not tried to set it up yet.

I suspect you will be better off using the Samsung Automation Studio pallet which is officially supported by Samsung and works with the new API.

Command was accepted. Your soundbar can not play it (just like mine). I have another method to try (using the UPNP capability of the soundbar that is implemented on my multiroom speaker driver). It may work. Not hard to integrate - harder to test.

I have added a different method to play URIs. The code is at :

"https://raw.githubusercontent.com/DaveGut/HubitatActive/master/SamsungAppliances/Samsung_Soundbar.groovy"

you can either do a HPM Repair or (alternatively) use the import function. This new method does not affect functionality other than playTrack functions but disables the playText functions.

Hi,
Installed the new driver version and still no sound.
I assumed I need to fill in the device IP and check ON the 'Use UPnP for audio notifications'. Tried with and without the 'Use UPnP for audio notifications' and still no sucsess.
Log:

Hi @djgutheinz

I see that you made adjustments to the HVAC drive, and removed what we had added from setOn. I tested version 1.2 and it came back to incompatibility with US equiments. So, using your version 1.2, I added the command and it worked again.

Below the block of code adjusted if you can put in its official version, I believe can help enough users of US equipment.

def auto() { setThermostatMode("auto") }
def cool() { setThermostatMode("cool") }
def heat() { setThermostatMode("heat") }
def wind() { setThermostatMode("wind") }
def dry() { setThermostatMode("dry") }
def samsungAuto() { setThermostatMode("samsungAuto") }
def emergencyHeat() { logInfo("emergencyHeat: Not Available on this device") }
def off() { setThermostatMode("off") }
def setOn() {
	def cmdData = [
		component: "main",
		capability: "switch",
		command: "on",
		arguments: []]
	def cmdStatus = deviceCommand(cmdData)
	return cmdStatus
}
def setOff() {
	def cmdData = [
		component: "main",
		capability: "switch",
		command: "off",
		arguments: []]
	def cmdStatus = deviceCommand(cmdData)
	return cmdStatus
}
def setThermostatMode(thermostatMode) {
	def cmdStatus
	def prevMode = device.currentValue("thermostatMode")
	if (thermostatMode == "auto") {
		state.autoMode = true
		cmdStatus = [status: "OK", mode: "Auto Emulation"]
		poll()
	} else if (thermostatMode == "off") {
		state.autoMode = false
		cmdStatus = setOff()
	} else {
		state.autoMode = false
		if (thermostatMode == "samsungAuto") {
			thermostatMode = "auto"
		}
		cmdStatus = setOn()
		cmdStatus = sendModeCommand(thermostatMode)
	}
	logInfo("setThermostatMode: [cmd: ${thermostatMode}, ${cmdStatus}]")
}
def sendModeCommand(thermostatMode) {
	def cmdData = [
		component: "main",
		capability: "airConditionerMode",
		command: "setAirConditionerMode",
		arguments: [thermostatMode]]
	cmdStatus = deviceCommand(cmdData)
	return cmdStatus
}

And remember on line 26 to remove the blank in the array, leaving this line.

			constraints: ["off", "auto", "cool", "heat", "dry", "wind", "samsungAuto"],

Thanks!

Updated version to 1.2.1 to incorporate the above. Thank you.

Update: HPM Repair or Driver's Edit Page "Import" function.

Updated with version 1.2 on 9/13. Fix was to review and update code.

What happens: The return from the device in SmartThings includes a lot of components (including pantry-01 (and etc) that are not enabled). It also includes a list of disabledComponents.

Going through each component, the code determines if it is on the disabledComponents list. If so, it does not install. If not on the list, it installs the component as a child. This is done on-faith that the disabledComponents list is true and correct. If it has errors, the correction is for the user to delete the component (child).

1 Like

Mark, Can the display be blacked-out via the SmartThings interface. If so, could you

This will give me the data needed to create the command string (maybe).

Dave

1 Like

Hi!

Sorry, there is still one more line to add to the code:

cmdStatus = setOn()

It would be on line 118, before the

cmdStatus = sendModeCommand(thermostatMode)

That is, first you turn on the equipment, and then you send the command of which Mode it should be.

Thanks,
Wilson

Done.

1 Like

New test driver located at:

"https://raw.githubusercontent.com/DaveGut/Test-Code/master/Samsung_Soundbar.groovy"

Do not enable debug logging. Just run the same test as before.

Error in you logs was sending a volume command to the UPNP capability. The actual other commands succeeded; however, we do not know the state of the volume (may have set to 0 due to the previous error). This works on my Soundbar.

1 Like

The magic has happened :clap: :clap: :clap:
My soundbar now bark like a dog :dog:
I will further test in in the coming days to see how I can make it bark as part of my "Home first line of defense" rules.
Thanks a lot @djgutheinz