Using webCoRE with Hubitat

Out of my depth here but the log pointed me to line 1135 of WebCoRE Piston where I changed runIn(t, timeHandler, [data: next]) to runIn(toInteger(t), timeHandler, [data: next])

The piston never appeared to do anything, but something actually got scheduled for the appropriate time, and the error message got quite a bit shorter, to wit:

An error has occurred while subscribing: groovy.lang.MissingMethodException: No signature of method: app15196121587141013158970.toInteger() is applicable for argument types: (java.math.BigDecimal) values: [13.747]

The resulting log showed:

2018-02-25 21:33:46.264:info╔ Piston successfully started (426ms)

app:2692018-02-25 21:33:46.262:error║ An error has occurred while subscribing:

app:2692018-02-25 21:33:46.255:info║ Setting up scheduled job for Sun, Feb 25 2018 @ 9:34:00 PM EST (in 13.747s)

This time no line number was logged and I see no other places in the code where this change could apply. Edit: changing piston trigger time conditions from ‘at’ to specify a condition including ‘between two times’ executes but still throws the error and gives the line number of the modified line.

I have no idea if it is possible or not. The SmartThings documentation still shows it as a BETA product.

From looking through the Piston App, it seems to be used minimally. For something called Fuel Stream ( I have no clue what that is, but it sounds optional to me) and one more routine called vcmd_storeMedia(). It is also used in the main webCoRE app for LIFX bulbs and some sort of registration call. You may want to look back through old revisions to see if there was a different, albeit less optimal, way of accomplishing these same calls prior to the asychHTTP_v1 API being available.

I have noticed that webCoRE cannot seem to delete Pistons properly. You have to manually delete those child apps.

1 Like

Fuel Stream is a plotter/grapher. ie: Tell it to add your thermostat temp or energy temp to fuel stream and it will plot it on a graph.

Edit, adding graph example:

2 Likes

I can't seem to delete any piston on the Hubitat side? How do you delete pistons manually? Thanks.

Pistons can’t be paused from the dashboard, either. When you try, the dashboard shows ‘paused’ (until the next time you reload it) but they continue to run and this gets logged:

:errorNo signature of method: com.hubitat.hub.executor.AppExecutor.sleep() is applicable for argument types: (null) values: [null] Possible solutions: sleep(long), sleep(long, groovy.lang.Closure), grep(), grep(java.lang.Object), every(), dump() on line 1248

You should see them listed under the webCoRE app when you view your Hubitat Apps. You click on the one you want and there will be a red ‘Remove’ button.

1 Like

I see them there. When I select them and open them, then select the red ‘Delete’ button it appears to work (no errors presented), but then they still show on the list?

I also have some ‘Paused’ pistons and I cannot ‘Resume’ them either. I click the ‘Resume’ button and they still show under the ‘Paused’ category.

I’m seeing a few inconsistencies here as well; for example I had two pistons listed in Apps; one of them when selected would show a ‘Remove’ button; the other one didn’t. To remove the one that did not show the button, it was necessary to click on the blue ‘i’ circle next to it in the apps list, then it showed a screen with a remove button on the bottom. Can you try that method to delete it?

I haven’t figured what’s going on with Pause. When you select Pause, an error is generated in the log so something is not working correctly there.

I was able to delete the pistons by using the blue ‘i’ circle then giong to the bottom and clicking the ‘Remove App’ button.

1 Like

Anyone try to get the old Core SmartApp working on Hubitat? Not sure if that is worth it if Webcore is possible. Once someone gets a working version, it would be great if you could post your app code.

I tried to get CoRE running on Hubitat without much success thus far. That is a HUGE SmartApp at over 10,000 lines of code. It takes a very long time to save CoRE as an App on Hubitat. Afterwards, if I try to edit and save it, it seems to never be able to save it again successfully. So, I am not too confident in being able to get it running, since debugging it is very painful. I have to keep the code in a text file on my PC, make changes, copy and paste into Hubitat, save it, then enable OAUTH, then install a copy of it, try to get it running and hit another issue, delete everything and start over. This debug cycle takes far too long for my patience. I’ll just keep on using Rule Machine! :slight_smile:

Understood, thanks for analyzing the code.
BTW, I do see asychHTTP_v1 used a bit more in the Dashboard app too.
That app seems keep throwing errors about the asychHTTP_v1.put() command on line 151 not being available, in the logs. I am unclear on whether this error is detrimentally affecting any activity though.

Overall, based on the last few comments, my pistons do seem to work fine, especially after the runIn() related fix from Mike. They even run locally without internet. However, the general reliability and response time of the pistons seem to be unpredictable compared to Rule Machine :frowning_face:
I wish this would also get officially supported somehow (there are already mentions of *.hubitat.com in the access policy related code in webCoRE).

Is there some kind of a wiki for Rule Machine that I can use to learn more about porting my logic from webCoRE?

Are you able to get piston to trigger at a specific time? Am I missing some fix that you referred to? Any piston using a time trigger (as opposed to a time condition) doesn’t execute for me.

Yes, I am. Time based triggers have worked well for me until now.
I have multiple pistons which run based on day-night and some which even run at sunset. None have exhibited any issues.

These started working after following Milke’s advice from this linked post… https://community.hubitat.com/t/using-webcore-with-hubitat/632/15?u=ajayjohnm
I made those changes in all for webCoRE components.

Sorry if I’m being obtuse, but I only found runin() was used in WebCoRe Piston code (line 1135, which I changed as described in my reply to Mike’s post; also one other instance but it was using an integer constant.) I can’t find any use of it in WebCoRe, or the Dashboard or Storage components. What am I missing?

Hey, does anyone know how webcore accesses custom commands for devices? I’m hoping to have Advanced Button Controller add in custom device commands (specifically setEffect for Nanoleaf Aurora) so I can link them to a caseta nano remote’s up and down buttons.

ST has a getCommands() function call.

I tried the getCommands but it only returns the built in commands associated with capabilities. I can’t seem to get any custom commands within a DTH.

Hrm. I can access the custom commands though rule machine, so clearly they’re available for access somehow.