Setting influxdb as default

Hello,
I started to use Openhabian 3 on a Raspi. I bound my Senec Photovolatic system´s power channels and then my Fritz 301 thermostates temperature channels. All went well. But I noticed that using the default RR4DJ for persistence does make the data granualar after the first day already. So I added influxdb. That went well for all the Senec channels. But the Fritz Channels still write to PR4DJ. I did select influxdb as default in the UI. But in charts, I can see the Fritz Temperature channel only when selecting PR4DJ as source in UI. For Senec it has to be influxdb. I did not touch the console yet or edited any files - I guess I need to tell the system somehow that influxdb is the default now and that it should forget PR4DJ completely - how do I do that?

You’ve already done it. Navigate to Settings → Persistence and select InfluxDB as the default.

Remove the rrd4j add-on.

But that’s not your problem. Different persistence engines are independent of each other. They do not interfere with each other so the existence of RRD4J saving the Item’s states does not prevent InfluxDB from doing so too.

Have your Frits Temperature Item updated since switching the default? How often does it update? You need about a day’s worth of data to generate most of the charts. One or two points is usually not enough.

Do you have an influxdb.persist file that doesn’t save all Items?

Thanks for the feedback. I belive the problem exists as I first bound all my Fritzes and charted some in RRDj4, then I switched to Influxdb. I assume, that there is a file somehwere telling HA to save all FRitz temperatures into PRDJ4. I did find the persistence folder on my Raspi, it is empty. I belive I need to create a file there saying it is influxdb now. I have seen files were the strategy for saving is outlined too - but I do not want to do that, no hazzle. I guess a clean new install with influxdb from the beginning would help, I am hesitating. I just finished my Model with 50 sensors…

Unless you created one there is no file anywhere telling OH to save anything.

By default RRD4J saves all supported Items on every update and once a minute with restore on startup.

By default I think InfluxDB saves all Items on every update with restore on startup.

Unless you created an influxdb.persist and rrd4j.persist file in $OH_CONF/persistence, this is the behavior. You actually cannot change which Items are saved where and under what conditions through the UI. You have to manually do it in a .persist file. So if you didn’t create a .persist file, this is how the Items are being saved.

Remember, it’s not either or. You can have both databases saving your Items at the same time.

Thanks,
just for the record what happened so far:
I etched a new installation
Fritz Thermostates would log their temperature to the prdj4 db, I tried 3 (out of 20)
I added the Influxdb
I almost simultaneously added the Senec PV channels
I did not touch the persistence switch in the UI-Setup
Senec channels were logged into the influx db
All FRitz temperatures remained in the prdj4 db. In order to see them, I had to select that db in charts-advanced, otherwise the chart was empty.
If I select prdj4 in the UI, the Senec channels go to that db. If I select influxdb, Senec goes there, but Fritz stays in prdj4
I try a new install on a fresh card tomorrow…

All I can say then is that there is something about the Items linked to the Fritz Items that makes them incompatible with InfluxDB.

So I etched a new Habian, installed Influx from the beginning, set Persistency to influxdb, fetched FRitz Thermostate temperature channel - and it can only be charted when retreived from prdj4, even though default persistence is set to influxdb! THat is a pitty. I have 20 Thermostates and a couple of outdoor sensors. I want to chart room temperatures vs outdoor temp. over months and eventually do some Python stuff on it. However, with prdj4´s granularity and size limitation I can not do that for more than a couple of day´s data. Is there no other way?

Details. What are your Item types? Have you tried using API Explorer to see if influxdb has any data for your Items?

Once again, the fact that rrd4j is saving the values is completely irrelevant.

What matters is why InfluxDB isn’t saving those Items. Completely uninstall the add-ons. Get rid of rrd4j entirely. It won’t change anything.

You keep talking about Channels but Channels have nothing to do with persistence. Persistence saves the states of Items.

As I said, there is something about these Items that InfluxDB doesn’t like. What is it? :man_shrugging: You’ve not even indicated what type these Items are, let alone event logs, queries to InfluxDB to see if there is even anything there for those Items, etc.

I tried to save you the effort of starting over because I knew from the start that wouldn’t change anything. Same Items, same problems.

Which actual version?
influxdb 2 had a problem with underscore in Item names at 3.1 I think.

Sorry, I was not very specific:
This is the thing
UID: avmfritz:FRITZ_DECT_301:192_168_1_10:099950058880
label: “301 #1 GästeKlo”
thingTypeUID: avmfritz:FRITZ_DECT_301
configuration:
ain: “099950058880”
bridgeUID: avmfritz:fritzbox:192_168_1_10

With these channels

Where I linked one to an item

It only appears in the chart when deselecting the default DB

None of the persistence services are remotely interested in your Things or channels. They operate on Items - it looks like the Item of interest is named
3011GasteKlo_CurrentTemperature
and it’s of type Number:Temperature

The type should be fine.

I note that there is an underscore in the name, which should be okay BUT has been associated with influxdb problems in some OH versions - what’s yours?

Of more concern though, your Item name starts with a number.

Names must not begin with numbers. Spaces and special characters are not permitted.

I know parts of openHAB deal with it, but parts don’t.

I am running OH 3.2.0
I renamed another Fritz thing without numbers and added a link to its channels. The chart shows two values went into influxdb, but then it switched to rrd4j. Would I need to reboot?

Hello,
I have now created an influx.persist file that looks like that. Sill, my Fritz Temperatures can only be seen in the RRD4J db. I hopped that specifying “*” as Item would save all items into the influx db. What else could I possibly do?

Strategies {
everyMinute : “0 * * * * ?”
everyHour : “0 0 * * * ?”
everyDay : “0 0 0 * * ?”
default = everyUpdate
}

Items {
* : strategy = everyUpdate
}

May we see one of the Items that doesn’t work now?

… what do you need?

I show a couple of screenshot to illustrate the issue:
The good one:
Senec Power channels



nice chart out of influxdb

The bad one. Fritz Thermostate Temperature




Data goes into RRDJ4 (Influxdb set as Default)

no data in Influxdb

So the bad ones, and only the bad ones, all start with a number in the name?

How long did you wait, and what are you using to confirm data in the influx database?

Please note that the Default persistence does nothing except for set the default historical data source for charts and rules. So RRD4J is not interfering with anything, it’s not stealing any data - its existence is irrelevant, as the others have said. It did not ‘switch’ to RRD4J - it was going there already

Yesterday I did a fresh install and renamed a data channel with letters only. Same result.
I “read your lips”, but why are the Fritz temperatures not stored in influxdb but the Senec power channels are? I can only assume that somehow influxdb does not like them (why?) and so they are stored in the default db.

The only sure fire way is to use the API Explorer to query the influxDB (or look in the DB itself with a separate tool, I guess).


They will be stored in every Persistence service that you have installed, and that can accept the Item type, and that you have not explicitly configured not to store them. It’s not “they didn’t go into influx, so they went to RRD4J”. They go to RRD4J anyway, unless you configured RRD4J not to store them too. If you install another persistence service it’ll probably be stored by that one too, assuming it likes the Item.