# Scripts & Rules

**URL:** https://community.openhab.org/c/setup-configuration-and-use/scripts-rules/13.md

[Latest](https://community.openhab.org/latest.md) · [Categories](https://community.openhab.org/categories.md) · [Tags](https://community.openhab.org/tags.md)

---

## [About the Scripts & Rules category](https://community.openhab.org/t/about-the-scripts-rules-category/37)

<div class="topic-metadata">

**Author:** [@Henry](https://community.openhab.org/u/Henry)\
**Replies:** 0\
**Last updated:** [August 8, 2015, 2:08pm UTC](https://community.openhab.org/t/about-the-scripts-rules-category/37 "2015-08-08T14:08:11Z")

</div>

All questions and discussions around scripts, rules, (official) helper libraries and automation add-ons.

---

## [JRuby Scripting Official Helper Library](https://community.openhab.org/t/jruby-scripting-official-helper-library/145072)

<div class="topic-metadata">

**Author:** [@jimtng](https://community.openhab.org/u/jimtng)\
**Replies:** 41\
**Last updated:** [August 23, 2026, 1:42am UTC](https://community.openhab.org/t/jruby-scripting-official-helper-library/145072 "2026-08-23T01:42:28Z")

</div>

The JRuby helper library is a comprehensive Ruby gem designed to enhance automation in openHAB. It is installed by default by the official JRubyScripting add-on. It offers a streamlined syntax for writing file-based and…

---

## [openHAB JavaScript library releases](https://community.openhab.org/t/openhab-javascript-library-releases/144137)

<div class="topic-metadata">

**Author:** [@florian-h05](https://community.openhab.org/u/florian-h05)\
**Replies:** 36\
**Last updated:** [April 7, 2025, 2:25am UTC](https://community.openhab.org/t/openhab-javascript-library-releases/144137 "2025-04-07T02:25:52Z")

</div>

Dear community, we have just released a new version of the openHAB JavaScript library: version 5.13.0 :partying\_face: What’s new in 5.13.0 & 5.12.0 These releases add our first configuration as code features – you can …

---

## [🎮 - Yes, I still play Destiny 2 ... AI-Powered Game Server Status in Your Smart Home](https://community.openhab.org/t/yes-i-still-play-destiny-2-ai-powered-game-server-status-in-your-smart-home/168662)

<div class="topic-metadata">

**Author:** [@patrik\_gfeller](https://community.openhab.org/u/patrik_gfeller)\
**Replies:** 2\
**Last updated:** [November 5, 2026, 6:45pm UTC](https://community.openhab.org/t/yes-i-still-play-destiny-2-ai-powered-game-server-status-in-your-smart-home/168662 "2026-11-05T18:45:53Z")

</div>

Hi, Destiny 2 might (probably will fade away) - but AI :brain: probably won’t … here an inspiration how you can use AI technology to get more useful, localized information for your screens. P.S.: I’m learning at the …

---

## [Calling Thing Actions from a blockly rule](https://community.openhab.org/t/calling-thing-actions-from-a-blockly-rule/169908)

<div class="topic-metadata">

**Author:** [@TrapperJohn](https://community.openhab.org/u/TrapperJohn)\
**Replies:** 7\
**Last updated:** [November 5, 2026, 12:18pm UTC](https://community.openhab.org/t/calling-thing-actions-from-a-blockly-rule/169908 "2026-11-05T12:18:31Z")

</div>

Hi, I have a bluelink Car connected to my openhab and would like to start the heating/ cooling from a blockly rule. The Car only accepts thing actions to do that. When calling the actions directly from the thing page e…

---

## [Cannot invoke method public abstract float java.lang.Number.floatValue() on null](https://community.openhab.org/t/cannot-invoke-method-public-abstract-float-java-lang-number-floatvalue-on-null/170853)

<div class="topic-metadata">

**Author:** [@TomW80](https://community.openhab.org/u/TomW80)\
**Replies:** 4\
**Last updated:** [November 3, 2026, 11:55am UTC](https://community.openhab.org/t/cannot-invoke-method-public-abstract-float-java-lang-number-floatvalue-on-null/170853 "2026-11-03T11:55:57Z")

</div>

Platform information: openHAB version: 5.2.3 I have the follow rule: rule "Wasserverbrauch Tag Woche Monat Jahr" when Item rawwater changed then …

---

## [Somrig-Button with zigbee2mqtt - rule triggered twice](https://community.openhab.org/t/somrig-button-with-zigbee2mqtt-rule-triggered-twice/164406)

<div class="topic-metadata">

**Author:** [@dniklas1](https://community.openhab.org/u/dniklas1)\
**Replies:** 11\
**Last updated:** [November 1, 2026, 5:06pm UTC](https://community.openhab.org/t/somrig-button-with-zigbee2mqtt-rule-triggered-twice/164406 "2026-11-01T17:06:04Z")

</div>

I have the Somrig button from Ikea. I integrated it into openHAB using zigbee2mqtt. It’s the following zigbee2mqtt device: IKEA E2213 control via MQTT | Zigbee2MQTT Now I want to trigger a rule when Button1 is clicked. …

---

## [Transfer of openHAB Chat response as voice output on a iPhone](https://community.openhab.org/t/transfer-of-openhab-chat-response-as-voice-output-on-a-iphone/170735)

<div class="topic-metadata">

**Author:** [@dk8pn](https://community.openhab.org/u/dk8pn)\
**Replies:** 7\
**Last updated:** [October 26, 2026, 10:40pm UTC](https://community.openhab.org/t/transfer-of-openhab-chat-response-as-voice-output-on-a-iphone/170735 "2026-10-26T22:40:40Z")

</div>

Am on OH 5.3.0.M3 on a Windows11 computer. My goal: to use the openHAB chat feature (core) similar as Alexa. Ask or command something using the iPhone’s voice input for the openHAB chat and get a voice response through …

---

## [Execute a simple HTTP Action from JS script](https://community.openhab.org/t/execute-a-simple-http-action-from-js-script/170766)

<div class="topic-metadata">

**Author:** [@chmre](https://community.openhab.org/u/chmre)\
**Replies:** 3\
**Last updated:** [October 24, 2026, 5:24pm UTC](https://community.openhab.org/t/execute-a-simple-http-action-from-js-script/170766 "2026-10-24T17:24:30Z")

</div>

ubuntu server openHAB 5.2.3 After reading several posts I’l like to ask for help. I have a display where I want to push the state of an openHab item. if I run the code below in a web browser, the display acts as desie…

---

## [Unifi - UTR Monitor Travel Router Teleport Device](https://community.openhab.org/t/unifi-utr-monitor-travel-router-teleport-device/170677)

<div class="topic-metadata">

**Author:** [@jwiseman](https://community.openhab.org/u/jwiseman)\
**Replies:** 0\
**Last updated:** [October 13, 2026, 11:14am UTC](https://community.openhab.org/t/unifi-utr-monitor-travel-router-teleport-device/170677 "2026-10-13T11:14:26Z")

</div>

What device type do I need to setup to monitor a Unifi Travel Router using Teleport (UTR) ? It’s not listed below: UniFi Network — wireless / wired clients, WLANs, PoE ports, access points, sites, vouchers. UniFi Prot…

---

## [Rule engine - system levels not working I think](https://community.openhab.org/t/rule-engine-system-levels-not-working-i-think/170608)

<div class="topic-metadata">

**Author:** [@Pedro\_Liberal](https://community.openhab.org/u/Pedro_Liberal)\
**Replies:** 4\
**Last updated:** [October 8, 2026, 4:20am UTC](https://community.openhab.org/t/rule-engine-system-levels-not-working-i-think/170608 "2026-10-08T04:20:15Z")

</div>

Platform information: Docker openHAB version: 5.3 Issue of the topic: Hey everyone, I’ve been playing around with the system levels to start certain rules, and one very basic is to restart my zigbee controller afte…

---

## [JS Scripting: how to define a scene in a .js file (equivalent to a UI scene)?](https://community.openhab.org/t/js-scripting-how-to-define-a-scene-in-a-js-file-equivalent-to-a-ui-scene/170605)

<div class="topic-metadata">

**Author:** [@milo](https://community.openhab.org/u/milo)\
**Replies:** 3\
**Last updated:** [October 6, 2026, 10:09am UTC](https://community.openhab.org/t/js-scripting-how-to-define-a-scene-in-a-js-file-equivalent-to-a-ui-scene/170605 "2026-10-06T10:09:27Z")

</div>

Hi all, I’m running openHAB 5.3M1 with the JavaScript Scripting add-on (openhab-js). When I create a scene in Main UI, the code tab looks like this: items: Rollershutter\_GF\_Diningroom\_WindowCoveringOne: "100" Roll…

---

## [Using Quantity with block library](https://community.openhab.org/t/using-quantity-with-block-library/170536)

<div class="topic-metadata">

**Author:** [@Dash](https://community.openhab.org/u/Dash)\
**Replies:** 14\
**Last updated:** [September 30, 2026, 1:24pm UTC](https://community.openhab.org/t/using-quantity-with-block-library/170536 "2026-09-30T13:24:48Z")

</div>

I’m trying to use oh\_quantity with a custom block library, but I’m not sure how to call the methods against the object passed in (i.e. they don’t seem to exist). I can print out the value of the passed in quantity (e.g.…

---

## [KNX Venetian blind tilt using an outdoor lux sensor: rule design advice](https://community.openhab.org/t/knx-venetian-blind-tilt-using-an-outdoor-lux-sensor-rule-design-advice/170385)

<div class="topic-metadata">

**Author:** [@SIXINSMART](https://community.openhab.org/u/SIXINSMART)\
**Replies:** 2\
**Last updated:** [September 25, 2026, 7:00am UTC](https://community.openhab.org/t/knx-venetian-blind-tilt-using-an-outdoor-lux-sensor-rule-design-advice/170385 "2026-09-25T07:00:27Z")

</div>

Hi everyone, I’m Brain from SIXINSMART, where I work on shading motors. I’m exploring an openHAB integration using our 35 mm KNX tubular motor, its external KNX control module and an outdoor illuminance sensor to adjust…

---

## [Getzoneddatetime' is not a member of 'org.openhab.core.library.types.DateTimeType'](https://community.openhab.org/t/getzoneddatetime-is-not-a-member-of-org-openhab-core-library-types-datetimetype/163849)

<div class="topic-metadata">

**Author:** [@michel53](https://community.openhab.org/u/michel53)\
**Replies:** 14\
**Last updated:** [September 20, 2026, 11:15am UTC](https://community.openhab.org/t/getzoneddatetime-is-not-a-member-of-org-openhab-core-library-types-datetimetype/163849 "2026-09-20T11:15:51Z")

</div>

Hi, for many of my DSL rules containing something like val dateTime = (Window\_Terasse\_Switch\_Last\_Open\_time.state as DateTimeType).getZonedDateTime(ZoneId.systemDefault()) I get the error message 2025-04-27 16:17:00.4…

---

## [REOLINK E1 Pro 3K - ability to control movement](https://community.openhab.org/t/reolink-e1-pro-3k-ability-to-control-movement/170310)

<div class="topic-metadata">

**Author:** [@jwiseman](https://community.openhab.org/u/jwiseman)\
**Replies:** 2\
**Last updated:** [September 2, 2026, 7:01pm UTC](https://community.openhab.org/t/reolink-e1-pro-3k-ability-to-control-movement/170310 "2026-09-02T19:01:51Z")

</div>

I just watched a YouTube video of home assistance controlling this camera, when not home it will point to the area. When home, it turns itself backwards so points to the wall. My question is this? Confirming there is …

---

## [Problem with JavaScript rule with SystemStartLevel not loading](https://community.openhab.org/t/problem-with-javascript-rule-with-systemstartlevel-not-loading/169571)

<div class="topic-metadata">

**Author:** [@nelson.aponte](https://community.openhab.org/u/nelson.aponte)\
**Replies:** 14\
**Last updated:** [August 24, 2026, 8:12am UTC](https://community.openhab.org/t/problem-with-javascript-rule-with-systemstartlevel-not-loading/169571 "2026-08-24T08:12:05Z")

</div>

Platform information: Hardware: Raspberry Pi 4 OS: CENTOS 9 Java Runtime Environment: OpenJDK version “21.0.10” 2026-01-20 LTS openHAB version: 5.1.3 Issue of the topic: A text-based rule with the SystemStartlevelTri…

---

## [Kudo for YAMLcomposer: Indicator and zigbee lights creation of items, groups, etc](https://community.openhab.org/t/kudo-for-yamlcomposer-indicator-and-zigbee-lights-creation-of-items-groups-etc/170091)

<div class="topic-metadata">

**Author:** [@Max\_G](https://community.openhab.org/u/Max_G)\
**Replies:** 9\
**Last updated:** [August 23, 2026, 11:15pm UTC](https://community.openhab.org/t/kudo-for-yamlcomposer-indicator-and-zigbee-lights-creation-of-items-groups-etc/170091 "2026-08-23T23:15:42Z")

</div>

This add-on “YAMLcomposer” rocks, at least for my use cases :slight\_smile: I only came across it when reading Reimplement my Sitemap (\>1000 Items) to WebUI using the yamlcomposer and yaml based widget templates . At fi…

---

## [How to evaluate an Item change based on source of change](https://community.openhab.org/t/how-to-evaluate-an-item-change-based-on-source-of-change/169715)

<div class="topic-metadata">

**Author:** [@ollo](https://community.openhab.org/u/ollo)\
**Replies:** 27\
**Last updated:** [August 21, 2026, 3:42am UTC](https://community.openhab.org/t/how-to-evaluate-an-item-change-based-on-source-of-change/169715 "2026-08-21T03:42:03Z")

</div>

Hi, How can I evaluate an Item change based on the source of the change? I have a Switch Item that can be changed either by a rule or manually in the sitemap. Is there an Item property that can be used as a condition in…

---

## [openHAB 5.2 only starts till StartLevel 100 on second starter after fresh boot](https://community.openhab.org/t/openhab-5-2-only-starts-till-startlevel-100-on-second-starter-after-fresh-boot/170177)

<div class="topic-metadata">

**Author:** [@GeVaSta](https://community.openhab.org/u/GeVaSta)\
**Replies:** 5\
**Last updated:** [August 20, 2026, 1:07pm UTC](https://community.openhab.org/t/openhab-5-2-only-starts-till-startlevel-100-on-second-starter-after-fresh-boot/170177 "2026-08-20T13:07:26Z")

</div>

I am on new and faster Windows 11 hardware and experience the following behavior. Every time a restart the MIniPC openHAB starts but only till Startlevel 50. Higher levels are not reached. Everything seems to work fine,…

---

## [JRUBY - Adding Group fails with csv Error](https://community.openhab.org/t/jruby-adding-group-fails-with-csv-error/169959)

<div class="topic-metadata">

**Author:** [@BrettLHolmes](https://community.openhab.org/u/BrettLHolmes)\
**Replies:** 4\
**Last updated:** [August 20, 2026, 7:38am UTC](https://community.openhab.org/t/jruby-adding-group-fails-with-csv-error/169959 "2026-08-20T07:38:23Z")

</div>

Platform information: openHAB 5.2 openhabian (trixie) Java Runtime Environment: OpenJDK 64-Bit Server VM (build 21.0.10+7-Debian-1deb13u1, mixed mode, sharing) Issue of the topic: attempting to add a group in jruby …

---

## [Excessive recompiling on almost every touch of item and sometimes rules](https://community.openhab.org/t/excessive-recompiling-on-almost-every-touch-of-item-and-sometimes-rules/169997)

<div class="topic-metadata">

**Author:** [@GeVaSta](https://community.openhab.org/u/GeVaSta)\
**Replies:** 150\
**Last updated:** [August 19, 2026, 5:28pm UTC](https://community.openhab.org/t/excessive-recompiling-on-almost-every-touch-of-item-and-sometimes-rules/169997 "2026-08-19T17:28:50Z")

</div>

Running openHAB 5.2.0 on Windows I notice the last time (months) a lot more recompiling of large numbers of items-files when changing a single item or sometimes changing a rule. I thought recompiling of items in other …

---

## [Blockly: How to extract the number from an item state?](https://community.openhab.org/t/blockly-how-to-extract-the-number-from-an-item-state/134364)

<div class="topic-metadata">

**Author:** [@ItsaBastI](https://community.openhab.org/u/ItsaBastI)\
**Replies:** 9\
**Last updated:** [August 19, 2026, 7:37am UTC](https://community.openhab.org/t/blockly-how-to-extract-the-number-from-an-item-state/134364 "2026-08-19T07:37:21Z")

</div>

OH 3.2 on a Pi4 I want to compare a number to a given value. In my case it’s the temperature (e.g. “17 °C”) to a number (e.g. 18). I set the temperature from the item state into a variable first, however the variable wi…

---

## [Passing variables to rules in OH 5.2.1](https://community.openhab.org/t/passing-variables-to-rules-in-oh-5-2-1/170079)

<div class="topic-metadata">

**Author:** [@scuba](https://community.openhab.org/u/scuba)\
**Replies:** 13\
**Last updated:** [August 14, 2026, 6:27pm UTC](https://community.openhab.org/t/passing-variables-to-rules-in-oh-5-2-1/170079 "2026-08-14T18:27:47Z")

</div>

593 / 5.000 Hello, I’m currently trying to migrate from OH 5.1.3 to OH 5.2.1. Unfortunately, it’s no longer possible to pass an argument to a called rule in JavaScript. For example, in the calling rule: rules.runR…

---

## [RiemanSum - adding up too much?](https://community.openhab.org/t/riemansum-adding-up-too-much/170003)

<div class="topic-metadata">

**Author:** [@JensA](https://community.openhab.org/u/JensA)\
**Replies:** 6\
**Last updated:** [August 12, 2026, 7:16pm UTC](https://community.openhab.org/t/riemansum-adding-up-too-much/170003 "2026-08-12T19:16:33Z")

</div>

I want to use riemanSum to get daily PV generation but the calculated sum seems too high. OpenHab 5.1.4 InfluxDb persistence BKW\_curpower is the power item value from the device, received via MQTT every 66 seconds. I…

---

## [The method getZonedDateTime() from the type DateTimeType is deprecated](https://community.openhab.org/t/the-method-getzoneddatetime-from-the-type-datetimetype-is-deprecated/160763)

<div class="topic-metadata">

**Author:** [@hr3](https://community.openhab.org/u/hr3)\
**Replies:** 40\
**Last updated:** [August 11, 2026, 9:23pm UTC](https://community.openhab.org/t/the-method-getzoneddatetime-from-the-type-datetimetype-is-deprecated/160763 "2026-08-11T21:23:12Z")

</div>

oH 4.3.0.M5 if (now.isAfter((Astro\_DaylightStart\_Time.state as DateTimeType).getZonedDateTime())) {... I use this statement and it works fine, but I get for every occurrence the topic info in the log. What is the corre…

---

## [5.2.1 doesn't fully start, no javascript, transformations](https://community.openhab.org/t/5-2-1-doesnt-fully-start-no-javascript-transformations/170062)

<div class="topic-metadata">

**Author:** [@jswim788](https://community.openhab.org/u/jswim788)\
**Replies:** 6\
**Last updated:** [August 11, 2026, 1:38pm UTC](https://community.openhab.org/t/5-2-1-doesnt-fully-start-no-javascript-transformations/170062 "2026-08-11T13:38:52Z")

</div>

I’m unable to get OH 5.2.1 to come up fully. 5.2.0 works fine. 5.2.1 starts up, but never gets javascript or transformations to run. I’ve stopped, cleaned the cache, and restarted, but no luck. If I stop, clean the c…

---

## [External curtains automation via Python Scripting Add-on - update](https://community.openhab.org/t/external-curtains-automation-via-python-scripting-add-on-update/170057)

<div class="topic-metadata">

**Author:** [@Giovanni\_Fabiani](https://community.openhab.org/u/Giovanni_Fabiani)\
**Replies:** 0\
**Last updated:** [August 10, 2026, 9:22am UTC](https://community.openhab.org/t/external-curtains-automation-via-python-scripting-add-on-update/170057 "2026-08-10T09:22:34Z")

</div>

Hi all, I had the need of automating external curtains based on three weather conditions like rain, wind gust and illuminance. I solved the issue with a Python script(via Python Scripting Add-on) as such: from openhab…

---

## [Locked rules](https://community.openhab.org/t/locked-rules/170027)

<div class="topic-metadata">

**Author:** [@ruxu](https://community.openhab.org/u/ruxu)\
**Replies:** 7\
**Last updated:** [August 8, 2026, 4:46am UTC](https://community.openhab.org/t/locked-rules/170027 "2026-08-08T04:46:44Z")

</div>

I used Github AI to create a rule for time conversion. When the rule was run it did not work as intended but instead it created about 35 similar rules that now are locked and can’t be deleted through the UI. The openHAB …

---

## [JRuby OpenHAB Rules System](https://community.openhab.org/t/jruby-openhab-rules-system/110598)

<div class="topic-metadata">

**Author:** [@broconne](https://community.openhab.org/u/broconne)\
**Replies:** 468\
**Last updated:** [August 3, 2026, 12:08am UTC](https://community.openhab.org/t/jruby-openhab-rules-system/110598 "2026-08-03T00:08:36Z")

</div>

JRuby OpenHAB Scripting The OpenHAB JRuby scripting helpers bring the power of the Ruby language to OpenHAB. Rather than being a pure pass-through to OpenHAB, they provide a Ruby-like experience when building automation …

[Next page](https://community.openhab.org/c/setup-configuration-and-use/scripts-rules/13.md?page=1)
