-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Proposal to suggest file syntax for things and items to users #4509
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: |
But why? If you want to use discovery, why would you chose file based config? If the proposed syntax can't be autogenerated from the model I would vote against that feature - there is a high risk of forgetting the correct adjustments when the model is updated. |
Discovery is useful to get values of thing parameters you cannot guess (like for example the node id for a Matter node).
As you know this is very complex (to not say impossible) to implement, this "requirement" looks to me like an argument just to make no progress in this direction while at the same time the file syntax for things and items is very stable over the recent years and a specific generation would be relatively easy to implement. Rejecting the change just because it is not technically absolutely the perfect solution is a pity while at the same time it could be so helpful for a massive number of users. But Ok I will not insist more. |
That's being said, I will check if I can build the model to generate the test result. |
Personally, I'd rather see a convergence between the syntax shown in MainUI and the text configs. This feels like a work around for the fact that both have very different formatting and syntax. If what you saw in the code tab in MainUI was the same as what you would use in a .things file (or whatever that becomes) this wouldn't be needed. Moving between managed and file based configs would be very straight forward. |
@lolodomo great suggestion! I welcome this!
Another surprising case I've found is that some things use undocumented properties, even as the representation property! This leads to inboxes with things that aren't matched with the corresponding file based thing configuration. Making these properties visible to users of file based configuration is crucial, preferably through corrected documentation.
A similar feature (UI only) was PRed by me a week ago; openhab/openhab-webui#2920 |
This is a different story. You know how this story ended the last time so I doubt there will be someone else motivated to make a new try before 5.0 is released. |
This is similar to what I have in mind for inbox but we need an API that the UI will call to retrieve the generated code from the server. This is what I propose. |
I updated my initial proposal to simplify the UI part. The UI part is I assume trivial to implement by @openhab/webui-maintainers when you see what they are able to do. Probably just few minutes of work for them. Here is the update: New REST endpoints:
In Main UI, several options are possible but here is what I imagine as the easiest:
|
Funny thing is very early versions in the UI had a feature I tried to make where you could retrofit a managed Thing into a .things file entry: I abandoned the idea because it was buggy and unreliable, and couldn't work with client-side code only for inbox entries (you had to add it is a real Thing first) so wasn't worth the maintenance burden. Great place to again plug my pipe dream to have a YAML-based declarative object management system à la Kubernetes which would let you organize your configuration by functional domain (i.e. multi-object YAML files and/or folders) rather than by object types. I think it could be a perfect major feature to accompany a major release 🙂 (but again, probably a pipe dream) |
Please guys, you have #3666 to discuss YAML in case you want to reopen the discussion and find someone to implement it. We are not discussing here what should be the new file format but how we can help users by generating the file code and show it to them as suggestion. Of course, this would be the current file syntax but if one day the file syntax is changed to a new format this will become this new file format. |
Your proposal for the UI sounds good and should be straightforward to implement 👍 |
I can include a file format parameter in the API and implement the file generator in a service so that adding a new file format in the future (YAML for example) could simply consist in implementing a new class (service). |
I made very good progress and already made a POC with things and items. It is finally possible to build the DSL model from a Thing or Item object and then just request the saving of the built model to retrieve the original syntax we are looking for. I will create a WIP PR very soon after Christmas to show how it is simply done and also to show that any new format could be added later just by implementing an additional service. The API provides a "format" parameter to select the output format which is currently "DSL" by default. I find all this just so amazing that I regret not having done it earlier. This would be a great feature for OH5 in the sense that it would help so many users. |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
I would like to add a new feature that would be, I believe, very useful for users (at least those interested by having their things/items defined in config files. The idea is to have in Main UI showing the suggested config file syntax for any thing/item.
What I propose is to add in core framework the following REST endpoints:
I will also extend console commands to provide the same features.
In Main UI, several options are possible but here is what I imagine as the easiest:
WDYT ?
@florian-h05 in particular for the feedback regarding Main UI/
The text was updated successfully, but these errors were encountered: