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.
Yeah. Iāve added debug lines and can see where the code is stoping, but I canāt find anything wrong with it. I was hoping to have a way to enable standard error or some crap like that.
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",
namespace: "turlvo",
author: "KuKu",
description: "This is a SmartApp that support to control Harmony's device!",
category: "Convenience",
parent: "turlvo:KuKu Harmony",
singleInstance: true,
iconUrl: "https://cdn.rawgit.com/turlvo/KuKuHarmony/master/images/icon/KuKu_Harmony_Icon_1x.png",
iconX2Url: "https://cdn.rawgit.com/turlvo/KuKuHarmony/master/images/icon/KuKu_Harmony_Icon_2x.png",
iconX3Url: "https://cdn.rawgit.com/turlvo/KuKuHarmony/master/images/icon/KuKu_Harmony_Icon_3x.png")
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ā
Awesome! Yeah it can be cleaned up a bit if itās being separated out into two apps. Itās interesting the name definition could be dynamic in ST so the same code could act as the parent or the child.
I saw this error when I first installed. The drivers we're named differently so when it was called it as never found. I think it was the turvlo name needed to be changed to keo?