Charts and expire Binding

Is it possible to use charts and expire binding for same item?

After adding expire binding charts stop working

It might depend on what you’ve set the expire binding to do to the item at expiration. I think some persistence services, on which charts rely, may not currently handle well when items’ states are changed to Undefined (UnDefType.UNDEF), which is the default state to expire items to unless you specify a different value after the comma in the binding config section, like expire="5m,-999". Since Undefined is not a number, some persistence services might either quietly drop the change event, while others might put errors in the log.

If the above explanation doesn’t provide sufficient guidance, please post a detailed explanation of what you are doing, including logs and configuration.

Not working, no error massage in syslog.

The only thing the Expire binding does is return items to a state after a period of no commands or updates. My explanation above is the full story that I can think of. Without configuration or an explanation of what you are attempting to do with the Expire binding, I’m afraid I cannot offer further suggestions.

at the moment i don’t have access to openhab config, tonight will test to rename item and will see openhab reaction. May be also have to change rrd4j persist system with some working system, this rrd4j causing me a lot of troubles. also i want to persist information somewhere on the other machine because now using Raspberry PI and openhab killing my SD Cards every 2 mounts.

Yes, I would expect the RRD4J persistence to have a problem with Number items expiring to the Undefined state, since that persistence service does not handle non-numerical data. You could have the Expire binding expire to a numerical state, like 0, -1, -999, etc, but that is a possibly unsatisfactory workaround.

Also you are correct that persistence onto an SD card will most likely wear it out quickly. I had made the mistake of running a MySQL server on an SD card and it was worn out quickly. I now host a MariaDB database (MySQL compatible) on a separate, disk-based server, to which my openHAB server persists item states, to avoid another quick wear-out of the SD card. That being said, I don’t think the MySQL persistence service would handle expiring to Undefined very well, either.

I test some thinks but expire binding and charts not working for same item.I have this configuration:


Number node24_temp1  	"Temperature [%.1f °C]"	<temperature>	(out_env)	{mysensors="24;1;V_TEMP"}
Number node24_temp1  	"Temperature1 [%.1f °C]" <temperature>	(out_env)	{ expire="30m, -99" }


Chart item=out_env period=h refresh=6000

and this is the error
"[INFO ] [ui.internal.chart.ChartServlet] - Illegal argument in chart: {}
Jan 14 11:06:36 raspberrypi[806]: java.lang.IllegalArgumentException: Series name >Temperature < has already been used. Use unique names for each series!!!

I think I understand what is happening. You must define one unique item, but add multiple bindings to the one item:

Number node24_temp1 "Temperature [%.1f °C]" <temperature> (out_env) { mysensors="24;1;V_TEMP", expire="30m,-99" }

I will add this to the binding wiki in case others are unaware of the proper syntax.

now everything is fine, nothing changed, just restart openhab, and everything work fine.