Measurement not persisting after change of item-content


i had an item “KNX_Stati_Status_Heizung” which states i recorded with a persistence. This had Percentage values in there and all was fine.
Yesterday i changed type of controller and it is now only generating ON/OFF as a switch. So i tried, had problems and so i deleted the item and recreated it with same name as a switch item.
The item gets the states correctly from knx. The problem i have is that it is not persisting the values any more.
For persistence im using a group named gpersist and this is attached to the item.

If im greping the Log then im getting this:

grep KNX_Stati_Status_Heizung /data/openhab/openhab_userdata/logs/openhab.log
com.influxdb.exceptions.UnprocessableEntityException: failure writing points to database: partial write: field type conflict: input field "value" on measurement "KNX_Stati_Status_Heizung" is type integer, already exists as type float dropped=1

Is there a possibility to correct this for not losing the history or is the only solution to use a new name for avoiding this?

You can’t really change the type of an Item and retain the history. You’ll either need to remove the old data so it can recreate the table space for the new Item type, or use a new Item name.

Alternatively you can use a transform profile to convert the ON/OFF to a percent value and keep the old Number:Dimensionless Item as is.

Thanks Rich. I created a new item now to have history too (accepting that graph is not in same measurement)