InfluxDB & Openhab

Hi,

I’ve have followed the guide to get grafana & influxDB working. After finishing the guide I had a working system! Unfortunuatly the system rapitly stopped working.

My log file:

2018-03-04 15:58:57.319 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STARTING - org.openhab.persistence.influxdb

2018-03-04 15:58:57.329 [DEBUG] [.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been started.

2018-03-04 15:58:57.333 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STARTED - org.openhab.persistence.influxdb

2018-03-04 15:58:57.393 [DEBUG] [.internal.InfluxDBPersistenceService] - influxdb persistence service activated

2018-03-04 15:58:58.217 [DEBUG] [.internal.InfluxDBPersistenceService] - database status is OK, version is 1.4.2

2018-03-04 15:58:58.224 [DEBUG] [org.openhab.persistence.influxdb    ] - ServiceEvent REGISTERED - {org.openhab.core.persistence.PersistenceService, org.openhab.core.persistence.QueryablePersistenceService}={service.pid=org.openhab.influxdb, db=openhab_db, user=openhab, url=http://192.168.2.3:8086, password=*********, component.name=org.openhab.persistence.influxdb, retentionPolicy=autogen, component.id=255, service.id=389, service.bundleid=241, service.scope=bundle} - org.openhab.persistence.influxdb

my influxDB.cfg:

url=http://192.168.2.3:8086
user=openhab
password=**********
db=openhab_db

and to complete my influxDB.persistence:

Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"
}
Items {
* : strategy = everyChange, everyMinute, restoreOnStartup
AirQuality_PM25 : strategy = everyChange, everyMinute, restoreOnStartup
}

I don’t understand what else I could do to solve the problem. I read about the problems with CAPS which I removed. Also, I changed my items to be sure there was somthing to record. Is there anyone that can see the problem?

I don’t see any errors. What problems are you seeing?

The file name is case sensitive and has to be exactly influxdb.cfg for configuration
and influxdb.persist for persistence configuration.

See first and last stanza in https://docs.openhab.org/addons/persistence/influxdb/readme.html#configuration

Please keep in mind that unlike rrd4j and internal graphing, you do not need to use everyMinute as strategy but only everyChange for influxdb and grafana.
Be aware that AirQuality_PM25 is already persisted with * - however, this should not cause trouble.

I would recommend using mapdb persistence for restoreOnStartUp only.
The reason is that in a “slow” machine, after a reboot, influxdb might not be up and running yet when openhab starts and would will not be able to restore values.
mapdb is more or less bundled with OH and it has a very small database footprint as it stores only the last value of each item.

You don’t need the AirQuality_PM25 line as you are already persisting everything as @Udo_Hartmann said before. I should not cause trouble but you are doubling the database size for that item.

I would avoid persisting every minute for every items with influxdb, your database will grow in size so beware. If you are running OH on a raspberry pi for example, with limited storage you may run into problems in the long run.

Regards

@Udo_Hartmann, I wrote the name of the file with uppercase DB in the post. The config & persistence files themselves are in the correct syntax.

I have changed the strategy to only everyChange.

@vzorglub, I threw the restoreOnStartUp and the AirQuality_PM25 out of the persistence file:

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

Even after reboot It din’t start to register states in the database. What else could be going wrong?

I don’t see any errors in the logs you posted.
What problems are you experiencing?

Did you install the persistence service?
Check if the persistence is still installed with paperUI. There is a known bug which uninstalls features when installing other features.

1 Like

There should be a line like

2018-01-08 12:13:52.020 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'

in your openhab.log (and no WARN or ERROR near this line)

@vzorglub, @Josar,and @Udo_Hartmann. I feel ashamed. I found the cause of my problems. With all my tests, at a certain point I changed the name of the persistence file to influxdb.persistence

Rechanging the name to influxdb.persist solved the problem. :flushed:

1 Like