Problem with read data from my MySQL DB

Hi all
I have a problem to read data from my DB.
I have installed add-ons for Mysql and persistence service, but I don’t be able to read data from mydb.
With my C programming script, I store temperature value on my DB.
Now I want to read this value with openHab, so I can see it from my mobile app

Could you help me? can I read by openhab data stored on my personal MySQL DB?

Thanks a lot and Marry Christmas

No you can’t

The persistence service is to store and retrieve items states only.

With your C script, you could send the data to openHAB via the REST api or MQTT and the openHAB would store it with the persistence service

Thanks a lot
If I send data by MQTT (MQTTT will take data from my MySQL db), in this case, can I only show the data on openhab, without stored it?


Yes but only the latest value will be shown.

I need only the latest value.
So, I must create a client MQTT that keep the latest value from my DB and after send it to openhab via REST api? Correct?

No, from your c script you can send the value to openHAB.
You have several options to send the value.
REST API or MQTT are only the two most common

Which do you suggest for easy developement?

Thanks very much

I don’t know c, sorry
Python should be relatively easy. I can send HTTP request and MQTT messages but I have no experience of database access

Google will be your friend

Now I try to send MQTT message to openhab, and after take this message with REST.
If I send MQTT in real time to openhab, I don’t need to save data on my DB, because with MQTT I take the vale from DB stored a few time before.

Do you think that is this a correct way?

Thanks a lot