How do I use Exec Transformation properly? Need help please

Need help with Exec - Transformation Services | openHAB

The command is: Python C:\openHAB\conf\scripts\ %s

I have placed it in the whitelist file. I also created an exec command thing and in the command box I placed the same command. I receive mqtt messages and it’s stored to this one item, and in the item config, there’s the option for profiles. I selected EXEC there and put the same command in the command box. I don’t think this is the right way to do this, as this isn’t working.

How do I use exec transformation properly to transform incoming mqtt message or value stored in item to something else using an external program (python for example) to update the value of the item?

here’s the simple, basic script im using for testing/learning exec:

import sys
inpt = sys.argv[1]
sys.stdout.write(inpt.upper()) #or use print()

I create a set of test files to check how it works on a Pi:

Thing exec:command:dht [command="/etc/openhab/scripts/", interval=15, timeout=5, autorun=true] ( creates a md5sum out of the current date time ) :

/usr/bin/date | /usr/bin/md5sum | /usr/bin/cut -d" " -f1


String Dht11 "[%s]" {channel="exec:command:dht:output" [profile="transform:EXEC", function="/tmp/upper %2s"]}


import sys
inpt = sys.argv[1]
sys.stdout.write(inpt.upper()) #or use print()

Afterwards events.log contains:

2022-06-30 21:48:09.283 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Dht11' changed from BB4434D66B806220BCB306F1B134E1D0 to 2E2C205392EAF5D418D60B1C6CA3B380
2022-06-30 21:48:24.386 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Dht11' changed from 2E2C205392EAF5D418D60B1C6CA3B380 to C3F9E95E93E8844EEE42617B81BE50B4
2022-06-30 21:48:39.488 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Dht11' changed from C3F9E95E93E8844EEE42617B81BE50B4 to 1555BA34641B9944B958EF7D171D7488
2022-06-30 21:48:54.589 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Dht11' changed from 1555BA34641B9944B958EF7D171D7488 to 725222A7A5142A22DB94A225981D88DB