Persistence of sensors only, not everything. (MySql)

With the following items:
Group g_gf_cupboard1
Group g_br_master
Group g_ups
Group g_temperature
Group g_humidity
Group g_chart

/* Indoor Temperatures */
/* Cupboard */
Number   gf_cupboard1_temperature  "Temperature [%.1f °C]" <temperature>   (g_gf_cupboard1,g_gf_cupboard1_temperature,g_temperature) {mqtt="<[mosquitto:cupboard/temperature1:state:default]"}
Number   gf_cupboard1_humidity  "Humidity [%.1f%%]" <humidity>   (g_gf_cupboard1,g_humidity,g_gf_cupboard1_humidity) {mqtt="<[mosquitto:cupboard/humidity1:state:default]"}
DateTime gf_cupboard1_lastupdate "Last Update [%1$td/%1$tm %1$tH:%1$tM]" (g_gf_cupboard1)

/* Master Bedroom */
Number   br_master_temperature  "Temperature [%.1f °C]" <temperature>   (g_br_master,g_br_master_temperature,g_temperature) {mqtt="<[mosquitto:2fmaster/temperature:state:default]"}
Number   br_master_humidity  "Humidity [%.1f%%]" <humidity>   (g_br_master,g_humidity,g_br_master_humidity) {mqtt="<[mosquitto:2fmaster/humidity:state:default]"}
DateTime br_master_lastupdate " Last Update [%1$td/%1$tm %1$tH:%1$tM]" (g_br_master)

Group g_gf_cupboard1_temperature
Number gf_cupboard1_temperature_max         "Todays Maximum [%.1f °C]"      <temperature> (g_gf_cupboard1)
Number gf_cupboard1_temperature_min         "Todays Minimum [%.1f °C]"      <temperature> (g_gf_cupboard1)
Number gf_cupboard1_temperature_chart_period         "Chart Period"  (g_gf_cupboard1,g_chart)

Group g_br_master_temperature
Number br_master_temperature_max         "Todays Maximum [%.1f °C]"      <temperature> (g_br_master,g_br_master_temperature)
Number br_master_temperature_min         "Todays Minimum [%.1f °C]"      <temperature> (g_br_master,g_br_master_temperature)
Number br_master_temperature_chart_period         "Chart Period" (g_br_master,g_chart)

Group g_gf_cupboard1_humidity
Number gf_cupboard1_humidity_max         "Todays Maximum [%.1f%%]"      <humidity> (g_gf_cupboard1,g_gf_cupboard1_humidity)
Number gf_cupboard1_humidity_min         "Todays Minimum [%.1f%%]"      <humidity> (g_gf_cupboard1,g_gf_cupboard1_humidity)
Number gf_cupboard1_humidity_chart_period         "Chart Period" (g_gf_cupboard1,g_chart)

Group g_br_master_humidity
Number br_master_humidity_max         "Todays Maximum [%.1f%%]"      <humidity> (g_br_master,g_br_master_humidity)
Number br_master_humidity_min         "Todays Minimum [%.1f%%]"      <humidity> (g_br_master,g_br_master_humidity)
Number br_master_humidity_chart_period         "Chart Period" (g_br_master,g_chart)

I’m wanting to persist only the gf_cupboard1_temperature, gf_cupboard1_humidity, br_master_temperature and br_master_humidity.

Based on the groups (and how I thought groups worked, I’d put both the temp sensors in g_temperature and both the humidity sensors in g_humidity).

With this persist file for mysql:
Strategies {
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange


Items {
        //* : strategy = everyChange, restoreOnStartup

        // next we define specific strategies of everyHour for anything
        //in the Temperature group, and and every minute for Humidity
        g_temperature : strategy = everyChange
        g_humidity    : strategy = everyChange
        g_ups         : strategy = everyHour
        //g_chart            : strategy = restoreOnStartup

Shouldn’t it only persist those sensors I wanted and not everything else? Basically I don’t care about keeping the max and min, nor (at the moment) the chart switch.

Also a follow on, I’ve renamed a bunch of my sensors my so mqsql server is a bit of a mess, how can I clean it up.

You need to add a “*” after the group name in your persist file.

g_temperature* : strategy = everyChange
g_humidity* : strategy = everyChange
g_ups* : strategy = everyChange

As written it will only save the state of the Group itself which will be a rolled up value based on the members.

Written like this is should only persist those members of these three groups.

However, it might create a table for all of your Items and just not persist any data in them.

So this is one of the aspects I find frustrating.

So without saying persists everything all the time, how can you group sensors together etc for persisting those?

Or a naming standard where I can say temp* or would *_temp_sensor take any items with _temp_sensor as a name?

I don’t understand your frustration. If you persist g-temperature* only members of that group get persisted. Nothing else does.

That’s what you are asking for.

I guess it was this comment:
However, it might create a table for all of your Items and just not persist any data in them.

With changing the persist to g_temperature*

But yes, you were correct. Changing persist as you noted did save the output or each of the members of that group.