Complete newbie wanting to learn how to install new device handler from published code


(Shawn Gandrik) #1

I’m completely new to this and want to begin with my Aeon Labs Heavy duty smart energy switch. I’ve found the code that I think performs the functions here: https://github.com/jpansarasa/SmartThings/blob/master/devicetypes/elasticdev/aeon-labs-heavy-duty-smart-energy-switch.src/aeon-labs-heavy-duty-smart-energy-switch.groovy. But, having never done any coding and having never used this interface, I am at a loss. I read the FAQ’s, but they are still just beyond my understanding.
Copy and paste, yes, I can do that. But copy and paste which parts? And when I get to the part that says:
def configure() {
//Get the values from the preferences section
What preferences section? etc.
A little hand holding would be very much appreciated. Remember, I did preface this with “complete newbie”.
Is there something I should read that would give me a lay persons understanding of what I’m looking at here?
Thanks in advance.


#2

See if this helps at all. Since “device type” and “device handler” are the same thing, you would copy the entire groovy file that you found and use the instructions for a device handler.


(Shawn Gandrik) #3

Yeah, read that. And got excited when it said “Using a Custom Device Handler: Easy!” And then went to the code that I found (and linked to) and that’s where “Easy!” became “WTF is easy about this???” It doesn’t look like everything there should be copied and pasted. But then, I have no idea what I’m even looking at. And as I move down through it I get to the part that says, “def configure…get values from the preferences section”… What preferences section? Am I making this harder than it actually is? Is it really as easy as just copying and pasting that entire linked text section, or are there sections that do require custom input as implied by “get values from preferences section”?


#4

Sorry, I depend on text-to-speech software and I can’t read groovy code, so I can’t help you with that specific device handler. But normally, yes, you would just copy the entire file however long it was.

It looks like the following is the community thread on that particular device handler. It appears that you only need to change the preferences if you want to change the reporting Period. But if you have any specific questions about the code, I would ask them in that thread, and someone should be able to help you. :sunglasses:


(Shawn Gandrik) #5

Thanks, for the help. And the patience. It appears that I was making it harder than it actually is.


(Russ Williams) #6

I don’t think you are making it hard – I’m struggling too. Not a ST newbie. I can build computers and just finished spearheading the implementation of Acumatica ERP in our company, but I can’t get a community published device handler/type working.

Not sure what the Device Network ID should be, so I went to an existing device (Aeon Smartstrip) to find it. Then, while in that device, I clicked new device, entered the requested information, hit save and keep getting this error…

I’ll take ultra-newbie status if someone is willing to help me.


(Rob Moore) #7

I have the same error:

Oh No! Something Went Wrong!

Error
500: Internal Server Error
URI
/device/show/ce1a2e28-baee-47ea-8530-cddf2ccaa7cb
Reference Id
6693d1d4-ac16-43f0-af81-3159578c70e5
Date
Wed Feb 07 18:12:45 UTC 2018