Lovelace Node based Editor - WIP

GITHUB Link Here: https://github.com/asierralozano/ha-ui-editor

Hello HA community!

I’m really happy to present you a personal project in which I’m working on. The name is not really clear, so let’s call it for now HA Lovelace Editor.

The basic idea behind this tool, is to have an easy way of managing custom views with custom cards (like button-card, mini-graphic-card…).

My father and I, both have home assistant as our brain for home automation. I love tinkering with Lovelace and custom cards. My father loves that as well, but he does not have the same confidence to start coding and supporting dozens of yaml files in order to get a custom and beauty Lovelace. There is where I had the idea of simplify the process.

Basically, this tool is composed of different themes, and each theme contains it’s own cards. Each card (each node), have the Lovelace code behind it. Each of those cards, generates a node within this tool, being able to connect them between themselves, generating the Lovelace Code. Then, it is as simple as copy and paste that code from this tool, to HA, and that’s it! You will have your custom view!

These templates are really easy to do! They are yaml files, so if you are familiar with HA, you know them.

Right now I’m working on implemeting my own theme (90% of the style was based on a lovelace that a reddit user posted some time ago. I cannot remember your name, but dude… it’s awesome! Thanks) within this tool, but at time of release of it, you will be able to create your own themes.

This is the theme that I’m implemeting here right now:

)

And this is how the LightsView gets generated using this tool

Each node contains it’s own part of code, and connecting them, generates the whole code for the whole view.

This is how the `LightNode` template looks like:

    type: custom:decluttering-card
    template: color_light_button variables:
      - entity: {{ entity }}
      - name: {{ name }}

And this is the code generated by the graph the I posted above:

    title: Lights
    icon: mdi:home
    path: 
    visible: false
    panel: true
    
    cards:
      - type: vertical-stack
        cards:
          - type: custom:decluttering-card
            template: view_title
            variables:
              - title: Lights
    
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: shoulder_blank_card
    
              - type: custom:layout-card
                min_columns: 1
                max_columns: 3
                cards:
                  
                  - type: vertical-stack
                    cards:
                      - type: horizontal-stack
                        cards:
                          - type: custom:decluttering-card
                            template: title_button_card
                            variables:
                              - name: Salon
    
                      - type: grid
                        columns: 3
                        square: true
                        cards:
                          
                          - type: custom:decluttering-card
                            template: color_light_button
                            variables:
                              - entity: light.salon
                              - name: Salon
                          
                          - type: custom:decluttering-card
                            template: color_light_button
                            variables:
                              - entity: light.luz_del_mueble
                              - name: Luz del mueble

Easy right? And you can create as many nodes as you want!

There are still a lot of things to do, but I hope you like it!

I’m looking to release within this or next week.

Let me know what you think guys!

2 Likes

Looks awesome, i will try it if you start the next weeks​:hugs::hugs::+1:t4:

1 Like

Thank you very much! I’m working on a “How to install” doc, and it should be good to go for now!

1 Like

Hey guys!

Sooner than expected, here you have the first release of this app. (https://github.com/asierralozano/ha-ui-editor)

It still could contains some bugs, so I would love if you can report them by using the Issues tab on Github, or directly here.

Just keep in mind, that the tool is nothing without themes, so here you have as well the theme that I was working on (https://github.com/asierralozano/homekit-ui).

They have some READMEs explaining how to install them, but feel free to ask if you have any question.

Thanks!!

1 Like

just saw it today and will try this instantly, will report back if I get used to it=) Thanks for your work - im really excited if it simplifies my Lovelace mess:D

edit: arg, does it mean I need windows to run it?

Hey! Thanks!!

Actually not! You can run it on any machine by just installing python 3.7 or bigger version on your PC and following the steps that I posted on the README. If you have any issues with it, please, feel free to ask me. I’ll try to provide some binaries for MacOS and GNU/Linux as well. Hopefully i’ll have them soon.

Thanks for that fast reply to my stupid question :see_no_evil:

i tried installing it on different pcs but everytime it stopps while installing dependencies. i dont use python a lot so it could be due to the fakt of having python 3.7 as some kind of secondary python and have to change everything in the instruction from python to python3…. will try it with a windows machine the next days, so im sorry for not giving feedback till now:)

Ok, very nice idea :+1: but a stupid question: how do I add/create Nodes?
Thanks

That’s weird… could you please let me know which dependency is failing?

Thanks!

You can press the TAB button on your keyboard, and a menu will shows up containing all the nodes installed.

Let me know if you have any issues finding it!

That works for inputs, but I think I don’t understand the tools structure yet. For example in your picture there are entity and view nodes and I don’t know how to create or install them. I think a simple list of keys and their functions would be very helpful to start with too.
It looks really cool so far :smiley:

Ohhh! Yep, basically this tool is based on themes. There is currently one theme, that I’m working on. https://github.com/asierralozano/homekit-ui There are instructions within it’s readme, but feel free to ask if you have any questions!

I read that before, but the instructions seem to be for HA not your tool. If I want to import a file it asks for a JSON file not YAML or j2. I think I’m really missing something here

Ohhh! Yes! I’m sorry! I completely forgot about that part on the readme. The ha-resources is the folder that you have to copy within HA, following the guidelines that I provided in the ReadMe. The “ui” folder must be copied on your local machine within a “themes/THEME-NAME” folder. The first time you open the tool, is gonna ask you for a themes folder. You must paste the themes root folder that you have created. If you have already set a path, and you cannot remember which one you set, you can Right click on the tool, and select Edit - Preferences, and change the path there

So I tested the following:

  • configured themes folder -> self created folder: “homekit-ui” -> downloaded “ui” folder
  • configured themes folder -> downloaded “ui” folder

I restarted the tool multiple times
Should the available nodes show up when I press tab?
Thank you for your patience

sure: first of all i had to use

python3 pip install -r requirements.txt

to get the requirements installing within my somewhat strange environment, and it stopps with:

 Running setup.py install for typed-ast ... error
    ERROR: Command errored out with exit status 1:

so i dont know if it is because i have setup python wrong at all, but i dont know how to get further…

sorry if that question is again very dumb, but im really not that deep into it - perhaps i should better wait for mac-binaries in hopefully some future releases=)

No worries!
Here you have an screenshot of my structure

The left path, is the one that goes into the tool settings.

Could you please try pip3 install -r requirements.txt?

Ahh I had to copy the ha-resources, README.md and theme.spec too. Thanks it works now :+1: