Skip to content

Conversation

@dilyanpalauzov
Copy link
Contributor

@dilyanpalauzov dilyanpalauzov commented Oct 15, 2025

… because the loaded script is in Xbase, in Xbase everything is an expression, there are no statements.

In any case, here a test: in openhab/scripts/a.script I put

logError('A', "STARTED")
7

and in rules/z.rules

rule "change"
when Item r3 changed
then
  logError("B", "when Item r3 changed")
  logError("D", "M " + callScript("a"))
end

Then I get in openhab.log:

2025-10-15 19:30:56.904 [ERROR] [org.openhab.core.model.script.A   ] - when Item r3 changed
2025-10-15 19:30:56.932 [ERROR] [org.openhab.core.model.script.B   ] - STARTED
2025-10-15 19:30:56.935 [ERROR] [org.openhab.core.model.script.D   ] - M 7

so the value 7 (last line/exrpession of the script) was received by the rule.

@netlify
Copy link

netlify bot commented Oct 15, 2025

Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).

Built without sensitive environment variables

Name Link
🔨 Latest commit d2e3d88
🔍 Latest deploy log https://app.netlify.com/projects/openhab-docs-preview/deploys/68efcd4bcc76f80008deb1ec
😎 Deploy Preview https://deploy-preview-2586--openhab-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@stefan-hoehn
Copy link
Contributor

Github is not the place to ask questions. Please discuss these in the forum.

@dilyanpalauzov
Copy link
Contributor Author

This question is irrelevant to the change.

@stefan-hoehn
Copy link
Contributor

The please update the description that it only relates to the change.

@dilyanpalauzov
Copy link
Contributor Author

I have changed the description, but I do not see big value in changing the description.

@stefan-hoehn
Copy link
Contributor

As mentioned in the other PR: Everything you say and is asked in the description needs to be reviewed and discussed before a PR can be merged. Therefore, keep unrelated questions out of the PR to make the maintainer's life easier. Otherwise, it will take much longer until a simple PR might be merged.

@florian-h05 florian-h05 added this to the 5.1 milestone Oct 27, 2025
@florian-h05 florian-h05 changed the title callScript() returns a value ScriptExecution actions: callScript() returns a value Oct 27, 2025
@florian-h05 florian-h05 merged commit 701d6bc into openhab:main Oct 27, 2025
5 checks passed
@dilyanpalauzov dilyanpalauzov deleted the callscript_returns_value branch October 28, 2025 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants