Hi, i’ve a problem with my 1.7.1 openhab runtime. I am using the 1.7.1 mysql persistence service but it is only storing Numbers. No Switches, no Contacts, no Rollershutters although they are included in some groups that I configured the persistence for.
I tried to drop my complete database including the user and recreated a new database with
CREATE DATABASE openhab CHARACTER SET utf8 COLLATE utf8_unicode_ci;
I also granted all privileges to the user just to make sure everything works:
GRANT ALL PRIVILEGES ON openhab.* TO openhab@127.0.0.1;
But the problem persists
Only items of type Number are being stored.
Is the mysql persistence service only capable of storing numbers or am I missing something?
This is my configuration (nothing special I think):
Now I tried the new JDBC Persistence Service from the current snapshot with a clean new MySQL database.
What should I say? I face the same problem again: only numbers are being stored although I have switches and contacts configure via my jdbc.persist file (former mysql.persist).
For example:
I solved the problem.
It came out that I simply forgot to explicitly define the group gRestore in my items file. Unfortunately my configuration of groups and persistence settings lead to the fact that only numbers got stored. But just because I only configured number items into the groups that I previously defined.
That feature request on GitHub would have saved me a lot of time: https://github.com/openhab/openhab/issues/2515
So you mean you are able to store ALL item types in JDBC mysql?
I currently use:
mapdb for ALL items (just the last state as far as I remember
jdbc-h2 for switches and Strings
rrd4j for numbers
Actually I would like to see all of them beeing stored in mySQL (including historic data for charts).
Is this working reliably in your case?
Yes everything is working fine now with jdbc/mysql.
Although I also use mapdb to persist the last state of the items I only need to restore after startup.
I switched over to jdbc mySQL as well and it seems ok so far (too early to judge, though).
However, why do you still use mapdb, where you have restoreOnStartup capabilities in your persistence file for the mySQL as well.
(just out of curiosity)