Msql binding - read data from outside database in Openhab

Hello im new :slight_smile:

Im looking solution for how too read data from outside msql database and show it by item in openhab ?
I found binding ACSQLServer https://github.com/kaz260/org.openhab.binding.ACSQLServer but it dosent work driver is missing inside and i dont now how tu prepare new one with driver can somebady hel me or meybe its other simple solution to get data from outside database ?

Best Regards Luke

openHAB cannot “read” data from an outside source, unless it’s its own (see persistance) :wink:

You’d have to either write a script within openHAB, that automatically updates your items, or you use an “outside” script, which uses either MQTT or the REST API to update items.

Thanks for quick reply ,meybe in future devs can add this fuctionality in new version Openhab

Can you make me some examle how to do this on script and MQTT ? I dont have eqperience with this.

Best Regards Luke

Hi Luke,
openHAB(3) aims to include more of the not so experienced users. For importing information into openHAB exist too many different use cases, which differ individually. Using clear described hardware and import their information, there’s AddOns called “bindings”; you can use the functionality of those natively within openHAB.

Importing “random” structured information from a database is so clustered, you won’t find a way to get an abstract way to import those.

We can’t help you, unless you give us a bit more context:

  • What kind of information do you store inside the database
  • What is your purpose of having some information inside openHAB
  • How is your database filled
  • do you know some kind of script language (like PHP, python, …)

perhaps we can work something out after that.

I’ve always wondered why OH doesn’t have a database layer that provides database services to the higher level features (rules, scripts, bindings, persistence).

If that existed, it would be easy to write something to query just about anything from any database.

1 Like