Best way to acces database?

I see a lot of negative dialog about webcore which seems like an interface (i haven't looked closer yet) - so what is the suggested method to access the DB? I want to explore writing my own web interface to the hub.

thanks!

Webcore was created by a community developer as an add-on for smartthings. It’s basically a web GUI front end for a groovy app that functions as a rules engine. Before it had a web GUI, it was just a smartapp within the smartthings mobile app (and it was just called CoRE, which was an acronym for community’s own rules engine).

Smartthings never had a native rules engine, which I found to be annoying, as did many other people. @bravenel made the rule engine called Rule Machine before core existed. He removed it from circulation among the smartthings community for reasons you can read about in the ST forum if you really want to read up on the history.

I liked Rule Machine, and I also tried out webcore. As a non-developer, the graphical front end of webcore was somewhat easier for me to use, but in both cases I’m pretty bad at this rule logic stuff, TBH.

Since hubitat is based on smartthings in many ways, apps written in groovy for the smartthings platform can usually be ported over to hubitat. This is true for webcore, but webcore is a far more complex app than most, and my understanding is that since the hubitat hub was not developed to run an app like webcore, it tended to cause some major instability in the hubs of people who decided to use it. That’s referring to just the groovy app code, BTW. The web server front end has to be run on a local server or in the cloud (the same way webcore ran in the ST world).

I’ve heard that level of instability may not be happening anymore as other developers have further tweaked the code to make it play more nicely with hubitat. I have no idea if that’s true though, because, frankly, it makes more sense to use Rule Machine because the hubitat platform was designed around it and it has continued to improve by leaps and bounds with every hub update.

3 Likes

WebCoRE does not access the database. The only way to access the database is through the gui. WebCoRE has just used a VERY complicated way to do that. But the pistons that webcore creates are in Groovy like all the other apps on Hubitat and show up on your app page just like all other apps. You just can't edit them natively on Hubitat. But the way the code works with the hub is the same for webcore as it is for you or me.

2 Likes

As noted, WebCoRE is ultimately just an app, albeit one with a UI that mostly exists outside Hubitat. There's nothing stopping you from creating the same. If your goal is to make an app, even one like Rule Machine or webCoRE, you don't need direct access to the database: what you want is already possible with an app (and possibly driver if needed). Hubitat Dashboard is one example of how an app can more or less display arbitrary content (so was SmartTiles if you were on SmartThings at the time). I'm not saying it's easy, which is why most apps (including Rule Machine) use the standard UI elements the app model provides.

Staff have indicated they may rework this to make it easier to create better app UIs in the future, though no word on when or exactly how. But if that's your concern, they are aware of the existing constraints (and in their defense, they didn't really create this model).

1 Like

I am really pleased with the quality of answers I've been getting! thank you gentlemen, one and all. While not what I wanted to hear, it is extremely helpful!

1 Like

If you're looking for a way to build a graphical user interface on your own, you may want to take a look at HousePanel...

If you're really just trying to create a RESTful API to access data from Hubitat, you may want to take a look at Hubitat's built-in MAKER API app. If you only want to collect data, and not change anything, Hubitat unofficially supports an Events webSocket.

Lots of possibilities... Just need to understand your requirements a little more and the community will be glad to help.

2 Likes

I think he was looking more from a perspective of implementing apps and drivers than a dashboard.

HousePanel includes a rich API in addition to the dashboard so it might be useful for either use case.

You can't use anything but the native gui to access the database. Hubitat doesn't allow for any other way to access the database. House Panel is great but it can't do that.

Well, it depends what the OP means by "database"...:thinking: If he simply wants to query the status of devices, then the Maker API provides that already via a RESTful API. So, in effect, he can query the database, as it contains the current status of all of the devices.

Hopefully @jshimota will answer some basic questions about his requirements. Without more details, we are all simply guessing... :wink:

I only assume this since he posted the fact that he was asking this question specifically in response to questions about custom vs. native apps.

That's the only reason I assume this....I was involved in the lead-in discussion. I'm not just pulling it out my butt. :wink:

1 Like

Thank you folks for your responses - I"ve got new work keeping me from my play time with the hubitat.
I"ve gleaned from a couple posts that I have a few items to look at - HousePanel and the Maker API. my small vision was to redesign the Hubitat website with a better look and feel that I could customize the way I like it. That would of course require I talk directly to the unit which I now know is not an option. Someone posted somewhere (i'm reading bulk posts right now due to workload) that it was - I forget the words - never done, or not common - yea. thats true but not in all cases and I had hopes :). I really dislike the dashboard, and wanted to create a phone app that actually works for my needs as well. Anyways. I'm backing off of Hubitat for now, and promise not to bother the community further!
Thank you all for your answers.
Jim

Thank you folks for your responses - I"ve got new work keeping me from my play time with the hubitat.

1 Like

This is 100% possible, as long as all you are trying to do is create a new “Dashboard” style of app. If you’re trying to redesign the Hub’s admin/config user interface, that is not possible.

In addition to Hubitat’s native Dashboard App, you can also use SharpTools, and HousePanel as ready to run device dashboard solutions. You could also completely “roll your own” dashboard tool. You could definitely write your own mobile phone app and access the Hubitat hub’s Device data via Hubitat’s Maker API, or your own custom OAuth2 App that would provide the data to your custom phone app.

The only thing you cannot easily do is replace the Hub’s Admin/Config web application.

3 Likes