Launch external editor for YAML files

Let’s put it otherwise.
Hereunder, I’ve made changes which are obvious mistakes.

What is that editor doing above a plain text editor until I press “Save”?

EDIT: Actually, those changes were made with the actual server offline, so the editor is purely client-sided, so no question of serialization-deserialization of HA objects at all, here (still, until we press “Save”)

Maybe you still aren’t following what I’m say. I may not be using nomenclature that you’re used to. The objects are objects in memory, on your browser. When you change between views a function is called, lets pretend it’s toString() and it changes from the object to something that looks like YAML. It does not actually call any yaml functions to “convert it”.

I.e. if we actually had json with dictionaries and lists, we could serialize it to actual yaml without ever hitting [object Object] because it has a structure that can be serialized.

This is all done for speed to avoid said conversions for the editors in the UI.


Can this request be done, sure. If we reinvent it from the ground up and pass the string back and forth, but there’s no IO done with the editor. It’s straight objects at all times until you save. Making the outside software not have the same functionality at all.


There would need to be some open pipe between this other outside utility and HA to handle something like that and I just don’t see that working well at all with the current setup. It would 100% rely on the other software to handle updates to HA properly, which would not happen easily.

Yeah, likely a question of semantics / nomenclature regarding the definition of “conversion”.

For me, the serialization of an object (i.e. a in-memory opaque structure) to “something else”, like a textual representation like JSON or YAML is a conversion.
That this “conversion” is done by the object itself or a 3rd party is irrelevant.

Still, I don’t understand what you mean by “looks like YAML”. YAML is a file format. It is valid or not. It might be valid YAML and not be a properly serialized description of a given object class, but it would still be YAML.

There is no hint of a doubt to me that what the OP is asking for will never happen, though, for a number of reasons both technical and philosophical.

1 Like

As you type and add “yaml” in the yaml editor, the frontend is objectifying it so that when you switch back to the UI, the elements exist for adjustment. This is how it immediately knows if it can switch between the yaml editor or if the UI editor is supported.

So while you’re typing text, it’s actually objects. Not sure how else to describe it.

This is largely why !includes don’t work, neither do anchors, because it’s not actually yaml. It just looks like yaml.

Grr… Once again, no :wink:
The process you describe happens only once you press the “save” button.
No validation whatsoever (or at least, visible ones) is done in the meantime.

Type total gibberish in the text area, as I showed above, and nothing will happen until you press save.

Once again, I’m wondering if we are talking about the same editor.

Live objectification. what other proof do you need. The buttons enable/disable immediately, it’s objectifying as you type.

Sorry, but I have no other way of making you understand what I’m saying.

Did both pictures without even caring about the save button.

We.are.talking.about.the.raw.configuration.editor.

Not sure how to make you realize we are not talking about the same editor…

Which is the same used when editing card “code-editor”

I’ve already tried explaining that to them that they use the same class. Both are ha-code-editors. I’m just going to leave because they always have a bone to pick with me to win some imaginary argument instead of spending time actually debugging into the frontend.

I’m just going to avoid these threads from now on. I’ve made the comments on how it actually works, others can decide if they want to heed my advice or not. I’m out.

You are actually right. The difference being that validation is done at each keypress in the “card configuration editor”, and only once, at save time, in the “raw configuration editor”.

Maybe thats why they “called it” raw editor, as they didn’t find a reason to have a side-by-side graphic. ( of a whole +2000 rows view ) , the card already define which “section” of the JSON we are “lifting”
Bottom line is, if people want’s to use an external editor, to edit JSON, they should use a compatible editor , or convert it them self to YAML(or C/P the generated code they see in their browser-view) or whatever language they feels comfortable in.
I wonder if same people create/edit .JS in another format, than .JS
YAML is far from “ready” to be an alternative to( Replace ) JSON or HTML for that matter

EDITED: ( to trying to avoid people taking a word literally ) And i wont go into details, and another discussion , doo to the obvious “circumstance” and i.e JSON’s presence globally.
Yes, everything is possible, even peeing against the wind

Arf. I just lost 2 points of sanity in this thread :joy:

Maybe because you lack the ability to /or willingness to understand what other people says/means, or just because you have an amazing desire to pick words/sentence out of a context , just for the cause of it.
Yes i also thought i was out of this “topic”, as you always seems to find causes to spend your time on pointless discussions

I definitely lack the ability to understand how YAML is far from ready to replace JSON. It definitely is not ready to replace HTML, though, I give you that.

Anyway, you are also right that this discussion is pointless because this FR will never happen.