# Drop values befor they are stored to the DB

**URL:** <https://community.openhab.org/t/drop-values-befor-they-are-stored-to-the-db/170441>\
**Category:** Beginners\
**Created:** [September 18, 2026, 3:43pm UTC](https://community.openhab.org/t/drop-values-befor-they-are-stored-to-the-db/170441 "2026-09-18T15:43:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gottfried\_Hauer](https://community.openhab.org/user_avatar/community.openhab.org/gottfried_hauer/32/107419_2.png) [@Gottfried\_Hauer](https://community.openhab.org/u/Gottfried_Hauer)\
**Post date:** [September 18, 2026, 3:43pm UTC](https://community.openhab.org/t/drop-values-befor-they-are-stored-to-the-db/170441/1 "2026-09-18T15:43:45Z")

</div>

- Platform information:
  - Hardware: _Raspberry Pi 4_
  - OS: _Openhabian_
  - openHAB version: 5.2.1

I integrated my PV-Inverter with modbus tcp.  
This works fine.  
But somtimes the items get a hiccup and the values are full out of possible range of my inverter.  
So if I want to see gaph it destroys it because if the power is between 0-10 kw and I get one or two values wit 10 000.  
Now I have a sql script running with a cron job every 15 minutes to delete this values from the DB to be able to show a graph.  
Is there a possibility to drop this values befor they are stored.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [September 18, 2026, 5:57pm UTC](https://community.openhab.org/t/drop-values-befor-they-are-stored-to-the-db/170441/2 "2026-09-18T17:57:36Z")

</div>

There are two ways depending on whether you want to stop it even before it gets to your Item or whether you just care about the charts.

If the former, add the [state filter profile](https://next.openhab.org/addons/transformations/basicprofiles/#state-filter-profile) (note add-on needs to be installed) as a profile on the link between the Channel and the Item. You can define criteria to throw away values that are outside your defined thresholds so the Item doesn’t even change to the bogus value.

If the latter, the persistence configuration supports [filters](https://next.openhab.org/docs/configuration/persistence.html#filters). You can set criteria to exclude values from being saved.

---

<div class="post-metadata">

**Author:** ![Gottfried\_Hauer](https://community.openhab.org/user_avatar/community.openhab.org/gottfried_hauer/32/107419_2.png) [@Gottfried\_Hauer](https://community.openhab.org/u/Gottfried_Hauer)\
**Post date:** [September 19, 2026, 8:03pm UTC](https://community.openhab.org/t/drop-values-befor-they-are-stored-to-the-db/170441/3 "2026-09-19T20:03:49Z")

</div>

I used the persitence configuration filter and it works perfect.  
No glitches any more in the DB.  
Thanks a lot
