New (certain) items not going to InfluxDB

  • Platform information:
    • Hardware: X86/2 vCPU’s ESXi/8GB vRAM ESXi
    • OS: Ubuntu
  • I have an InfluxDB persistence configured which I use to show data in Grafana. Works rock solid, all my KNX bus data which is relevant is being pushed to InfluxDB and I have some nice graphs showing temps, power consumption, lux and states in Grafana :+1:

Up untill now the only data going into InfluxDB was KNX data.

Recently I configured my OpenHAB setup to interpret a JSON coming from my SMA Solar Inverter and this is the result and I’m pretty delighted about it and having these values in OpenHAB:

The next step (this was the goal al along) for me was to add these values to InfluxDB. Keeping in mind I already had all the persistence and heavy stuff done I thought it would be as simple as modifying my influxdb.persist file:

Strategies {
    everyHour : "0 0 * * * ?"
    everyFiveMins : "0 0/5 * 1/1 * ? *"
    everyHalfHour : "0 0/30 * 1/1 * ? *"

Items {
    grp_Temperaturen*   : strategy = everyChange, everyHour
    grp_Amps*                             : strategy = everyChange
    grp_LIGHT*     : strategy = everyChange
    dimmer_Pct_Ventilatie	:	strategy = everyChange,everyHour
    switch_AchterdeurStatus : strategy = everyChange,everyHour
    grp_Lux*    :   strategy = everyChange
    grp_SMA*    :   strategy = everyChange, everyFiveMins

And adding the relevant group tag to my items:

Number number_SMA_DCVermogenA "DC Vermogen A [%.0f W]"    <solarplant>  (grp_SMA)
Number number_SMA_DCVermogenB "DC Vermogen B [%.0f W]"    <solarplant>  (grp_SMA)

Number number_SMA_DCSpanningA "DC Spanning A [%.2f V]"    <solarplant>  (grp_SMA)
Number number_SMA_DCSpanningB "DC Spanning B [%.2f V]"    <solarplant>  (grp_SMA)

Number number_SMA_DCStroomA "DC Stroom A [%.3f A]"    <solarplant>  (grp_SMA)
Number number_SMA_DCStroomB "DC Stroom B [%.3f A]"    <solarplant>  (grp_SMA)

Number number_SMA_ACVermogen "AC Vermogen [%.0f W]"    <energy>  (grp_SMA)
Number number_SMA_ACNetfrequentie "AC Netfrequentie [%.2f Hz]"    <energy>  (grp_SMA)

Number number_SMA_ACFasestroomFaseL1 "AC Fasestroom L1 [%.3f A]"    <energy>  (grp_SMA)
Number number_SMA_ACFasespanningFaseL1 "AC Fasespanning L1 [%.2f V]"    <energy>  (grp_SMA)

Number number_SMA_DayYield "Dagopbrengst [%.3f kWh]"    <chart>
Number number_SMA_DayYieldEur "Dagopbrengst [%.2f EUR]"  <piggybank>

Based on the logging I’m sure the item is getting an update, however I’m not sure OpenHAB is triggering the persistence logic:

2018-03-20 12:44:26.953 [ItemStateChangedEvent     ] - number_SMA_DCVermogenA changed from 2754 to 2737
2018-03-20 12:44:26.954 [ItemStateChangedEvent     ] - number_SMA_DCVermogenB changed from 1185 to 1212
2018-03-20 12:44:26.956 [ItemStateChangedEvent     ] - number_SMA_DCSpanningA changed from 436.4 to 436.3
2018-03-20 12:44:26.957 [ItemStateChangedEvent     ] - number_SMA_DCSpanningB changed from 312.1 to 311.6
2018-03-20 12:44:26.959 [ItemStateChangedEvent     ] - number_SMA_DCStroomA changed from 6.31 to 6.27
2018-03-20 12:44:26.960 [ItemStateChangedEvent     ] - number_SMA_DCStroomB changed from 3.79 to 3.88
2018-03-20 12:44:26.963 [ItemStateChangedEvent     ] - number_SMA_ACFasespanningFaseL1 changed from 251.8 to 0
2018-03-20 12:44:26.964 [ItemStateChangedEvent     ] - number_SMA_ACFasespanningFaseL1 changed from 0 to 252.74
2018-03-20 12:44:26.966 [ItemStateChangedEvent     ] - number_SMA_ACFasestroomFaseL1 changed from 16.0 to 0
2018-03-20 12:44:26.966 [ItemStateChangedEvent     ] - number_SMA_ACFasestroomFaseL1 changed from 0 to 15.94
2018-03-20 12:44:26.968 [ItemStateChangedEvent     ] - number_SMA_DayYield changed from 15.995 to 16.001
2018-03-20 12:44:26.969 [ItemStateChangedEvent     ] - number_SMA_DayYieldEur changed from 1.1340455 to 1.1344709

However… The data is not showing up in InfluxDB (I checked with InfluxDBStudio, so it’s not logic going wrong in Grafana or something, the table with the values has not been created by OpenHAB/InfluxDB).

Where should I look to troubleshoot this issue?

Your persistence is all based around Groups (or specific items)

Your new items don’t have a group, nor are specifically listed in your persistence file - therefore no persistence.

Did you restart openHAB to make sure that the updated influxdb.persist has been loaded?

Have you defined the groups in the item-file?

1 Like

What’s this then? Am I missing something, that’s a group definition, no?

Number number_SMA_DCVermogenA “DC Vermogen A [%.0f W]” (grp_SMA)

Jup, a couple of times, I found that issue too.

And ding ding ding, we have a winner, completely forgot about that.

You need to define the group items too:

Group grp_Lux
Group grp_SMA
1 Like

Sorry, I missed that bit - only noticed the last two items had no group and the item wasn’t defined specifically.

Jup jup jup, so obvious yet completely slipped my mind.

That’s what you get by splitting up everything nicely. I completely forgot I had a groups.items file where I keep all my groups.

I have my groups defined at the top of each file and each file more or less represent a group or functionality

Yeah, that’s “the other way”. I’m pretty strict about separating them and well… Sometimes this bites you in the ass :smile: Nevertheless left or right, you have to define the group and that’s something I forgot :smirk: