MM10
(Michael)
October 3, 2018, 2:27pm
1
Hello,
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:
Strategies {
JedeMinute: "0 * * * * ?"
}
Items {
eg_bz_temperatur: strategy = JedeMinute, restoreOnStartup
}
The mysql.cfg
url=jdbc:mysql://localhost:3306/OpenHAB
user=openhab
password=openhab
waitTimeout=100
localtime=true
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?
Thanky you!
Michael
peaeater
(Gerstl)
October 3, 2018, 7:44pm
2
Can you show your items definition file?
There should be a group definition
And an Item definition using that group like
Group eg_bz_temperatur
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.
rossko57
(Rossko57)
October 3, 2018, 9:18pm
4
I seem to recall something about having a default strategy defined in xxx.persist, even if you don’t use it?
1 Like
peaeater
(Gerstl)
October 4, 2018, 11:04am
5
Did you specify in paperUI the service you will use by default?
I have the following definitions:
Itemfile:
//General groups
Group Temperature
Group gHeizung
Number HzgAussenTemp "Aussentemperatur Heizung [%.1f °C]" <temperature> (Temperature, gHeizung)
Persistence File
Strategies {
everyMinute : "0 * * * * ?"
every5Minutes : "*/5 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
}
Items {
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.
MM10
(Michael)
October 4, 2018, 12:56pm
6
Hello,
now I have added the “default strategy” and now it works with MySQL!
Thank you!