I was trying to have my code detect whether it is being run on a SmartThings or Hubitat Setup.
By default, Hubitat doesn’t seem to have any API call which provides something similar. But the below function seems to work well for me.
Hope this helps someone else who may be looking for a similar requirement.
def getEcosystem() {
String hubdomain = location.getHubs().find{ it.getType().toString() == 'PHYSICAL' }
if (hubdomain.matches("com.hubitat(.*)")) {
return "HE"
}
else if (hubdomain.matches("Smartthings(.*)")) {
return "ST"
}
}