Control “Fully Dashboard” via API with a DTH?

This is currently how I’m doing it, for screen on/off and dimming, but I’m thinking about moving this over to a virtual dimmer and core/webcore. IDK if this helps.

Name Type Value
deviceDimPath text /?type=json&password=xxxxx&cmd=setStringSetting&key=screenBrightness&value=
deviceIp text
deviceOffPath text /?type=json&password=xxxxx&cmd=screenOff
deviceOnPath text /?type=json&password=xxxxx&cmd=screenOn
devicePort number 2323
deviceStatusPath text /?type=json&password=xxxxx
1 Like

Thanks - I’ll give this whirl! Reposting for fixed formatting so others can copy and paste more easily.


URI Dimmer
Smartthings Devicetype
Copyright 2015 Sidney Johnson
If you like this device, please support the developer via PayPal:
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:
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.
Version: 1.0 - Initial Version
Version: 1.1 - Added device health check
Version: 1.2 - Added support for samsung connect
preferences {
	input("deviceIp", "text", title: "IP Address", description: "Device IP Address", required: true, displayDuringSetup: true)
	input("devicePort", "number", title: "Port Number", description: "Device Port Number (Default:80)", defaultValue: "80", required: true, displayDuringSetup: true)
	input("deviceOnPath", "text", title: "On Path (/blah?q=this)", required: false)
	input("deviceOffPath", "text", title: "Off Path (/blah?q=this)", required: false)
	input("deviceDimPath", "text", title: "Dim Path (/blah?q=this)", required: false)
	input("deviceStatusPath", "text", title: "Status Path (/blah?q=this)", required: false)

metadata {
	definition (name: "URI Dimmer Switch", namespace: "sidjohn1", author: "sidjohn1", ocfDeviceType: "oic.d.switch", vid: "generic-dimmer") {
		capability "Actuator"
		capability "Switch"
		capability "Switch Level"
		capability "Sensor"
		capability "Refresh"
		capability "Health Check"

	// UI tile definitions

	tiles(scale: 2) {
		multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
			tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
				attributeState "on", label:'${name}', action:"", icon:"st.switches.switch.on", backgroundColor:"#00A0DC", nextState:"off"
				attributeState "off", label:'${name}', action:"switch.on", icon:"", backgroundColor:"#ffffff", nextState:"on"
				attributeState "turningOn", label:'${name}', action:"", icon:"st.switches.switch.on", backgroundColor:"#00A0DC", nextState:"turningOff"
				attributeState "turningOff", label:'${name}', action:"switch.on", icon:"", backgroundColor:"#ffffff", nextState:"turningOn"
			tileAttribute ("device.level", key: "SLIDER_CONTROL") {
				attributeState "level", action:"switch level.setLevel"
		standardTile("offButton", "device.button", width: 1, height: 1, canChangeIcon: true) {
			state "default", label: 'Force Off', action: "", icon: "", backgroundColor: "#ffffff"
		standardTile("onButton", "device.switch", width: 1, height: 1, canChangeIcon: true) {
			state "default", label: 'Force On', action: "switch.on", icon: "st.switches.switch.on", backgroundColor: "#00A0DC"
		standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
			state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"

		main "switch"

def parse(String description) {
	def map
	def headerString

	map = stringToMap(description)
	headerString = new String(map.headers.decodeBase64())
	if (headerString.contains("200 OK")) {
		sendEvent(name: "${state.saveEvent[0]}", value: "${state.saveEvent[1]}", displayed: true)
		sendEvent(name: "status", value: "online", displayed: true, isStateChange: true)
	    sendEvent(name: "DeviceWatch-DeviceStatus", value: "online", displayed: false, isStateChange: true)
		log.debug "${state.saveEvent[0]} ${state.saveEvent[1]}"
		state.statusCount = 0

def installed() {
	log.debug "Installed with settings: ${settings}"

def updated() {
	log.debug "Updated with settings: ${settings}"

def initialize() { "URI Dimmer {textVersion()} {textCopyright()}"
	state.statusCount = 0
	sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
	sendEvent(name: "checkInterval", value: 32 * 60, data: [protocol: "lan", hubHardwareId: device.hub.hardwareID], displayed: false)

def autoPoll() {
	//	def sec = Math.round(Math.floor(Math.random() * 60))
	//	def cron = "$sec 0/8 * * * ?" // every 8 min
	//	schedule(cron, ping)

def on() {

def off() {

def setLevel(value) {

def ping() {

def refresh() {

def sendCommand(command) {
	if (isLocal(settings.deviceIp)==false){
		def cmd = "{settings.external_off_uri}"; log.debug "Sending request cmd[{cmd}]"
		httpGet(cmd) {resp ->
			if ( { "{}" 
	if (isLocal(settings.deviceIp)==true) { 
		def hubAction 
		def sendPath 
		switch (command) { 
			case "on": sendPath = "{deviceOnPath}"
			state.saveEvent = ["switch","on"]
			log.debug "Executing On"

			case "off":
			sendPath = "${deviceOffPath}"
			state.saveEvent = ["switch","off"]
			log.debug "Executing Off" 
			case "refresh":
		    	sendPath = "${deviceStatusPath}"
			sendPath = "${deviceDimPath}${command}"
			state.saveEvent = ["level","${command}"]
		state.statusCount = state.statusCount++
		if (state.statusCount >= 3) {
			sendEvent(name: "status", value: "offline", displayed: true, isStateChange: true)
		    sendEvent(name: "DeviceWatch-DeviceStatus", value: "offline", displayed: false, isStateChange: true)
		try {
			hubAction = [new physicalgraph.device.HubAction(
			method: "GET",
			path: sendPath,
			headers: [HOST: "${settings.deviceIp}:${settings.devicePort}"]
		catch (Exception e) {
			log.debug "Hit Exception $e on $hubAction"
		//	log.debug "${command}"
		return hubAction

private def isLocal(ip) {
	String hubNetwork = "${location.hubs.localIP}".tokenize( '.' )[0,1].join().replace("[","")
	String deviceNetwork = ip.tokenize( '.' )[0,1].join().replace("[","")
	if (hubNetwork == deviceNetwork){
		return true
	else {
		return false

def ipSetup() {
	def hosthex
	def porthex
	if (settings.deviceIp) {
		hosthex = convertIPtoHex(settings.deviceIp)
	if (settings.devicePort) {
		porthex = convertPortToHex(settings.devicePort)
	if (settings.deviceIp && settings.devicePort) {
		device.deviceNetworkId = "$hosthex:$porthex" "Setting up Network ID $hosthex:$porthex"
	else {
		log.debug "Error Setting up Network ID"

private String convertIPtoHex(ip) {
	String hexip = ip.tokenize( '.' ).collect { String.format( '%02x', it.toInteger() ) }.join()
	return hexip
private String convertPortToHex(port) {
	String hexport = port.toString().format( '%04x', port.toInteger() )
	return hexport
private String textVersion() {
	def text = "Version 1.2"

private String textCopyright() {
	def text = "Copyright © 2018 Sidjohn1"
1 Like

Would be cool if the DH could turn the tablet into a motion sensor / camera too :slight_smile:

edit: will try this out later

1 Like

It’s working well so far! Any interest in moving this to GitHub and allowing folks to help flesh this out? It looks like at least 2 people have ideas to contribute!

1 Like

This is why I love this community!!! I can definitely see how this would be useful.

1 Like

Crap, i totally forgot i already did that… some days
The Code:

With all the upcoming changes to Smartthings i’ve been trying to migrate away from custom DTH’s and find creative ways to use standard virtual devices. This is another way to do the samething.

1 Like

Perhaps I’m wrong about this but DTHs seem like a great way to package and encapsulate functionality neatly so it can be used by other pistons and apps and shared easily with others. The piston you’ve shared above seems to be specific to your environment and less portable (which is totally fine for the code which your wrote for yourself!) Also, adding additional capabilities would mean adding other virtual devices to mirror it which seems… messy.

What are the upcoming changes that you are referring to? The new app that doesn’t support DTHs? I can’t imagine that they will abandon the current ecosystem.

As some wise soul around here keeps saying choice is good… Fully has a lot of options and my use case my not be yours or anyone else’s which is why i posted both. Also my memory sucks so documenting something i struggled with may save me some time in the future and others too.

Both options in their current form do everything i need in my home (screen off when no one is home\ everyone is in bed, screens on when people are home, brighten screens at sunrise and dim at sunset)
but i fully :wink: appreciate that others will want fully to do more.

@iderdik i honestly don’t know whats not changing, people are still being migrating from SmartThings to Samsung AUTH, yes there is also the migrations from SmartThings Classic to Samsung Connect, but they’re are also changing their API and i don’t know how long the current API will be available. Also, while it may seam silly… i’m also trying to get as many devices as i can to run local. I find my environment is more stable that way.


@kevin holy moly that worked!

For me too, I had to mess with a bunch of Fully settings and eventually update Fully. Now I have it going into my TinyCamPro “server”

@kevin how do you redirect the Camshot? It would be good to get an email with photo if Home is in Away mode and the tablet senses movement, acoustic alarm or the screen comes on.

Infact I’m a little confused by this DTH, how anything can be automated, it doesn’t seem to be a 2 way communication, I tried a piston, IF screen comes on, set brightness to 50%, nothing happened.
Someone very clever really needs to go to town on this DTH, imagine having motion sensor capability, sound…

But finding the Fully Remote Admin was very convenient to change settings, rather than having to do it on the tablets.

Edit. there’s also a bug, if you change the screen brightness using the dimmer slider, Fully sets default screen brightness to 100, which is 40%, manually changing the brightness to 255, or leaving it blank/default and saving doesn’t make it stick. Tried deleting Fully and reinstalling, same behaviour. Sending my settings to Andrey, as he asked, see what he say’s.

I noticed this as well. I’m pretty sure that the setLevel command sends a value between 1-100 and thus doesn’t get the brightness correct. We probably need to change setLevel to do some simple translation like ($value / 100) * 255 to pass to sendCommand.

1 Like

I am not using the DH posted in this topic. If you just paste that getCamshot URL in web browser you will see the image. I use that URL in TinyCamPro that I have running on an old android phone. It is a “mini-NVR” for my various cheap/free cameras like this one. TinyCamPro can detect motion in the camera images and save images to the phone memory. I think it can email an image as well but I haven’t used that feature.

1 Like

@iderdik Good spot. I messaged the DTH author about this issue but he said he wasn’t providing any support for his DTH. I’ve spent far too long trying to troubleshoot this myself today. Now I just had to email the Fully Developer with an apology. So to get at least the brightness working correctly, all we need now is someone charming and clever with code like @tgauchat to help provide the missing code that changes 0-100 to 0-255.

1 Like

Ain’t so hard… I hope.

Please point me to the likely relevant section of code (I hope it is someplace convenient on GitHub) and I’ll provide a snip and y’all can test?

I suppose it might be a tad easier if I try the whole thing myself and point to the API address on my own Fully / tablet. I hope it isn’t too distracting.

As I mentioned - this is something I’ve actually been curious about offering - It is unfortunately just too obscure of a project to get our customer base amped up about.

1 Like

I found a workaround for setting the brightness to 100%, using WebCoRE, if you set level to 255 that sets brightness on the tablet to 100%!

The guys on Home Assistant really have a handle on Fullys’ capabilities, they are sending TTS messages to the tablet like…


Who knew you could even do that? Monitoring battery levels on Actiontiles tablets so when battery gets low you turn on a smart plug thereby not damaging the tablet battery and it swelling.
Bringing up different Actiontiles Panels on the fly by a particular motion sensor changing to active.

1 Like

We did :wink:! … That’s why we love Fully so much, because it has a ton of potential. I’m glad to see it being explored.

There’s a huge gap between having the APIs available and making them intuitively understandable (and having their value understood) by the average Customer.

But projects like this serve as excellent proofs-of-concepts.

Trying to do this in webcore but it’s not working for me. When I run the curl command manually I get:

{"status":"Error","statustext":"Please login"}

even though I am passing my password in the querystring as &password=xxxx. Am I missing something obvious?

Have you tried it in your browser first to check? In Fully settings enabled “remote local network access”, I didn’t bother with the cloud option.

Admin via the browser works fine. Remote Admin from Local network is on. Its so strange. I’ve emailed Fully for help.