Groovy is on the way out Smartthings Edge is the replacement

Well I could, but it is all rather tail wagging the dog.

I am sure it is a technically sound solution that ticks a lot of boxes, but quite honestly I wouldn’t touch it with a bargepole as it is the boxes it doesn’t tick that are worrying. Even when I first looked a month or two ago when I saw it mentioned in despatches, I just thought ‘No, that can’t be right, that would be far too risky.’

I couldn’t see why you would need to either, but the documentation rather leads you in different directions, probably because it will go on to talk about the cases you mention.

1 Like

Other than having a one-click installer for lua, what boxes do you see it not ticking right now? I’m definitely interested in making the development experience as painless as possible.

I thought I scrubbed all the mentions of having to install lua from the docs and tutorials before everything was posted, where are you still seeing it say you need it?

My personal hope, based on nothing but blind optimism, is that what all of this plus Matter means is that a significant number of devices will just work out of the box in the future, no custom code required.

And that device manufacturers with a strong interest in the smartthings platform like Inovelli and Zooz will have a means for their programmers to provide easy to use edge drivers.

So that ultimately the only people other than device manufacturers who will need to write custom code will be people who are either creating their own hardware devices or their own add-on services. Or offering their programming services to device manufacturers who don’t have their own smartthings - savvy staff. So the new Lua channels Will be very useful to people like @krlaframboise , @erocm1231 , and @RBoy , but most of the rest of us won’t need anything except a URL provided by one of those other groups.

But like I said, that’s just optimism on my part. :innocent:

3 Likes

So, “Just works”?

Sounds sort of Utopian, but I’ll offer up some positive vibes, in case that helps.

1 Like

Ah, I did just find: Get Started with Hub Connected Devices | Developer Documentation | SmartThings

I saw the PR for that come up, but never actually reviewed it see where it was placed. I don’t have the power to fix that on my own, but I’ve brought it up and will try to get that moved/fixed on Monday.

Edit: though still please let me know if you’ve seen anything else.

Apart from seeming to lack interest in robust and polished distribution of their product, it is more the non-technical aspects of working with a language maintained without overt enthusiasm by an absolutely tiny University unit with a rather proprietorial approach to the code (they generously don’t mind bugs being reported, but they’ll do all the fixing thanks). I can imagine techies going for it, but I can also imagine their managers being much less enthusiastic. I just wouldn’t bet the shop on it.

To be fair, I’ve been reading documentation in all sorts of different orders and flitting around repositories in all sorts of different orders. So some are probably talking about an installation where you might need it. I’d argue there is definitely one problem document though …

The Developer Preview Development Tools page seems to talk of 1) using the CLI, and 2) Live Logging, which also uses the CLI. So basically the CLI right?

However that is closely followed by Set Up Your Development Environment which talks about LUA_PATH, the Lua library release, luasocket, luarocks etc, and then jumps onto a discussion of auto-completion and your IDE - IntelliJ or VSCode being examples. So the presence of Lua could be inferred.

It follows that with the Hello World example. That doesn’t involve a Lua installation but is worth a digression. The first command is an instruction to ‘clone the repository’ with:

git clone git@github.com:SmartThingsDevelopers/SampleDrivers.git

Or as we used to say at one place I worked.

HOW TO CATCH A BEAR.
1) Find a bear.
2) ...

Even if knowledge of git, GitHub, cloning and repositories are not critical to being able to type this command, why is there an assumption that command line git is available? I certainly don’t have it. The document is in a browser so at the very least it needs to link to a ZIP file.

I’ll leave you to decide whether LAN Edge Device Driver Development Guide really should come before the section on sharing your driver. It is a bit a leap.

Anyway, I think other examples are here and there. For example in Tutorial | Creating Drivers for Zigbee Devices with SmartThings Edge - Developer Programs / Tutorials - SmartThings Community I am not clear what to make of:

Connect to preview and make sure that SmartThings Lua libraries are available locally.

That might be an editors note or something that sneaked through, but nothing in the rest of the document seems to interest with the SmartThings Lua libraries (do they even exist to make available locally yet?).

UPDATE: It seems you found the main problem while I was knitting a flag here.

2 Likes

I can fix this. An earlier revision of the guide had more information about using the IDE extensions.

1 Like

Not to put more fuel on this particular fire, but version control is a pretty core development skill, and the bar for getting command line tools is pretty low. (Even if you don’t have a Mac or a Chromebook, a Pi will only cost a few bucks.)

With a few exceptions, it was the default way of distributing Groovy DHs and SmartApps, so they haven’t really raised the bar for device development at all.

Oh I hope that too. My one big fear is that there could be a conflict in the quality control. My current irritation (OK then, ONE of my current irritations, and the ‘remains’ rule in the Rules API is winding me up too) that I have mentioned previously is that an environmental sensor has been added to a stock handler with some supporting code mods. I don’t really speak Zigbee but I look at the code and think ‘if that refresh worked, why doesn’t the device report?’, and ‘those two commands seem to have been cough and dropped from another manufacturer’s device specific code, is that really correct?’. Then I wonder why one of the commands that does work was set to configure the device to report at a minimum of one hour and a maximum of two hour intervals when it is reporting room temperature to a tenth of a degree. Would ST ever feel in a position to be able to say to a manufacturer ‘Actually no, that driver simply isn’t good enough for the users of our platform’?.

Yes, this is pretty much why I negotiated my way out of being on the Edge alpha. Not only would I not have anything to work with (the Zigbee bits of my Aqara handlers are other peoples work, and everything else I have is trivial virtual handlers), but I didn’t think my opinion actually mattered much to compared to theirs. I’m just tinkering, they are doing it for real.

Clearly that doesn’t stop me throw a wobbler when I forecast a loss of tinkering.

2 Likes

@orangebucket you can install lua with Nuget on windows too.

3 Likes

It’s an anniversary cake. So you get it every year on the anniversary of the date when you first joined the forum. :sunglasses:

I guess difference of opinions on this. I’ve been using Lua for ages and have never encountered a problem with the way they develop. Their development practices are a little old school, but it just means it’s robust and stable.

The lack of a glitzy batteries included installer/distribution probably comes down to the fact that they’re more interested in in the embedded use case than the general scripting language use case. Which, is perfect for us.

I genuinely believe there wasn’t a better option for us to choose for our use case.

Ah, yeah, good note. Until about a month ago, the live logger was a separate tool. It probably doesn’t make sense to keep that section separated anymore. I’ll bookmark my post for a reminder on Monday.

Yeah, this beta release is somewhat developer focused. We need to base functionality there first, then we’ll go about making it more non-developer tinkerer friendly.

There’s only so much time to get everything done with a small number of engineers working on it. :slight_smile:

4 Likes

True, but what you get is a DLL and I’ve absolutely no idea what to do with it.

Doesn’t really matter. Those who really need it will probably have a suitable development environment for it, or will be able to create one.

I just don’t, and even something as seemingly trivial as an RPi represents more clutter. It also makes no sense for me.

1 Like

For Windows development, I would like to see documentation to use / package integrated with a major IDE, like VSCode, which has a zero cost to entry. Being able to develop with templates straight in the IDE, with hooks to run the CLI and even debugging/logging access right there.

Something along the line of:

  • install Visual Studio Code
  • install development package for ST Edge
  • link to ST CLI

You’ll get a lot more buy-in if the barrier to entry is low under Windows.

As much as I didn’t care for the Groovy web IDE it was mostly feature complete and allowed development anywhere. You had a basic editor, some code control, test harnesses and logging, all without installing anything.

2 Likes

To be fair, Groovy doesn’t need to be compiled, so The tools can be a lot simpler.

1 Like

We are working to make the setup more streamlined, and for VSCode we already have auto completion and some other features.

Code templates and a full plugin for VSCode is an interesting idea.

4 Likes

@jody.albritton

If I understand correctly, this is only for device handlers, how do we integrate smart app with device handler?

I need a way to specify what LAN device type and IP address (no ssdp, mdns, etc), and also general settings for all the LAN devices?

You can configure settings as device preferences.

https://developer-preview.smartthings.com/docs/devices/preferences/preferences

1 Like

Groovy was compiled into byte code and runs on a JVM.

Lua is also compiled into byte code and runs on It’s own interpreter/vm.

They’re similar from that point of view.

1 Like

Fair enough. I was unclear, so thanks for the correction. :sunglasses: My point was intended to be that using them with SmartThings is different, because the person writing in Groovy will just need to write their code statements; everything else is in the SmartThings cloud. From the original ST developer documentation:

SmartThings development does not require you to have a copy of Groovy installed, since SmartThings code is executed within SmartThings infrastructure, but having a local copy of Groovy is useful for learning.

But you made the same point more elegantly in your post above:

{In the existing groovy IDE} You had a basic editor, some code control, test harnesses and logging, all without installing anything.

1 Like