[SOLVED] Openhab is persisting everything to influxdb uncontrollably

I am unable to convince OpenHab to not persist everything to influxdb.
My configs:

persistence\influxdb.persist

Strategies {
everyMinute : "0 * * * * ?"
everyHour   : "0 0 * * * ?"
everyDay    : "0 0 0 * * ?"
}
Items {
	Temperatures* : strategy = everyUpdate,
	PersistEveryUpdate* : strategy = everyUpdate
}

services\influxdb.cfg

# The database URL, e.g. http://127.0.0.1:8086 or https://127.0.0.1:8084 .
# Defaults to: http://127.0.0.1:8086
url=http://192.168.25.3:8086

# The name of the database user, e.g. openhab.
# Defaults to: openhab
user=openhab

# The password of the database user.
password=***************

# The name of the database, e.g. openhab.
# Defaults to: openhab
db=openhab

retentionPolicy=48h

Retention policy “48” is set to 2d
Default persistence is mapdb. (as it should be used only for RestoreOnStartup)

Every change of every item is being persisted… I want to persist only members of groups Temperatures and PersistEveryUpdate.

Any ideas what I am doing wrong? :thinking:

What do your items file/s look like? And have you done a platform restart since your change? Was it previously set to update everything?

Yop, restarted multiple times - its happening since I am using influxdb (~2 years).
There are few items (as i have quite a lot of them so this is only a small sample):

//System
Group RestoreOnStartup // restore on startup
Group PersistEveryUpdate

Group House

//floors
Group GroundFloor (House)
Group FirstFloor (House)
Group Garden (House)

//rooms
Group DaniksRoom "Danik's room" (FirstFloor)
Group MartinkasRoom "Martinka's room" (FirstFloor)
Group LivingRoom "Living room" (GroundFloor)

// Devices
Group Sensors (House)
Group Temperatures (Sensors)
Group Lights (House)
Group:Switch:OR(ON, OFF) Curtains (House)
Group Pumps (House)
Group MotionSensors (House)

//Daniks room items
Group:Contact:OR(OPEN, CLOSED) DaniksRoom_MotionSensors "Motion sensors [%d]" <motion> (DaniksRoom, MotionSensors)

Group:Color:MAX DaniksRoom_RgbLights "RGB Lights [%d]" <light> (DaniksRoom, Lights)
Group:Dimmer:AVG DaniksRoom_LightTemperatures "Lights temperature in Danik's room [%d]" <heating> (DaniksRoom)

Group:Dimmer:AVG DaniksRoom_Lights "Lights brightness [%d]" <light> (DaniksRoom, Lights)
Group:Dimmer:AVG DaniksRoom_CellingLights "Celling lights brightness [%d]" <light> (DaniksRoom, Lights)
Group:Dimmer:AVG DaniksRoom_FrontLights "Front lights brightness [%d]" <light> (DaniksRoom, Lights)

//Christmas
Group:Switch:OR(ON, OFF) Christmas_Lights "Christmas lights (ALL)" <light> (Lights)

//Martinkas room
Group:Switch:OR(ON, OFF) MartinkasRoom_Lights "Lights in Martinka's room [%d]" <light> (MartinkasRoom, Lights)
Group:Dimmer:AVG MartinkasRoom_DimmableLights "Dimmable Lights in Martinka's room [%d]" <light> (MartinkasRoom_Lights)
Group:Dimmer:AVG MartinkasRoom_BedLights__brightness "Bed lights [%d]" <light> (MartinkasRoom_DimmableLights)
Group:Dimmer:AVG MartinkasRoom_BedLights__colorTemperature "Bed lights - temperature" <heating>

//Living room
Group:Switch:OR(ON, OFF) LivingRoom_Lights "Lights in Living room [%d]" <light> (LivingRoom, Lights)
Group:Dimmer:AVG LivingRoom_DimmableLights "Dimmable Lights in Living room [%d]" <light> (LivingRoom_Lights)
Group:Dimmer:AVG LivingRoom_Lamp__brightness "Lamp [%d]" <light> (LivingRoom_DimmableLights)
Group:Dimmer:AVG LivingRoom_Lamp__colorTemperature "Lamp - temperature" <heating>
Group:Dimmer:AVG LivingRoom_SpotLights__brightness "Spot lights [%d]" <light> (LivingRoom_DimmableLights)

Number isDayTime "Is day time" <sun>
Dimmer outdoorLightTemperature

Switch curtain "Curtain" <blinds> (Curtains, DaniksRoom, RestoreOnStartup) ["Switchable"] {
	channel="mqtt:topic:arduino1:curtain"
}

// TEMPs
Number outsideTemp "Outside temperature [%.2f C°]" <temperature> (Outside, Temperatures) ["CurrentTemperature"] {
	channel="mqtt:topic:arduino1:outsideTemp",
	expire="10s"
}
Number insideTemp "Inside temperature [%.2f C°]" <temperature> (DaniksRoom, Temperatures) ["CurrentTemperature"] {
	channel="mqtt:topic:arduino1:insideTemp",
	expire="10s"
}

// Light sensor
Number outsideLightSensor "Outside light level" <sun> (Outside, PersistEveryUpdate) {
	channel="mqtt:topic:arduino1:outsideLightSensor",
	expire="10s"
}

//PIRs
Contact daniksRoomPir "XDanik's room motion sensor" <motion> (DaniksRoom_MotionSensors) {
	channel="mqtt:topic:arduino1:motion"
}

String irRecriver "Last recrived IR code [%s]" <sun> (Outside) {
	channel="mqtt:topic:arduino1:irRecriver"
}

Switch danik_nad__power "Power" <switch> {
	channel="mqtt:topic:danik_nad:power",
	autoupdate="false"
}
Switch danik_nad__autoSense "Auto Sense" <settings> {
	channel="mqtt:topic:danik_nad:autoSense",
	autoupdate="false"
}
Switch danik_nad__autoStandby "Auto Standby" <settings> {
	channel="mqtt:topic:danik_nad:autoStandby",
	autoupdate="false"
}
Switch danik_nad__mute "Mute" <soundvolume_mute> {
	channel="mqtt:topic:danik_nad:mute",
	autoupdate="false"
}
Switch danik_nad__speakerA "Speakers A" {
	channel="mqtt:topic:danik_nad:speakersA",
	autoupdate="false"
}
Switch danik_nad__speakerB "Speakers B" {
	channel="mqtt:topic:danik_nad:speakersB",
	autoupdate="false"
}
Number danik_nad__balance "Balance [%d dB]" <heating> {
	channel="mqtt:topic:danik_nad:balance",
	autoupdate="false"
}
Switch danik_nad__direct "Direct" <settings> {
	channel="mqtt:topic:danik_nad:toneDefeat",
	autoupdate="false"
}
Number danik_nad__treble "Treble [%d dB]" <heating> {
	channel="mqtt:topic:danik_nad:treble",
	autoupdate="false"
}
Number danik_nad__bass "Bass [%d dB]" <heating> {
	channel="mqtt:topic:danik_nad:bass",
	autoupdate="false"
}
Number danik_nad__volume "Volume [%.1f dB]" <soundvolume> {
	channel="mqtt:topic:danik_nad:volumeDecibels",
	autoupdate="false"
}
Dimmer danik_nad__volumePercents "Volume [%d %%]" <soundvolume> {
	channel="mqtt:topic:danik_nad:volumePercents",
	autoupdate="false"
}
Switch danik_nad__volumeDisplayAsPercent "Use percents as volume unit" <settings> {
	channel="mqtt:topic:danik_nad:volumeDisplayAsPercent",
	autoupdate="false"
}
Number danik_nad__displayBrightness "Display brightness level [%d]" <settings> {
	channel="mqtt:topic:danik_nad:displayBrightness",
	autoupdate="false"
}
Switch danik_nad__temporaryDisplay "Temporary display" <settings> {
	channel="mqtt:topic:danik_nad:temporaryDisplay",
	autoupdate="false"
}
String danik_nad__bluetoothName "Bluetooth Name [%s]" <keyring> {
	channel="mqtt:topic:danik_nad:bluetoothName",
	autoupdate="false"
}
Switch danik_nad__useHighPassFilter "Use high pass filter" <settings> {
	channel="mqtt:topic:danik_nad:useHighPassFilter",
	autoupdate="false"
}
String danik_nad__model "Device model [%s]" <keyring> {
	channel="mqtt:topic:danik_nad:deviceModel",
	autoupdate="false"
}
String danik_nad__version "Firmware version  [%s]" <keyring> {
	channel="mqtt:topic:danik_nad:firmwareVersion",
	autoupdate="false"
}
Switch danik_nad__preOutAsSubwoofer "Pre-Out as subwoofer" <settings> {
	channel="mqtt:topic:danik_nad:preOutAsSubwoofer",
	autoupdate="false"
}
String danik_nad__sourceName "Current input [%s]" {
	channel="mqtt:topic:danik_nad:sourceName",
	autoupdate="false"
}
Number danik_nad__source "Source [%d]" <settings> {
	channel="mqtt:topic:danik_nad:source",
	autoupdate="false"
}


// source 1
String danik_nad__source1_name "Source 1 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source1_name",
	autoupdate="false"
}
Switch danik_nad__source1_enabled "Source 1 - Enabled" {
	channel="mqtt:topic:danik_nad:source1_enabled",
	autoupdate="false"
}
// source 2
String danik_nad__source2_name "Source 2 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source2_name",
	autoupdate="false"
}
Switch danik_nad__source2_enabled "Source 2 - Enabled" {
	channel="mqtt:topic:danik_nad:source2_enabled",
	autoupdate="false"
}
// source 3
String danik_nad__source3_name "Source 3 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source3_name",
	autoupdate="false"
}
Switch danik_nad__source3_enabled "Source 3 - Enabled" {
	channel="mqtt:topic:danik_nad:source3_enabled",
	autoupdate="false"
}
// source 4
String danik_nad__source4_name "Source 4 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source4_name",
	autoupdate="false"
}
Switch danik_nad__source4_enabled "Source 4 - Enabled" {
	channel="mqtt:topic:danik_nad:source4_enabled",
	autoupdate="false"
}
// source 5
String danik_nad__source5_name "Source 5 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source5_name",
	autoupdate="false"
}
Switch danik_nad__source5_enabled "Source 5 - Enabled" {
	channel="mqtt:topic:danik_nad:source5_enabled",
	autoupdate="false"
}
// source 6
String danik_nad__source6_name "Source 6 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source6_name",
	autoupdate="false"
}
Switch danik_nad__source6_enabled "Source 6 - Enabled" {
	channel="mqtt:topic:danik_nad:source6_enabled",
	autoupdate="false"
}
// source 7
String danik_nad__source7_name "Source 7 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source7_name",
	autoupdate="false"
}
Switch danik_nad__source7_enabled "Source 7 - Enabled" {
	channel="mqtt:topic:danik_nad:source7_enabled",
	autoupdate="false"
}
// source 8
String danik_nad__source8_name "Source 8 - Name [%s]" {
	channel="mqtt:topic:danik_nad:source8_name",
	autoupdate="false"
}
Switch danik_nad__source8_enabled "Source 8 - Enabled" {
	channel="mqtt:topic:danik_nad:source8_enabled",
	autoupdate="false"
}

Switch aquariumLight "Aquarium lights" <light> ["Lighting"] {
        channel="mqtt:topic:esp8266_155006:power1",
        autoupdate="false"
}

Switch aquariumSkimmer "Aquarium skimmer" <flow> ["Switchable"] {
        channel="mqtt:topic:esp8266_155006:power2",
        autoupdate="false"
}

Switch aquariumHeater "Aquarium heater" <heating> ["Switchable"] {
        channel="mqtt:topic:esp8266_155006:power3",
        autoupdate="false"
}

Switch aquariumFilter "Aquarium filter" <water> ["Switchable"] {
	channel="mqtt:topic:esp8266_155006:power4",
	autoupdate="false"
}

Number aquariumTemp "Aquarium temperature [%.2f C°]" <temperature> (Inside, Temperatures) ["CurrentTemperature"] {
	channel="mqtt:topic:esp8266_155006:temperature",
	expire="2m"
}

I am trying to do as many configuration as possible from the config files as they can be easily versioned in git (already saved my ass as I am running on RaspPi with regular SD card).

OpenHab 2.5.0.M1, but this is happening since ever…

IT seems to me that “all” items do belong to the Group temperatures, because of all the nested groups . At least all items that belong to a Group as far as I can see.

But how? Temperatures group is member of Sensors - not vice versa…
I will try to remove the nested groups as I am not using this groups in any way.

Can you tell us why you think every Item is persisted, maybe show us one that you didn’t expect?
Is it storing String type Items, like danik_nad__model ?

You can check what openHAB thinks are group members using PaperUI.
configuration/items, find your group and click to see members. Any nested groups will be shown as group type - click again to see their members.

UPS, that’s correct! Wrong thinking in my side.:hugs:

Well I have deleted all measurements from the openhab database on the influxdb server and then started openhab service - as items were getting their states measurements were created back.

These measurements I get few seconds after starting openhab:

> show measurements
name: measurements
name
----
Curtains
DaniksRoom_LightTemperatures
DaniksRoom_MotionSensors
aquariumTemp
cubePower
danik_chromecastSpeakers_idle
danik_chromecastSpeakers_volume
danik_chromecastTv_idle
danik_chromecastTv_volume
danik_leftLamp__colorTemperature
danik_rightLamp__colorTemperature
danik_spotLight1__colorTemperature
danik_spotLight2__colorTemperature
danik_spotLight3__colorTemperature
danik_spotLight4__colorTemperature
daniksRoomPir
garden_septicPump_powerCurrent
garden_septicPump_powerPower
garden_septicPump_powerVoltage
gateHoldPosition
gateMotorStatus
gatePosition
gateStatus
gateTargetPosition
gateTargetResult
insideTemp
isDayTime
livingRoom_chromecastSpeakers_idle
livingRoom_chromecastSpeakers_volume
outdoorLightTemperature
outsideLightSensor
outsideTemp

And yes, danik_nad__model also get persisted as it receives update - just confirmed by executing SELECT * FROM "48h"."danik_nad__model" few minutes later.

Members of the “Temperatures” group seems to be ok - aquariumTemp,insideTemp,outsideTemp
PersistEveryUpdate as well.

I have no idea what I am doing wrong.

Got it! The problem was cause by excess comm between items definition inside the influxdb.persist file.

Items {
	Temperatures* : strategy = everyUpdate,<------------ !!!
	PersistEveryUpdate* : strategy = everyUpdate
}

Openhab was not complaining about it in the logs, so it was hard to notice.
Thanks for help :wink:

1 Like

Good find, unpredictable effect.