Patched webCoRE for Hubitat (2018/09/09)

Hot fix 1.1.3.116 has been released and is reported to fix webcore

I was hoping to somehow get more focus on porting webCoRE for Hubitat and identifying the Hubitat variants of some of the incompatible SmartThings functions in the code. So I have started this thread to serve as a single source for following purposes...

  1. Collating all the current code changes needed to get webCoRE working on Hubitat.
  2. Collating the various errors faced by users at the moment, to attract suggestions on how to fix them.
  3. Maintaining a single Git with the latest confirmed Hubitat fixes which can keep up with the main ST webCoRE development.

Update (20180727): Due to various personal commitments eating up my time, I would no longer be monitoring this thread. However, as mentioned in this post, users like @jp0550 have been doing a far better job of keeping this project active than I could have ever imagined. So I have updated this post with his repository links. I hope we eventually end up getting Hubitat officially supported by webCoRE.

Update (20180820): I spoke with the staff about taking ownership of this thread from @ajayjohnm so I can keep it updated with the latest info. A big thanks to him for starting this thread and gathering attention to getting webcore working!

Update (20180909) The github links have been updated with the latest changes from @ipaterson for restoring backups in Hubitat and ST from a file.

======================================================================================

Ready-to-use Git repository with all the above changes

======================================================================================

Guide: Run the webCoRE UI locally on a RPi/Linux Web Server

Guide: Run the webCoRE UI locally on any machine using Docker

.

Note

  • Of course, it goes without saying that all credits for this brilliant tool go to Adrian and his team. Any feedback or requests for webCoRE can be posted on the https://community.webcore.co/ forums.
  • All credits for starting a Git to track these changes go to Daniel (@ogiewon).
12 Likes

Ever since I updated the code from your Repo, I get this error in the log and can’t get my dashboard.

[app:423] 2018-03-26 09:42:27.526: errorDashboard: Authentication failed due to an invalid token

I’ve tried to register the browser and everything, but its not working.

That’s odd. I do not have this issue.
No patches had anything to do with authentication/tokens either.

When on the https://dashboard.webcore.co page, could you try a hard refresh and attempt to register the instance again? This will wipe all site data and let you start afresh.
i.e. For Chrome browser, Hold down Ctrl and click the Reload button.

Also, please validate if you still have Oauth enabled for the webCoRE main app.

Well something went bad… I restored my hub from yesterdays backup and everything is working again.

Glad to know that!
Some googling landed me on this thread. Maybe it would help someone else.

I upgraded yesterday without issue. Made another 6 pistons this morning. Thank @ajayjohnm!

1 Like

Thanks @ajayjohnm. I couldn’t get into my dashboard, but with the latest code I’m able to bring it up.

1 Like

so I assume there is something else in webCoRE that needs to be updated but I can’t figure out where. I just updated the Hue Dimmer Driver from ST to work on Hubitat. Interestingly enough, I could control my hue bulbs with the dimmer switch in web core before I updated the driver but after I changed the driver webCoRE no longer controls it.

I don’t believe its a driver issue because the button controller app can control it just fine.

Any advice where I can begin looking in the webCoRE code to debug this?

Your problem likely lies with how button events are handled in Hubitat. If the device driver has been updated to work with HE apps, then webcore will definitely need to be changed to compensate.

Please keep in mind that I haven’t attempted to use webcore because I only need it for my complicated pistons that I won’t need till the holidays. Webcore is a beast of an app and any change can have cascading effects.

That said, I did a VERY quick scan of the repo and there are 1 place that likely can be tweaked.

Line 2464 in the webcore.groovy file…where it says
: [ n: “button”,

Change “button” to "PushableButton"
There are probably other changes needed but that the most blatant one I could find.

Good catch @stephack. Wouldn’t a: "button" on line 2388 (not n: and d:, only the a: part) need to be updated the same way too?

@Keo If you don’t mind, could you please test and report with Stephan’s suggestion?
If it fixes your problem then I will update the code and publish it.

Yes I think you’re right…hard to review on my phone. You will probably need to change i: as well but I’m not sure to what…maybe “i:value”

I won’t be able to test it until I get my kids to bed tonight. But I will let you know ASAP.

no. Still not working.

hmmm… it’s not working in Rule Machine either, but it works in ABC and the stock controller app.

I will try to take a deeper look at the webcore code sometime tomorrow and let you know if I see anything else.

1 Like

Never mind this one. It does work in Rule Machine. I forgot to turn the bulb on before I set the dimmer and color.

I am seeing this error.

+237ms ║║Error reading current value for Hue Dimmer Button Controller Kitchen.button:

So I read through the webcore.groovy file and there will need to be a total restructure of how it handles button commands and capabilities. ST used attributes (pushed and held) and capability (button) and indexed which button on the controller with “data:buttonNumber”. Hubitat works in a very different way and does not index the button instead passes the button # in the value.

Long story short, I think it would require restructuring and/or adding entries in 3 different areas (All 3 will require changes for sure).
Capabilities (starts at line 2372)
Attributes (starts at line 2455)
Commands (starts at line 2554)

This will require testing quite a few things to get an understanding of how it affects everything else. Unfortunately I do not plan to work with webCore just yet. I need to focus my limited time with getting all my devices ported over and the basic automations going for the WAF. I may give a whirl sooner rather than later but definitely not this week. Hopefully someone more skilled than I am takes this up for you.

Stephan

4 Likes