-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Add items, links and metadata elements for YAML configuration #4085
Conversation
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Thanks for working on the new config files.
items:
- name: TestGroup1
type: Group over this? items:
TestGroup1:
type: Group
Why this metadata:
- namespace: ns1
itemName: testItem
value: Foo
config:
key: newValue over this metadata:
itemName: testItem
config:
ns1:
Foo:
key: newValue
items:
type: Group
groupType: Switch but items:
type: Number:Energy I've spend quite some time on a sensible and user friendly suggestion. It seems that your suggestion is just yaml wrapper around the rest API or the internal openHAB API. |
If it's that discussion again, no. |
I'd really hate to see us never get this capability. If there is anything I can do here to change you mind please let me know. I can police the thread, reviews, what ever. @spacemanspiff2007, don't let perfection become the enemy of progress. Any support for a YAML way to support definition of these things is a huge improvement. I don't see anything here that changes that assessment.
Frankly, isn't is better to get something out and working and then it can be refined once we get some actual user feedback? And if I understand the intent correctly, the purpose of the required version field, is so that in the future we can actually change everything you've brought up, if it were deemed appropriate, without breaking backwards compatibility. So it's not like we are stuck with this as it is first implemented. From what I can tell, this is fantastic! I hope it's not all for naught. |
|
Textual configuration is openHABs unique selling point and if you look at the forums there are many users who choose openHAB deliberately do so because of the ability to configure (almost) everything in files.
No, configuration may never be close to code. It's always an abstraction made for humans while code is an abstraction made for machines. If it's close to code it will be impossible to change the code without breaking the configuration. That will result in either many required configuration changes or code that is effectively locked and can never be improved or changed.
I get the idea but in my experience this has never properly worked out. If it's a backwards compatible change missing values will be created with a default value so the old configuration is still valid. If it's a backwards incompatible change (e.g. additional required field) it's impossible to create a valid configuration from the old file so the user has to modify the file anyway.
It's because you made it that way. We have a unique identifier (
But there you can have multiple entries for the same name, that's different.
But in UI it's an automatically generated text field and does not have to be entered by hand.
You could also allow a As of metadata I don't care about the With the current state of the PR this one liner (wrapped around for readability) becomes 18 lines of yaml code.
items:
- name: light_temp
type: Dimmer
label: Light
groupNames:
- BedroomLights
tags:
- Light
links:
- itemName: light_temp
channelUID: zwave:device:controller:node3:switch_binary
metadata:
- namespace: autoupdate
itemName: light_temp
value: false
- namespace: homekit
itemName: light_temp
value: Lighting.ColorTemperature
config:
minValue: 50
maxValue: 400 This would be a great intermediate file format to e.g. create items and things from json and it would be great to have something that works that way. There everything can be aligned to code and that's not a problem because it's something that will be machine generated anyway (since json is a machine-to-machine format). Additional tooling could then just create the jsons and openHAB will load them accordingly. On the other hand if it would be possible to set/reset the But the current state of the yaml format is not very human friendly and the configuration files are meant to be edited by humans.
Just because I'm a more vocal user doesn't mean that I'm not an "actual user" or that my points are invalid or overblown. There are also many other ways to get feedback, e.g. make a small pilot, make a questionnaire on the forums with different configuration snippets and different ways of configuring something. Testing with a final product is always the worst idea because changes will always break something for someone and it's a lot of effort for everyone involved, especially the developers. |
I give up. Do it better. I don't need it. I'll now promote to remove textual configuration completely the next time XText blocks progress on other parts. |
So ultimately, we are at the position that if it doesn't come out fully formed like Athena from Zeus's forehead, you'd rather not have anything at all and you want to litigate each and every little detail. Well, congratulations, you've gotten your wish. Note, this wasn't proposed as a complete replacement for the existing file formats right now. It was going to run in parallel at least until OH 5 (if not beyond). In fact it was "a small pilot" similar to the Experimental Rules Engine was in OH 2. But you killed it before it got out the gate.
Unless someone else picks this up (which I frankly don't see happening) an alternative file format is dead. You've done no favors to the file config loving OH users. And this completely ignores the benefit that would occur from having the contents of the Code tab in the UI match the contents of the YAML file, making going back and forth super easy and providing a migration path in both directions. That alone would be hugely attractive to many users even if the file format were obscenely obtuse and verbose. It could be XML and the fact they match would be hugely attractive. This also completely ignores that without some change along these lines, there is no path to editing text file configs from the UI, something else that is hugely attractive. I'm a user too. And I frankly was really looking forward to this. It was going to solve so many problems, or at least be the first step towards solving a bunch of problems. Now I see no path towards:
I'm certainly not going to rage quite over this but closing the door on the above (and more) because it's not perfect right now seriously makes me consider stepping back from the platform. I don't see a path forward where OH can grow as a whole and the text file based users experience and managed config users will continue to drift apart to the point where the two are using two completely different platforms. |
Related to #3666
This adds the
items
,links
andmetadata
elements. This allows to use YAML to configure everything that could be configured in.items
files. Currently only read-only access is allowed.