Help How Can I Store Tempreture Sensors Data

Hi Guys ,
Im a beginner , i have project for temperature Sensors (5 Sensors) . I want to store like every temperature for every sensor , i use MySQL for databases . The problem is , I tried to add a chart for each sensor and failed to do that. How can i modify the file “mysql.persist” to stock each data in a different database ? How can I show the chart in the same frame as the temperature ?
Here is the code for the sitemap :
sitemap home label=“Reseau Des Capteurs”
Frame label=“Liste des noeuds”{
Group item=Temperature_Sensor1

	Group item=Temperature_Sensor2

	Group item=Temperature_Sensor3
	Group item=Temperature_Sensor4	

	Group item=Temperature_Sensor5


Here is the code for the items;

/declaration menu 1/
Group Temperature_Sensor1 “Noeud 1”
Group Temperature_Sensor2 “Noeud 2”
Group Temperature_Sensor3 “Noeud 3”
Group Temperature_Sensor4 “Noeud 4”
Group Temperature_Sensor5 “Noeud 5”

/declaration menu 2/
Group TS1 “Capteur 1” (Temperature_Sensor1)
Group TS2 “Capteur 2” (Temperature_Sensor2)
Group TS3 “Capteur 3” (Temperature_Sensor3)
Group TS4 “Capteur 4” (Temperature_Sensor4)
Group TS5 “Capteur 5” (Temperature_Sensor5)

/Declaration items Temperature(Number) et Graphe(Chart)********/

Number Node1 “Temperature capteur 1 [%.1f °C]” (TS1) {mqtt="<[mymosquitto:local/sensor/1:state:default]"} /Topic : local/sensor/1/
Chart item=Node1 period=h refresh=100 (TS1)


Number Node2 “Temperature capteur 2 [%.1f °C]” (TS2) {mqtt="<[mymosquitto:local/sensor/2:state:default]"} /Topic : local/sensor/2/
/Chart item=Node2 period=4h refresh=100 (Temperature_Sensor2)/


Number Node3 “Temperature capteur 3 [%.1f °C]” (TS3) {mqtt="<[mymosquitto:local/sensor/3:state:default]"} /Topic : local/sensor/3/
/Chart item=Node3 period=4h refresh=10 (Temperature_Sensor3)/


Number Node4 “Temperature capteur 4 [%.1f °C]” (TS4) {mqtt="<[mymosquitto:local/sensor/4:state:default]"} /Topic : local/sensor/4/
/Chart item=Node4 period=4h refresh=10000 (Temperature_Sensor4)/


Number Node5 “Temperature capteur 5 [%.1f °C]” (TS5) {mqtt="<[mymosquitto:local/sensor/5:state:default]"} /Topic : local/sensor/5/
/Chart item=Node5 period=4h refresh=10000 (Temperature_Sensor5)/

Here is the mysqlpersist file :

Strategies {
default = everyChange

Items {
* : strategy = default, restoreOnStartup

Thanks ! :slight_smile:

Your Persistence setup is fine as is. But I have not idea what you are doing with your Items. It looks like you are trying to mix your Items and your sitemap.

Items and Groups are defined in a .items file. Charts are defined on a sitemap. Unless you configure a Group and persistence in a special way the values of a Group do not get persisted and therefore cannot be charted.

And a Group is intended to treat a bunch of Items as one thing but you have a one-to-one mapping between Items and Groups which makes no sense.

So I first recommend just dropping the Groups for now. Get rid of the Charts from your .items file. Define your Number Items in a .items file. Put your charts and Items in the sitemap file.

For reference please see the Sitemap Wiki Page, Items Wiki Page, and Charting Wiki Page. Also review the demo to see examples of how all of these things work.

Thank you very much Rich I will try to change the .items .sitemap and i will have a try thanks again. appreciated