How to transfer data present in openhab to private server

Hi, I am new to openhab,

I am having few sensors (example: temperature, humidity, etc) this will send data to openhab through MQTT broker, as I have subscribed in openhab.

I want to upload the received Data in openhab to our own private server, which doesn’t support MQTT, How can I upload this data to any private server? is there any particular binding to upload? or else How can we configure?

Well, what does it support?

1 Like

@rossko57 it will support “push”

You are asking how to get data from one server to another. this has nothing to do with openHAB & the topic of this forum.

I have personally used rclone to transfer data from a server to a Dropbox cloud.

@Bruce_Osborne I want to upload data from openhab to our private server

OpenHAB by default does not provide that capability but the data resides on the server for other programs to access.

@Bruce_Osborne What I need to do now?

Do we need to do any configurations for it in openhab

Just guessing :
If you want to send your persistence data to another server, you need a smb share on your openHAB server accessible from the other side. Then you have to setup some kind of cron job on your private server to get the persistence data.

So this is all on OS side, nothing within openHAB.

Since you are using am MQTT broker, you likely want somwthinf supporting MQTT to forward the data. Again, this is outside of openHAB. Many of us here do not use MQTT. Perhaps a generic Smart home forum could assist.

As @inayathraza23 is new: there are also many of us who do!

Maybe you can expand on this.

When? You want to forward each piece of data as it it arrives in openHAB? Or are you planning on sending bulk data for a period of time?
That influences the “how?” part. If this is a bulk thing, who will initiate the transfer, openHAB or remote server?
If it’s bulk, how will you build that bulk data? Write a file? Or use OH persistence and recover the data when needed?

1 Like

@rossko57 I want to forward each piece of data as it arrives in openHAB?
it’s a very small amount of data and frequency is also very less.

Here the thing is I don’t know how to transfer Data, Only thing I know is we have a private server that supports push, whenever we receive data in opnehab from MQTT device I just want to push this data to our own private server.

So can you please guide me how can I do this?

This is out of openHABs scope. You don’t tell us how the “push” is accepted from your private server.
Is ist a Webservice endpoint or what “push” methods are allowed.

So before asking us to define your solution, please give us more insight about the supported services or protocols of your private server.

I gues noone can give you explicit answers on this unless you can tell us the simple “w”-questions! :wink:

  • who needs the data?
  • why do you need the data?
  • which format does the data need to be: database, textfile, …
  • when do you need the data: on each creation, all updates “en bloc” every day
  • what do you want to do with the data after it receives “our private server”?

as told here: it has nothing to do with openHAB installation or configuration as is, but OH is capable of exporting data basically in whatever format you like. But to help you, we need the context of your use case - everything else is just speculation.

3 Likes

That part is very easy

rule "forward data"
when
   Item myMQTTItem received update
then
   var myData = myMQTTItem.state
   // now do whatever it is you need to do
   // to "push" myData to server
end

I think you might want an example of what a “push” looks like from your mystery private server operators.

Hi,

Now I want to save the data received in openhab as database

I am sending sensor data to openhab, I have subscribed in openhab to receive data

I want to save this subscribed data in any database

how to configure it?

It’s called persistance, and you can use a bunch of different services.

If you’re completely new to openHAB, please start here with reading the basic concept and first steps:

.

1 Like

Hi,

I have subscribed to topic “temperature” where I receive continuous temperature data, whenever data is received, I want to publish received data to another topic.

how to write rules for it

You can publish from openHAB via MQTT using the Action which comes with the MQTT binding - see the documentation for more information.

Show us your rule and we can help debug.

rule “MQTTRule”
when
Item mqtt_topic_sensorthingid_temperature_channeld changed
then
val mqttActions = getActions(“mqtt”, “mqtt:broker:brokerthingid”)
mqttActions.publishMQTT(“server”,mqtt_topic_sensorthingid_temperature_channeld.state.toString,false)
end

Thanks this one worked