This persistence service supports writing information to MySQL relational database systems, as well as querying from them.
So in theory I thought the PUT request would work.
a. Is there something wrong with openhab config or persistence service?
or
b. Should I not be using the rest API to write historic data?
or
c. Is there a different persistence service I should be using, that supports PUT over the rest api?
Means what it says.
All the persistence services offered by openHAB are about recording instantaneous states of OH Items. No ad-hoc inserts, no arbitrary timestamps.
You can of course do any ad-hoc stuff you like outside of the openHAB framework.
In addition… you could use some persistence backends to add historic data, e.g. use a SQL statement to add those data directly into the correct table. Of course this is not intended, but if the data is setup correctly, openHAB will never notice that it didn’t write the data itself.
a separate logger which sends all logged data once a day
Now I want to use this data in openHAB …
My first Idea was the persistence api, but I got the same error. It seems that Udo is right, there ist no persistence service that allows modification of item values in the past.
Here is my workarround:
Add the corresponding items to the persistence service with strategy = restoreOnStartup
Write the external data directly to the database (in my case a MariaDB)
-> openHAB charts will use the data automaticly, but the states of the items will not update …
Use the rest API to update the state of the Item with the last value from my external data
It is not nice, a “restore” method for the Items woud be better. Now I have charts and a value in my item (of course only from the last day, but that does not matter for me).