I’ll admit I am still fairly new to groovy, but I am pretty fluent in various shells. Is there anyway to get a verbos output of some code so I can get a better understanding of what it is doing? I am trying to port an app from smartThings, and when trying to run it, it fails with a 500 error but I see no details about what caused the error.
In the Hubitat menu, open the last option ‘Logs’ in a separate window/tab. This is a live output of everything that writes to the log including errors. Try to run the app and check the Log window when you get the 500 error. In some cases I got the 500 error without any info in the log. I usually add some additional log lines to see what point in the code it’s getting up to. Some common causes I had were an href to another page that wasn’t defined in the preferences. There isn’t any line by line debugging so your best option is to add additional logging output from what I understand.
Are you able to see the section “Harmony Hub List :” with the option for “Add a device…”? If so, does the 500 error show up on that page or when you click “Add a device…”?
It looks like discoverHubs is using HubAction and receiving a response asynchronously. One test is to comment out line 77 since the hub is already discovered and stored in the state.
HeHeHe… I looked at that app before I wrote my simple Harmony Integration for Hubitat:
The KuKuHarmony app was a bit overwhelming for my Groovy skills, and it does not support Harmony Activities. All I wanted was simple Harmony Activities, so I wrote the above simple device Driver for Hubitat.
If you read through the thread, there are a couple of other workarounds available as well.
At a minimum, you might be able to look at my Driver code to see how it communicates to the ‘harmony-api’ running on a separate server. KuKu uses the same ‘harmony-api’.
Yeah. I saw that, but I had already began to understand how this app was written so I want to see it to the end if possible. Honestly I feel like all of the different calls make it harder to follow. I may end up redesigning the app once I get this to work over here. It’s also formatted different than most other apps I’ve seen. Most of them have initialization and other preferences at the top.
Ah, that narrows it down to line 106. I can’t find any other Hubitat examples that use app() to install a child app right now. I’ll look a little more but that at least narrows down where it’s happening.
Well it looks like Hubitat doesn’t support something with the logic of the app being either the parent or child. Either the dynamic name or parent parameter isn’t working. I made a copy of the app and changed the definition section to this:
name: "KuKu Harmony Device",
description: "This is a SmartApp that support to control Harmony's device!",
parent: "turlvo:KuKu Harmony",
Hm I just tested again and had no errors. Did you make a copy of the code, start a new app, paste the code and modify the definition section and parentOrChildPage method then save? In the end there should be two apps in the Apps Code: “KuKu Harmony” and “KuKu Harmony Device”