Migrating from SmartThings Classic or after first migrating to New ST App

Are there any advantages/disadvantages to migrating to Habitat from SmartThings Classic vs. migrating to the new SmartThings App first, then migrating to Hubitat? Does HubConnect work better with one or the other?

Hubconnect, AFAIK, was designed w/ST Classic app, so if anything might work better w/the classic app. However, I enabled it using the new ST app and it seemed to work fine once I had it set up. There is a looong HubConnect thread here that you should be aware of if you're going to be using it.

I thought Samsung said custom code was going away? or possibly I misunderstood?

@Rxich

ST is going to retire groovy and the IDE sometime next year. From what I understand (and I don't understand much) they have an API that you can use to write apps in any language you want. I saw a demo where they redid webCore to use this API and the piston executed much faster than when fun using groovy. The other big difference is that ST will no longer host user code when this happens. You will have to find a way to host your own code, AWS, etc. When they shut down groovy, Hubconnect will no longer work with ST unless it's modified.

2 Likes

Does anyone know why I get this error message "Cannot get property 'input' on null object on line 20" when I try to migrate this SmartThings SmartApp code to Hubitat "preferences { input("gatewayIP", "string", title:"Gateway IP Address", description: "Please enter your gateway's IP Address", required: true, displayDuringSetup: true)"?

need the whole file but my guess is not in the prerfernces section or something wrong right above it..

nc -i3 522 < input.txt > output.txt
*
*/
definition(
name: "Hunter Douglas Platinum Gateway",
namespace: "schwark",
author: "Schwark Satyavolu",
description: "Allows you to connect your Hunter Douglas Platinum Gateway shades with SmartThings and control them from your Things area or Dashboard in the SmartThings Mobile app. Adjust colors by going to the Thing detail screen for your PlatinumGateway shades (tap the gear on PlatinumGateway tiles).",
category: "SmartThings Labs",
iconUrl: "https://lh5.ggpht.com/FN3-xG6R0q9VjJHYE1iK5K2J11rTphiDEePr8XluI6o_s52xfPoHwt0-TZxc0qlVSQ=w300",
iconX2Url: "https://lh5.ggpht.com/FN3-xG6R0q9VjJHYE1iK5K2J11rTphiDEePr8XluI6o_s52xfPoHwt0-TZxc0qlVSQ=w300",
singleInstance: true
)

preferences {
input("gatewayIP", "string", title:"Gateway IP Address", description: "Please enter your gateway's IP Address", required: true, displayDuringSetup: true)
input("statusURL", "string", title:"Gateway Status URL", description: "Please enter the URL to download status", required: true, displayDuringSetup: true)
input("scenePrefix", "string", title:"Scene Name Prefix", description: "Please choose a prefix to add to all the Scenes", required: false, displayDuringSetup: true, defaultValue: "Shade Scene " )
input("shadePrefix", "string", title:"Shade Name Prefix", description: "Please choose a prefix to add to all the Shades", required: false, displayDuringSetup: true, defaultValue: "Shade " )
input("wantShades", "bool", title:"Do you want to add each Shade as a Switch?", description: "Turning this on will add one switch for EACH shade in your house", required: false, displayDuringSetup: true, defaultValue: false )
input("commandRepeat", "number", title:"Gateway Command Repeats", description: "Choosing 1 here will execute each command twice (1 command + 1 repeat)", required: false, displayDuringSetup: true, defaultValue: 0 )
input("commandInterval", "number", title:"Gateway Command Repeat Interval", description: "Time (in seconds) to wait between command repeats", required: false, displayDuringSetup: true, defaultValue: 5 )

since this is an app not a device in needs a section tag first

ie

preferences {

section (" General") {

input("gatewayIP", "text", title:"Gateway IP Address", description: "Please enter your gateway's IP Address", required: true, displayDuringSetup: true)
input("statusURL", "text", title:"Gateway Status URL", description: "Please enter the URL to download status", required: true, displayDuringSetup: true)
input("scenePrefix", "text", title:"Scene Name Prefix", description: "Please choose a prefix to add to all the Scenes", required: false, displayDuringSetup: true, defaultValue: "Shade Scene " )
input("shadePrefix", "text", title:"Shade Name Prefix", description: "Please choose a prefix to add to all the Shades", required: false, displayDuringSetup: true, defaultValue: "Shade " )
input("wantShades", "bool", title:"Do you want to add each Shade as a Switch?", description: "Turning this on will add one switch for EACH shade in your house", required: false, displayDuringSetup: true, defaultValue: false )
input("commandRepeat", "number", title:"Gateway Command Repeats", description: "Choosing 1 here will execute each command twice (1 command + 1 repeat)", required: false, displayDuringSetup: true, defaultValue: 0 )
input("commandInterval", "number", title:"Gateway Command Repeat Interval", description: "Time (in seconds) to wait between command repeats", required: false, displayDuringSetup: true, defaultValue: 5 )

}
}

I saved the device drivers and app. Now I can not control my shades. This is a log from a request to turn on the evening scene.

app:42020-10-13 05:34:17.342 pm errorjava.lang.NullPointerException: Cannot get property 'device' on null object on line 222 (runScene)

app:42020-10-13 05:34:17.332 pm debugsending $inm02- to C0A8002A:020A

app:42020-10-13 05:34:17.261 pm debugRunning Scene 02

app:42020-10-13 05:33:49.753 pm errorgroovy.lang.MissingMethodException: No signature of method: java.util.HashMap.sendEvent() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:label, value:Afternoon, isStateChange:true]] on line 260 (doDeviceSync)

app:42020-10-13 05:33:49.735 pm debugprocessing scene 00 from name Scene Afternoon to Afternoon

app:42020-10-13 05:33:49.730 pm debugUpdating Scenes...

app:42020-10-13 05:33:49.725 pm debugDB is [rooms:[00:[name:Nook, id:00, search:nook]], shades:[00:[name:Door 1, id:00, search:door 1, room:00, state:1], 01:[name:Door 2, id:01, search:door 2, room:00, state:1], 02:[name:Door 3, id:02, search:door 3, room:00, state:1], 03:[name:Door 4, id:03, search:door 4, room:00, state:1]], scenes:[00:[name:Afternoon, id:00, search:afternoon], 01:[name:Dusk, id:01, search:dusk], 02:[name:Evening, id:02, search:evening]]]

app:42020-10-13 05:33:49.722 pm debugfound scene with 02 and Evening

app:42020-10-13 05:33:49.721 pm debugfound scene with 01 and Dusk

app:42020-10-13 05:33:49.719 pm debugfound scene with 00 and Afternoon

app:42020-10-13 05:33:49.717 pm debugfound shade state with 03 and 1

app:42020-10-13 05:33:49.716 pm debugfound shade with 03 and Door 4

app:42020-10-13 05:33:49.715 pm debugfound shade state with 02 and 1

app:42020-10-13 05:33:49.712 pm debugfound shade with 02 and Door 3

app:42020-10-13 05:33:49.711 pm debugfound shade state with 01 and 1

app:42020-10-13 05:33:49.709 pm debugfound shade with 01 and Door 2

app:42020-10-13 05:33:49.708 pm debugfound shade state with 00 and 1

app:42020-10-13 05:33:49.706 pm debugfound shade with 00 and Door 1

app:42020-10-13 05:33:49.704 pm debugfound room with 00 and Nook

app:42020-10-13 05:33:49.702 pm debugprefix is set to 1

app:42020-10-13 05:33:49.696 pm debugprocessing state...

app:42020-10-13 05:33:49.692 pm debugUpdating status

app:42020-10-13 05:33:49.690 pm debugresponse contentType: text/plain

app:42020-10-13 05:33:49.688 pm debugCF-RAY : 5e1d36039d0ce4d0-LAX

app:42020-10-13 05:33:49.683 pm debugServer : cloudflare

app:42020-10-13 05:33:49.682 pm debugVary : Accept-Encoding

app:42020-10-13 05:33:49.681 pm debugExpect-CT : max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"

app:42020-10-13 05:33:49.680 pm debugcf-request-id : 05c62016430000e4d0e29e4200000001

app:42020-10-13 05:33:49.679 pm debugAge : 300

app:42020-10-13 05:33:49.678 pm debugCF-Cache-Status : HIT

app:42020-10-13 05:33:49.677 pm debugcache-control : public, max-age=1801

app:42020-10-13 05:33:49.675 pm debugx-xss-protection : 1;mode=block

app:42020-10-13 05:33:49.674 pm debugx-content-type-options : nosniff

app:42020-10-13 05:33:49.673 pm debugx-frame-options : DENY

app:42020-10-13 05:33:49.672 pm debugSet-Cookie : __cfduid=d48d21949971b4eeb7734449b8b6041551602635628; expires=Fri, 13-Nov-20 00:33:48 GMT; path=/; domain=.pastebin.com; HttpOnly; SameSite=Lax; Secure

app:42020-10-13 05:33:49.670 pm debugConnection : keep-alive

app:42020-10-13 05:33:49.669 pm debugTransfer-Encoding : chunked

app:42020-10-13 05:33:49.668 pm debugContent-Type : text/plain; charset=utf-8

app:42020-10-13 05:33:49.667 pm debugDate : Wed, 14 Oct 2020 00:33:48 GMT

app:42020-10-13 05:33:48.111 pm debugDoing Platinum Gateway Device Sync!

Can anyone help mr with this error?

2020-10-16 02:53:48.540 pm errorgroovy.lang.MissingMethodException: No signature of method: java.util.HashMap.sendEvent() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:label, value:Afternoon, isStateChange:true]] on line 260 (doDeviceSync)

This is line 260:

sceneDevice.sendEvent(name:'label', value: DB['scenes'][id]['name'], isStateChange: true)

This are lines 250 to 268:

def updateScenes(DB) {
log.debug("Updating Scenes...")
if(!state.scenes) {
state.scenes = [:]
}
state.scenes.each() { id, sceneDevice ->
if(DB['scenes'][id]) {
// update device
if(DB['scenes'][id]['name'] != sceneDevice.label) {
log.debug("processing scene ${id} from name ${sceneDevice.label} to ${DB['scenes'][id]['name']}")
sceneDevice.sendEvent(name:'label', value: DB['scenes'][id]['name'], isStateChange: true)
}
DB['scenes'].remove(id)
} else {
// remove device
log.debug("removing scene ${id} from name ${sceneDevice.displayName}")
deleteChildDevice(sceneDevice.deviceNetworkId)
}
}

Hi there. Also thinking of moving from SmartThings to Hubitat. First, I'd like to confirm that you are using my fork of this from SmartThings as your base, (GitHub username jeabraham) ? Second, did you put yours on GitHub too?

Thanks, John

Hi,
No I am not using you fork from ST as my base. I will review your fork. When I finish my migration, I will post on GitHub too. My user name is hubtheedge.

My fork has all the documentation I could find, and the full Mi Casa Verde source code as well. Also, some bug fixes. And, some additional comments and functionality. Thank you for working on this, my very first hubitat device is purchased and in the mail!