# How to disable and enable things by script?

**URL:** <https://community.openhab.org/t/how-to-disable-and-enable-things-by-script/97111>\
**Category:** Scripts & Rules\
**Created:** [April 20, 2020, 8:46pm UTC](https://community.openhab.org/t/how-to-disable-and-enable-things-by-script/97111 "2020-04-20T20:46:20Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [April 30, 2020, 1:21pm UTC](https://community.openhab.org/t/how-to-disable-and-enable-things-by-script/97111/7 "2020-04-30T13:21:43Z")

</div>

Example rule here

> [@Modbus error management in openHAB](https://community.openhab.org/t/modbus-error-management-in-openhab/73185/3):
>
> Positive action Having seen that the error/timeout/retry loop can cause performance loss for survivors, and done what we can to optimize the loop, there is one more trick we could use. Simply not to enter the loop, or at least not so often. We’ve optimized our polling rate for normal use of course, but if we greatly reduce polling further after we’ve encountered a fault - we will also greatly reduce those time wasting error loops. We should still retry once in while, hoping that fault has been …

---

_[View the full topic](https://community.openhab.org/t/how-to-disable-and-enable-things-by-script/97111)._
