Python Scripting Next [5.0.0.0;5.1.0.0)

This add-on is a preview version of the next Python Scripting release.

It contains all features of the official Add-on, plus many changes, described below.

Maybe an openhab restart is necessary, if jsscripting is installed in parallel

Quick Start

  1. Uninstall any active “Python Scripting” Add-on
  2. Click “Install” or copy Kar file to your “/addons” folder
  3. Restart openhab (optional)

Documentation

Please refer the Add-on README or the Helper Lib README

If you have question, feel free to post it on the discussion thread

Ressources

Kar file (OH5.0+)

Source code

Last published Date

Last Update: 26.10.2025 08:51

Changelog

Version 26.10.2025 08:51

Add-on changes

  • Same codebase as merged version in openHAB 5.1 Milestone 2
  • Update helper lib to version 1.0.11

Helper lib 1.0.11 changed

  • Stable rule uid generation
  • Fix version parsing

Version 23.08.2025 16:07

Add-on changes

  • Fix deployment on openhab > 5.0.x

Version 11.08.2025 07:30

Add-on changes

  • Type hint generator fixes
    • Remove instanceid from generated value representations
  • Update helper lib to version 1.0.7

Helper lib 1.0.7 changed

  • BREAKING CHANGE openhab.Timer removed.
    • Can be replaced with default Threading or Timer implementation.
    • No need to register shutdown procedure in the lifecycleTracker anymore
    • Old timer can be found as an example

Version 09.08.2025 10:27

Add-on changes

  • Type hint generator fixes
    • Path handling on windows
    • Fix for dictionaries
    • Fix nested lists
    • Fix for type parameters
  • Pip console command fixed

Version 08.08.2025 15:00

Add-on changes

  • Fix internal addon log prefix (without .py) to align with script file log prefix
  • Added Type Hint Stub Generator as new console command
  • Fix update check console command
  • Fix ‘update install latest’ command, if a newer preview version was manuell installed
  • Update helper lib to version 1.0.6

Helper lib 1.0.6 changes

  • Register lifecycleTracker dispose hook only if a Timer is used
  • Global ZonedDateTime to datetime conversion. ZonedDateTime & Instant is now a registered interop_type
  • Add Registry.removeItem, Item.getThings, Item.getChannels, Item.getChannelUIDs, Item.getLinks, Item.linkChannel & Item.unlinkChannel => API documentation
  • Improved error logs for catched java exceptions in python.
  • Fix simple rule decorator (rule instead of rule()). Both variants works now.
  • Preview for type hinting (autocompletion)
  • BREAKING CHANGE: Changed parameter of Registry.addItem
  • BREAKING CHANGE: Replace NotInitialisedException with NotFoundException for getItem, removeItem, getThing, getChannel

Version 02.08.2025 14:05

Add-on changes

  • Implement State data type mapping
  • Removed Item conversion, as the Add-on works now with “real” items on python side
  • Fix dependency watcher in case of using compiled pyc files
  • Fix ScriptEngine reinitialisation (in Transformation Services) after Add-on updates
    • Hopefully no “Context execution was cancelled” Exceptions after Add-on updates anymore
    • An Add-on update should work now without any exception (the old one can still raise an exception on shutdown) or openhab restart
  • Additional simplification of PythonScriptEngine & GraalPythonScriptEngine (~20% less code) => easier to understand for other people
  • Refactored VFS
  • Update helper lib to version 1.0.5

Helper lib 1.0.5 changes

  • Removed “Python => Java” type conversion for sendCommand and postUpdate. Is now handled inside the Add-on in a more generic way.
  • Replace error message TypeError: invalid instantiation of foreign object with a more helpful description like One of your function parameters does not match the required value type.
  • Initial integration tests started

Version 27.07.2025 16:15

Add-on changes

  • Rename generic feature name for marketplace deployments
  • Helper lib update to version 1.0.4

Helper lib 1.0.4 changes

  • Renamed rule profile option to profiler_enabled
  • New rule runtime_measurement option

Version 24.07.2025 15:29

Add-on changes

  • improved logging & debugging
  • fixed handling of config changes
  • Update helper lib to version 1.0.3

Helper lib 1.0.3 changes

  • Improved error messages for Java Foreign Objects
    • Old like “foreign object has no attribute ‘test’”
    • New like “Java instance of ‘org.openhab.core.types.UnDefType’ has no attribute ‘test’”
  • Improved java <=> python type conversion
    • Proxy classes for Item, State, Thing, Channel, HistoricItem are now real ChildClasses of Java Foreign Objects
    • As a result, much more object function results are transparently converted value, like datetime <=> ZonedDateTime
  • Refactored and cleaned Metadata handling
    • Registry.getItemMetadata => Registry.getItem().getMetadata().get
    • Registry.setItemMetadata => Registry.getItem().getMetadata().set
    • Registry.removeItemMetadata => Registry.getItem().getMetadata().remove & Registry.getItem().getMetadata().removeAll
  • BREAKING CHANGE
    • State ‘DateTimeType’ is not converted to a datetime anymore. Instead it stays as a ‘DateTimeType’, but the method getZonedDateTime returns a datetime. This leads to a much more consistent behavior.
    • Metadata API changed
    • Registry.safeItemName move to Item.buildSafeName

Version 21.07.2025 15:06

Fix missing feature warning against latest openhab release

Version 20.07.2025 13:39

Renamed kar file to match the marketplace requirements regarding a stable link

Version 19.07.2025 20:24

Added missing feature dependencies to kar file

Version 19.07.2025 09:10

Add-on changes

  • Refactor, cleanup and simplify GraalPythonScriptEngine
  • Check timezone settings and print a warning on discrepancies
  • Improved datetime to Java ZonedDateTime mapping
  • Fix missing i18n translations for binding config
  • Update helper lib to version 1.0.2

Helper lib 1.0.2 changes

  • Refactor and simplify object type mapping.
    This results in a generic solution, wich covers all functions, including upcoming, not yet existing ones.
    Means functions in newer openhab versions are without any update correctly handled.
  • Fixed internal bundle version parsing for beta, milestone or rc versions

Version 15.07.2025 22:02

Add-on changes

  • Fix datetime (with and without timezone) usage as function parameter
  • Fix and generalize type mapping between java and python
  • Update helper lib to version v1.0.1

Helper lib 1.0.1 changes

  • fixed persistence extension handling
  • cleaned and generalized value type mapping

Version 14.07.2025 12:30

  • Refactored helper lib deployment
  • Support for additional graalpy features
    • VEnv setups
      • “pip” and preinstalled “modules”
      • Support for native modules
  • OSGI Console support
    • Show additional add-on infos
    • Open an interactive python console
    • Run “pip” to install additional python modules (only if venv is enabled)
    • Update and rollback of helper lib module
  • Update helper lib module to v1.0.0

Version 18.06.2025

  • Official version merged into openhab
1 Like

This thread is only for marketplace updates. For discussion use our Python3 Binding Thread

@holger_hees Just working on integrating your Python section into the release blog post, I think it would be better to rename this here Python Scripting Beta to avoid confusion among users.
Also mention clearly what’s the advantage of that version, I will remove that section from the blog post as we have to keep it short.

1 Like