3 Group items not logging on influx

Hi guys, I got these items:

Group gLog_60s “Log 60s”
Group gLog_e “Log Every Event”
Group gEnergy
Group gLogDB

Group:Dimmer gGFDiningTable “Dining Lights Brightness” (Home)
Group:Switch gGFDiningTableS “Dining Lights Switch” (Home)
Group:Switch gGFLivingLightS “Living Lights Switch” (Home)
Group:Switch gGFKitchenS “Kitchen Lights Switch” (Home)
Group:Number:AVG gBFTemperature “Basement Floor Average Temp” (gEnergy, gLogDB, gLog_60s)
Number GasCounterTotal “[%.1f]” <electric_meter> (gEnergy, gLog_e, gLogDB)

In my sitemap I got:

  Text item=gBFTemperature label="Average temp [%.1f °C]" icon="temperature"

It shows the correct average temperature.
I can see it change in the logfile too.

gLog_e gLog_60s are my persistance group as defined in influxdb:
gLogDB is for mapDB.

Strategies {
everyMinute : “0 * * * * ?”
everyHour : “0 0 * * * ?”
everyDay : “0 0 0 * * ?”
every2Minutes : “0 */2 * ? * *”
}

Items {
gLog_60s* : strategy = everyMinute
gLog_e* : strategy = everyChange
}

GasCounterTotal <-- this logs properly and shows up as a variable I can plot in Grafana.
But gBFTemperature is not showing up.
It is only AVG groups that I cannot get to log :frowning:
Thanks.

Try adding the gLog_e group to gBFTemperature, so that it has the same groups as GasCounterTotal. It all looks fine to me, but that might help isolate the issue.

Did not do it either.

The only other difference is that it starts with a lower case…

It does not save even with LogDB (and of course, other LogDB items save).

I wonder if AVG causes issues…
This is the only item that I am trying to log that is a group itself.

That was my other guess. I searched “influx group” and there are a couple of hits that might help you.


A workaround would be to copy the average value into an unbound item and use that for persistence.

OK, trying to hack the fix:

rule “Value Change BF”
when
Item gBFTemperature changed
then
BFTemperature = gBFTemperature.state
end

How to check that gBGTemperature.state does not have a null state?

FYI, I get this error:
==> /var/log/openhab2/openhab.log <==
2019-04-22 21:36:37.923 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Value Change FF’: An error occurred during the script execution: Cannot assign a value in null context.

(even thought it does not seem to be null :confused:

I assume that you also made an unbound item for BFTemperature. You have to post an update to change its state. I think this should work:

then
if (gBFTemperature.state != NULL)
{
    BFTemperature.postUpdate(gBFTemperature.state.toString)
}
end

I defined it as a number. Is it ok to use as string?

Group Items that are a member of a persisted Group do not get saved unfortunately. But you don’t necessarily need to copy the value to a separate unbound Item. You can put gBFTemperature in your .persist file individually (without the *) and it will save the state of the Group Item.