Next generation design : Ideas & Discussions


(David Graeff) #182

He’s not exactly talking about this topic, more about the generell forward direction as some things have changed.
Will still need to find a solution for this particular subject.


(Juelicher) #183

Blockquote
Unfortunately I can’t please Markus @mstormi in my proposal and let the current .thing / .item files stay as they are. XTend really needs to go. Starting up OH shouldn’t take half an hour for a decent setup.

I understand the need for removing XTend and I agree with that. I am also not opposed to change the file format, if this has benefits. ( so, not a total die hard old timer and btw. I just finished rewriting all of my rules in Jython). I just prefer having editable files in text format.

I agree with what rlkoshak wrote, some tools for making the migration easier would be needed, as nobody likes spending hours and hours, just to have I system with the exact same functionality as before.

What I would like to understand, just to get a better insight is, why there is such a big dependency between XTend and the current file syntax. Would it not be possible to rewrite the parser using one of the parser generators available? Of course this would leave the problem, that this solution would have to o be maintained by the openHAB developers.


(David Graeff) #184

That is possible. The grammar need to be written though. And there is still the problem that there is no tooling for our custom syntax. xTend is not the only problem. There is no file writer existing for exporting the internal openHAB state back to files. And if you read through the forum you will find especially newcomers to struggle with the syntax. It is not structured enough, to be honest. But you will find all of this discussed in this thread already.


(Malte Wedel) #185

I am completely new to OpenHAB, just installed a week ago. I tried to use PaperUI for about 2 hours, before I gave up on it and switched to edit files in /etc/openhab2 - not just because I have to use some v1 bindings, but because of the amount of clicks/interactions needed to add things/items and the fact that it does store the created objects in a different location than /etc.

If there was an editor in the browser UI which is editing the files in /etc, that supports syntax highlighting and is showing contextual help for the type of object I am currently editing, so I don’t have to open a browser window next to it, I would use it.


(Rich Koshak) #186

It’s really Xtext I think which is the base language parser that is used to define the syntax for both. In short, we currently have the exact situation you describe with Xtext being the parser generator that was used for the config files. Xtend is a programming language whose parser was also generated using Xtext.

So moving to some other parser generator doesn’t really improve things all that much because we are still on the hook to maintain a custom grammar and reliant on a single source for the parser generator libraries.

And the parser generator only gives you half of the problem (reading). We still need to be able to write in order to have a migration path between text and UI configs.

In short, IMHO, moving to some other parser generator will be a lot of work for very little long term benefit.


(Branden Smale) #187

Though I’m only halfway through the thread, as a user since 1.5, I would prefer a GUI solution. I’m on board with your solution.


(David Graeff) #188

My proposal is online: Next generation design: Paper UI design study


(Michael Parment) #189

When Paper UI arrived i started to use GUI for both things and items.
After a while i went back to text files depending on that i had to recreate many things when i updated different bindings- When i use text files i do not have to recreate things when updating.

I we can solve that issue i think it is best for general users (the ones that is not daily here :smile: ) to use gui for configuration.

/Mike


(David Graeff) #190

Yes that’s a known issue in the core that hopefully is resolved some day. In the meantime a simple “Recreate that Thing” action in the openhab-cli or via GUI would already be helpful.


(Christian W) #191

+1 yes would be really helpfull :slight_smile:


(Jan N. Klug) #192

And perhaps (should be easy if the other thing can be done) „change thing type“.


(John Chiasson) #193

Aren’t comments an issue with JSON currently? Does yaml allow comments?


(Hilbrand Bouwkamp) #194

Yaml supports line comments. Json doesn’t. However gson the json parser used by oh does support al kind of commennts. Reading is one thing, writing yaml or json removes all comments.


(David Graeff) #195

I have put together a “roadmap” document and one point on it is to let Things/Items/Scheduled-Tasks have a generic comment/annotation. When presented in textual form to the user I thought about pulling that field out and put in front of the object, like so:

Database form:

{
  id:"abc",
  some: "value",
  annotation: "my little comment"
}

Textual form (yaml in this case):

# my little comment
abc:
   some: value

WDYT?


(John Chiasson) #196

Looks good David. IMHO, I can’t remember what I did last week without comments in the files :slight_smile: