influxDB everyChange not working

I’m trying to set up persistence using influxDB with my item strategy set to everyChange and nothing is getting sent to the database.

My influxdb.persist file…

Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

    default = everyChange
}

Items {
    ElectricMeter* : strategy = everyChange
}

As I said, with this setup I’m not getting any data in the database. I added ‘everyMinute’ to the strategy (strategy = everyChange, everyMinute) and it did start sending data every minute as configured.

I can watch the log, and see items in that group changing. The energy meter values are pretty precise and they change pretty frequently, often less than every minute. Here there’s been three updates to the items in that group, but no influx

15:43:02.399 [INFO ] [marthome.event.ItemStateChangedEvent] - ElectricMeterVolts changed from 118.113 to 118.079
15:43:02.469 [INFO ] [marthome.event.ItemStateChangedEvent] - ElectricMeterAmps changed from 6.949 to 6.956
15:43:12.397 [INFO ] [marthome.event.ItemStateChangedEvent] - ElectricMeterVolts changed from 118.079 to 118.198
15:43:12.472 [INFO ] [marthome.event.ItemStateChangedEvent] - ElectricMeterAmps changed from 6.956 to 6.88
15:43:22.409 [INFO ] [marthome.event.ItemStateChangedEvent] - ElectricMeterVolts changed from 118.198 to 118.222
15:43:22.474 [INFO ] [marthome.event.ItemStateChangedEvent] - ElectricMeterAmps changed from 6.88 to 6.946

I have TRACE level turned on for the influx persistence binding; so I see the log entries for the updates being sent every minute but nothing for the changes.

how does your /etc/openhab2/services/influxdb.cfg look like?

nah… forget it… this should be fine since you see the updates being logged…

I don’t know what could be wrong :stuck_out_tongue:

which release of OH2 with which version of the persistence bundle?

I’m using the 2.1.0 stable release. The binding was installed through the PaperUI, it shows persistence-influxdb - 1.10.0 in there.

* is not a wild card. It means “every member of the proceeding group”. You either need to create a group named ElectricMeter and add all your items to this group or add each item that starts with ElectricMeter individually to the .persist file.

ElectricMeter is a group. It just so happens that the items in that group are named with the pattern starting with ‘ElectricMeter’

Note, the persistence is working for everyMinute, the only thing not working is everyChange.

In this case, you may have identified an issue with the influxdb persistence addon
I didn’t try to replicate but you have enough info (add your cfg and items info) for: https://github.com/openhab/openhab1-addons/issues

1 Like

I also have the problem. But it is a bit specific.
the usecase:

  • there is a group persist10M with associated persist strategy: everyChange and every 10min

  • this group includes Number items, contact items and switch items

All values are written in the database only the changes of the switches not, in the moment of change.
After changing the state of the switch the new state will persist in influxDB within 10min then the second part of the strategy, every 10min, triggert.

Someone has alredy found a solution?

I was looking for something else and i find:

The switchItem with his own persist strategy: all works fine
Then the same switchItem only is member a group the startegy everyChange does’nt work.

A workaround is to change the strategy to everyUpdate.
I don’t think the solution is so nice but it’s works.

1 Like

Did you find a solution for this behaviour?
I have a similar problem with strategies „everyHour“ and „everyChange“. EveryHour is properly logged, everyChange isn‘t.

Edit: Openhab 2.3 stable and InfluxDB Persistence 1.12.0 via PaperUI