[SOLVED] Events not persisting - OH2.5 / Influx / Grafana - Docker

Hi - The main issue is my events aren’t being persisted into InfluxDB.
I have read the threads on this and pretty certain I have checked it all but clearly I’m missing something and wondering if someone can help with an extra pair of eyes to spot my mistake in config.
All services are running as docker containers. I don’t believe that setup should have any impact, it just seems that OpenHab isn’t populating to influx. And even with debug level on the binding it’s not showing any issues. Can I debug any other item to check??

I can connect to Influx, Grafana and OpenHab all fine.
The PaperUI Configuration > System has InfluxDB set for persistence.

influxdb.conf

[http]
  # Determines whether HTTP endpoint is enabled.
enabled = true

  # Determines whether the Flux query endpoint is enabled.
  # flux-enabled = false

  # Determines whether the Flux query logging is enabled.
  # flux-log-enabled = false

  # The bind address used by the HTTP service.
bind-address = ":8086"  

  # Determines whether user authentication is enabled over HTTP/HTTPS.
auth-enabled = false
    indent preformatted text by 4 spaces

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://172.16.44.11:8086
# The name of the database user, e.g. openhab.
# Defaults to: openhab
user=openhab
# The password of the database user.
password=xxxxxxx
# The name of the database, e.g. openhab.
# Defaults to: openhab
db=openhab_db
# The retention policy to be used, needs to configured in InfluxDB
# Till v0.13: 'default', since v1.0: 'autogen'
retentionPolicy=autogen

if I execute

openhab> bundle:restart org.openhab.persistence.influxdb

the debug output looks like

15:19:56.992 [DEBUG] [b.internal.InfluxDBPersistenceService] - influxdb persistence service deactivated

15:19:57.000 [DEBUG] [l.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been stopped.

15:19:57.004 [DEBUG] [l.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been started.

15:19:57.029 [DEBUG] [b.internal.InfluxDBPersistenceService] - influxdb persistence service activated

15:19:57.033 [DEBUG] [b.internal.InfluxDBPersistenceService] - database status is OK, version is 1.7.8

a sample of the events are here

15:20:59.744 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Temperature_Degrees changed from 19.15 to 19.17

15:20:59.919 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_Sht_1_humidity changed from 46.73 to 46.86

15:20:59.922 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Humidity_Humidity changed from 46.73 to 46.86

15:20:59.923 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Dewpoint_Dewpoint changed from 7.48 to 7.54

15:20:59.924 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Humidex_Humidex changed from 19.35 to 19.40

15:21:02.664 [INFO ] [smarthome.event.ItemStateChangedEvent] - Thermocouples_TC2 changed from 2.5 °C to 13.75 °C

15:21:05.775 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_Sht_1_temp changed from 19.17 to 19.16

15:21:05.777 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_sht_1_temp changed from 19.17 to 19.16

15:21:05.781 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Temperature_Degrees changed from 19.17 to 19.16

15:21:05.953 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_Sht_1_humidity changed from 46.86 to 46.79

15:21:05.958 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Humidity_Humidity changed from 46.86 to 46.79

15:21:05.961 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Dewpoint_Dewpoint changed from 7.54 to 7.51

15:21:05.962 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Humidex_Humidex changed from 19.40 to 19.37

15:21:11.809 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_Sht_1_temp changed from 19.16 to 19.14

15:21:11.811 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_sht_1_temp changed from 19.16 to 19.14

15:21:11.812 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Temperature_Degrees changed from 19.16 to 19.14

15:21:11.996 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Dewpoint_Dewpoint changed from 7.51 to 7.49

15:21:11.999 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Humidex_Humidex changed from 19.37 to 19.35

15:21:17.085 [INFO ] [smarthome.event.ItemStateChangedEvent] - Thermocouples_TC2 changed from 13.75 °C to 9.25 °C

15:21:18.026 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_Sht_1_humidity changed from 46.79 to 46.82

15:21:18.028 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Humidity_Humidity changed from 46.79 to 46.82

15:21:18.029 [INFO ] [smarthome.event.ItemStateChangedEvent] - SHT_1_Dewpoint_Dewpoint changed from 7.49 to 7.50

15:21:23.882 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_Sht_1_temp changed from 19.14 to 19.11

15:21:23.884 [INFO ] [smarthome.event.ItemStateChangedEvent] - GenericMQTTThing_sht_1_temp changed from 19.14 to 19.11

and my persistence rules are:

Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"
    default = everyChange
}

Items {
        Thermocouples_TC0: strategy = everyMinute, restoreOnStartup
        Thermocouples_TC1: strategy = everyMinute, restoreOnStartup
        Thermocouples_TC2: strategy = everyMinute, restoreOnStartup
        Thermocouples_TC4: strategy = everyMinute, restoreOnStartup
        Thermocouples_TC8: strategy = everyMinute, restoreOnStartup
        Thermocouples_TC9: strategy = everyMinute, restoreOnStartup
        *          : strategy = everyChange   // persist every item
}

if I look at influx

Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 1.7.8
InfluxDB shell version: 1.1.1
> USE openhab_db
Using database openhab_db
> show GRANTS for openhab
database        privilege
--------        ---------
openhab_db      ALL PRIVILEGES
test            ALL PRIVILEGES

> SHOW users
user    admin
----    -----
admin   true
openhab false
grafana false

> SHOW series

I have followed the InfluxDB+Grafana Persistance and graphing tutorial and Grafana successfully plots the sine wave.

Any help, troubleshooting ideas would be very welcome - thanks!

When you put the InfluxDB add-on into trace level logging you should see some logging statements every time any of your Items change and for that half a dozen Items every minute. Do you see this?

Do you see any errors when you change the .persist file? What is your .persist file named? A common mistake is forgetting the “db” in “influxdb.persist”. Do you see OH attemping to load the .persist file when you restart OH or make changes to the .persist file?

Have you restarted OH since the last change to the .persist file?

1 Like

That was it… file was named influx.persist rather than influxdb.persist
Thanks soooo much.

I’m not sure I saw that explicitly stated in the docs - the emphasis is on the extensions not the names. Great its working ok now :slight_smile: