What to use persistence or binding

Hello,

I have a big data platform where I want to store all the sensor and actuator data from openHAB. But I don’t know what the best way is to do this…

Should I write a binding that listens to the eventbus of openHAB and receives every update and push it to the big data platform… Or should I write a persistence? i can’t find much information about writing my own persistence so thats why i’m asking this question.

Or maybe should I write another program that collects all the data using the REST API…?

I hope someone can give me some information about what the best way is to accomplish this

Kind regards,
Rick

If you are able to connect your devices/sensors to OPENHAB you can use one of the persistence services (for example rrd4j) to store your data. No need to write a binding or persistence.

I have all my devices connected to openHAB but I have an external data platform where I want to store the data that openHAB receives from all those devices. The platform that I use is a custom builded big data platform so I think I can’t use one of the existing persistence services… It’s not just an MySQL database or something.

So my question is: how can I push all the data that openHAB receives/collects to an external program.

In this case I would look into the existing persistence service and adapt that to a new persdistance.

One might ask why you are not using one of the standard big data storage. OH has built in support for InfluxDB and MongoDB and any database that has a JDBC interface.

There is an Exec persistence add-on that will let you execute a shell command or script to persist the data, though I expect that will be super slow.

You can write a service to poll the DB that OH writes to and exports the data to your external platform.

There is the MQTT Persistence which will publish the data to MQTT topics (not compatible with the new 2.x MQTT binding).

1 Like

What database is in the backend of your custom solution?