-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event data payload differs from UI to file-bases rules #111
Comments
Whilst that would technically work in this case, my fear is that due to there being different implementations triggering the rules, this is only a hack rather than a proper solution. It won't fix all differences (e.g. can you use const in UI rules yet?), and may also break if the current wrapping code changes. As for whether it's possible to inject this transparently, sure, it's possible. |
So you would not advise to inject or add that to the top of MainUI scripts? By the way, I found one more difference between UI and file based: UI based scripts do not reload on changes in |
yeah to my knowledge |
Probably not, no. The real* problem here is that the script execution environment differs (e.g. the *The real problem may actually be the semantic meaning of file-based and UI-based scripts differ. File-based scripts are run at startup and reload time (only) and register things that they want, like rules and triggers, somewhat like a system-based plugin may do. UI-based scripts are executed based on a specific action that occurs in OH, but their execution is typically ephemeral and stateless. I'm not sure that we've spent the time thinking about how these two things interact and complement each other - we are kind-of squinting and saying that File and UI doesn't matter and they are the same thing, but they're probably not. |
Does the workaround in the first post work for thing status update triggers? |
Closing as we won‘t fix this here as this is related to openHAB Core. |
As already noticed in some PRs (#106, #110), the
event
object differs from UI-based to file-based rules.In file-based rules the event data is "formatted" by
getTriggeredData(input)
.A solution to unify the event object of both would be to simply expose the above mentioned function and to advise the user to add the following on top of his UI rules:
Is there any way to put automatically add content to UI scripts?
WDYT @digitaldan @jpg0 ?
The text was updated successfully, but these errors were encountered: