I want to install a mysql database and write all value from the sensors in this database.
So I have running step-by-step this instructions: openHAB2 & MySQL persistence setup
But no values are stored in the database.
The mysql.persist is:
JedeMinute: "0 * * * * ?"
eg_bz_temperatur: strategy = JedeMinute, restoreOnStartup
MySQL DB is running. I can connect and I see a table named “Items”, but this table is empty.
Does anyone have an idea of what the mistake is?
Can you show your items definition file?
There should be a group definition
And an Item definition using that group like
Number EG_Temperatur "Erdgeschosstemperatur [%.1f °C]" <temperature> (eg_bz_temperatur)
All item which are members of the group will then be stored in the database.
I seem to recall something about having a default strategy defined in xxx.persist, even if you don’t use it?
Did you specify in paperUI the service you will use by default?
I have the following definitions:
Number HzgAussenTemp "Aussentemperatur Heizung [%.1f °C]" <temperature> (Temperature, gHeizung)
everyMinute : "0 * * * * ?"
every5Minutes : "*/5 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
Temperature* : strategy = everyChange, every5Minutes
I am not sure if the persistence works with an item directly, so you should try it using a group.
I am using influxdb as database, which seems to me a better choice.
now I have added the “default strategy” and now it works with MySQL!