Quick note: Your everyHour+everyDay is redundant because the one includes the other
Second note: How is the group itself defined?
Third note: What is it, g_INFLUX or gINFLUX?
Forth note: The name choice is not good imho. You should use groups to organize Items based on their physical or logical nature. In the next step you can decide to have those persisted. In your example I’d rather define a group for “gWirkleistung”.
gINFLUX and gMYSQL are groups I use to persist Items.
Think of it like an on/off switch to persist an item.
Because I do have groups like Location, Electricity etc. but not all of them need to be stored.
Influx settings:
> settings
Setting Value
-------- --------
Host 127.0.0.1:8086 (I just edited this so it does not display my real IP)
Username openhab
Database openhab_db
RetentionPolicy
Pretty false
Format column
Write Consistency all
Chunked true
Chunk Size 0
Could this be a problem? Because there is nothing inside the field RetentionPolicy
The following sections cover how to create, alter, and delete retention policies. Note that when you create a database, InfluxDB automatically creates a retention policy named autogen which has infinite retention. You may rename that retention policy or disable its auto-creation in the configuration file.
10:17:03.761 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'mysql.persist' has errors, therefore ignoring it: [1,1]: mismatched
input '<EOF>' expecting 'Strategies'
10:17:03.772 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mysql.persist'
but it starts to persist stuff.
10:17:04.201 [DEBUG] [sql.internal.MysqlPersistenceService] - mySQL: Stored item 'C2MW97' as '740.05999755859375'[740.05999755859375] in SQL database
at 2017-09-05 10:17:04.2.
My thought.
There is a problem when trying to persist a group and its items.
I also noticed that MySQL is persisting but Influx is selected.
I tried to change the persistence restart openHAB.
Clear tmp and cache. Nothing so far seems to work.
but… this means that the first character is being read wrong (?)
what text editor are you using to modify the *.persist files? (please don’t tell me Eclipse Smarthome Designer )
I believe that this has to do with the default service that will be used for the rules (for statements like item.historicState).
If you have 2 persistence services configured, both will store the states.
Something is wrong with your influxdb.persist (and mysql.persist) file(s). Try to recreate it from scratch using vim.
I never had problems with my setup and I am persisting a lot of stuff in influxdb.
I have a gInfluxDB group and I add to that several members (other groups and/or individual items)
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
}
this shouldn’t be a problem since:
a) You already were able to store the sample data
b) By default it uses autogen
c) I have the same output from settings in my influx
I think that openHAB2 will load any *.persist file that you put in that directory (even elias.persist)
…but… the config name(?) that it will load will not match a service/bundle/addon/whatever and it will not be effective.
It seems to me that the persistence addons are looking into the config entries in Karaf for settings.
If you load elias.persist, you will (should) have an elias service config (and not an influxdb service config)
I agree with your assessment, but shouldn’t there be at least a WARN level log statement if it doesn’t find an elias service to correspond with the .persist file? It seems misleading to me for OH to load the file, say it loaded the file, and then just silently ignore it.