InfluxDB+Grafana persistence and graphing

openHAB 2.1 Stable
InfluxDB shell version: 1.3.4
Influx Bundle Version 1.10.0

On my other PI its ( No Problems here works just fine )
openHAB 2.1 Stable
InfluxDB shell version: 1.2.4
Influx Bundle Version 1.10.0

Debug log reports another version number versus what the linux shell reports? (strange)

I am using OH2.2.0 S1026 with InfluxDB 1.3.4 on Debian Jessie on a regular x64 PC and all is fine…

openhab> list -s |grep -i influx
207 │ Active   │  80 │ 1.11.0.201708221612    │ org.openhab.persistence.influxdb

Here is my config setup:

root@homer:~# more /etc/openhab2/services/influxdb.cfg 
url=http://127.0.0.1:8086
user=openhab
password=LittleyouSneeky
db=openhab_db
retentionPolicy=autogen
root@homer:~# more /etc/openhab2/persistence/influxdb.persist 
Strategies {
    everyHour : "0 0 * * * ?"
    everyDay  : "0 0 0 * * ?"

    default = everyChange
}

Items {
    // persist all members of gInflux Group on every change
    gInfluxDB* : strategy = everyChange, everyHour, everyDay
}
211 | Active   |  80 | 1.10.0                 | openHAB InfluxDB Persistence bundle                    | org.openhab.persistence.influxdb
# 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://127.0.0.1:8086

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

# The password of the database user.
password=YouSneekyLittle

# 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

// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
	everyHour : "0 0 * * * ?"
	everyDay  : "0 0 0 * * ?"
	everyMinute:"0 * * * * ?"

	// if no strategy is specified for an item entry below, the default list will be used
	default = everyChange
}

/* 
 * Each line in this section defines for which item(s) which strategy(ies) should be applied.
 * You can list single items, use "*" for all items or "groupitem*" for all members of a group
 * item (excl. the group item itself).
 */
Items {
	// persist all items once a day and on every change and restore them from the db at startup
	g_INFLUX* : strategy = everyChange, everyDay, restoreOnStartup
    Item101 : strategy = everyChange, everyDay, restoreOnStartup
}

:crazy_face: What is wrong?

no clue :stuck_out_tongue:

re-install the addon… maybe it needs a small kick in the @ss to get moving :slight_smile:

Ps: take out the everyMinute:"0 * * * * ?" line. it’s not needed and it doesn’t have spaces between :

1 Like

I keep getting this message

16:07:58.790 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘influx.persist’ has errors, therefore ignoring it: [1,1]: mismatched input ‘’ expecting ‘Strategies’

But sometimes the file has erros sometimes not :crazy_face:
Now its OK again

16:10:02.374 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘influx.persist’

Now its not

16:10:24.918 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘influx.persist’ has errors, therefore ignoring it: [1,1]: mismatched input ‘’ expecting 'Strategies’
16:10:25.022 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘influx.persist’

Are there limitations for InfluxDB ?..
Because I have 389 Items and 30% of them are updating every second :slight_smile:

take out all comments (stuff starting with // and/or /* + */) from /etc/openhab2/persistence/influxdb.persist
By the way use: influxdb.persist (not influx.persist)
edit the file with a linux editor (like vim) and make sure that there is no crap lying around in the contents of the file (strange characters or line feeds, etc)

Done but still no other series in my Influxdb. Only the test sine_wave :roll_eyes:

16:22:08.553 [DEBUG] [org.openhab.persistence.influxdb    ] - ServiceEvent UNREGISTERING - {org.openhab.core.persistence.PersistenceService, org.openhab.core.persistence.QueryablePersistenceService}={service.pid=org.openhab.influxdb, db=openhab_db, user=openhab, url=http://127.0.0.1:8086, password=YouSneekyLittle, component.name=org.openhab.persistence.influxdb, retentionPolicy=autogen, component.id=207, service.id=330, service.bundleid=211, service.scope=bundle} - org.openhab.persistence.influxdb
16:22:08.554 [DEBUG] [.internal.InfluxDBPersistenceService] - influxdb persistence service deactivated
16:22:08.559 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STOPPING - org.openhab.persistence.influxdb
16:22:08.560 [DEBUG] [.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been stopped.
16:22:08.562 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STOPPED - org.openhab.persistence.influxdb
16:22:08.588 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent UNRESOLVED - org.openhab.persistence.influxdb
16:22:08.677 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent UNINSTALLED - org.openhab.persistence.influxdb
16:22:08.825 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-persistence-influxdb'

16:22:38.538 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent INSTALLED - org.openhab.persistence.influxdb
16:22:38.609 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent RESOLVED - org.openhab.persistence.influxdb
16:22:38.628 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STARTING - org.openhab.persistence.influxdb
16:22:38.737 [DEBUG] [.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been started.
16:22:38.749 [DEBUG] [.internal.InfluxDBPersistenceService] - influxdb persistence service activated
16:22:39.051 [DEBUG] [.internal.InfluxDBPersistenceService] - database status is OK, version is 1.3.3
16:22:39.055 [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://127.0.0.1:8086, password=YouSneekyLittle, component.name=org.openhab.persistence.influxdb, retentionPolicy=autogen, component.id=210, service.id=342, service.bundleid=212, service.scope=bundle} - org.openhab.persistence.influxdb
16:22:39.058 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STARTED - org.openhab.persistence.influxdb

how are you concluding to this statement?
are you using the influx console to check the stuff stored in the DB?

root@homer:~# influx -username admin -password YouSneekyLittle  -host localhost
Connected to http://localhost:8086 version 1.3.2
InfluxDB shell version: 1.3.4
> use openhab_db
Using database openhab_db
> show measurements
name: measurements
name
----
E03_J7
E03_Large_LED
E03_Small_LED
...

Of course. I checked it with show measurements and show series

Connected to http://localhost:8086 version 1.3.3
InfluxDB shell version: 1.3.4
> use openhab_db
Using database openhab_db
> show series
key
---
sine_wave
> show measurements
name: measurements
name
----
sine_wave

did this installation work before and it broke recently or it’s a clean start?
I don’t see anything wrong with your setup…

that should be extremely light load for influxdb… I don’t expect problems from that.
On the other hand… I wouldn’t run influx on a Pi because of small RAM.

Fresh Setup.

The openHAB version with my 389 Items is not on a Pi.
I am clueless.

check something in the console…

config:list "(service.pid=org.openhab.influxdb)"

and compare the output to your /etc/openhab2/services/influxdb.cfg

check also: /var/lib/openhab2/config/org/openhab/influxdb.config

openhab> config:list "(service.pid=org.openhab.influxdb)"
----------------------------------------------------------------
Pid:            org.openhab.influxdb
BundleLocation: null
Properties:
   db = openhab_db
   password = SneekyLittleHobbits
   retentionPolicy = autogen
   service.pid = org.openhab.influxdb
   url = http://127.0.0.1:8086
   user = openhab

/var/

db="openhab_db"
password="SneekyLittleHobbits"
retentionPolicy="autogen"
service.pid="org.openhab.influxdb"
url="http://127.0.0.1:8086"
user="openhab"

looks good…

I don’t know what else to suggest…

Here is my TRACE log from my influxdb persistence service (working fine):

29-Aug-2017 18:03:41.880 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 64.8
29-Aug-2017 18:03:41.881 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - found fractional part
29-Aug-2017 18:03:41.881 [DEBUG] [tence.influxdb.internal.InfluxDBPersistenceService] - got DecimalType value 64.8
29-Aug-2017 18:03:41.882 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - storing mP6_01_01_P in influxdb value 64.8, mP6_01_01_P (Type=NumberItem, State=64.8)
29-Aug-2017 18:03:41.884 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 234
29-Aug-2017 18:03:41.884 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - found no fractional part
29-Aug-2017 18:03:41.885 [DEBUG] [tence.influxdb.internal.InfluxDBPersistenceService] - got DecimalType value 234
29-Aug-2017 18:03:41.886 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - storing mP6_01_01_V in influxdb value 234, mP6_01_01_V (Type=NumberItem, State=234)
29-Aug-2017 18:03:41.887 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 8.3
29-Aug-2017 18:03:41.887 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - found fractional part
29-Aug-2017 18:03:41.888 [DEBUG] [tence.influxdb.internal.InfluxDBPersistenceService] - got DecimalType value 8.3
29-Aug-2017 18:03:41.897 [TRACE] [tence.influxdb.internal.InfluxDBPersistenceService] - storing mP6_01_02_P in influxdb value 8.3, mP6_01_02_P (Type=NumberItem, State=8.3)
...(aloooot of entries)...

Hey guys, I’m also unsure what’s going on here. As it seems like the connection is established without issues, I’d suspect the persist file to be faulty, leading to no persistence. Try to recreate the file. Here is mine.

we hijacked your thread! :stuck_out_tongue:

seems so (but Elias fixed it)…

1 Like

Posting this here as I think most of the people watching this thread might be interested and may miss my main posting.

2 Likes

HI, when use openhab cloud to access basic_ui, I aware grafana is not showing,
is there anyway that I can make it show? limit from to local setting or cloud end setting?

your local grafana server (ip address) is probably not available from the Internet.

for Grafana, you can not specify a local address, for example http://192.168.1.10:3000 or http: // localhost: 3000, you need to specify the external address of the server with the free port 3000 port.