Need ideas: The most efficient way to develop for Lovelace?

Good day,

I’m quite new to Lovelace (been trying on and off for the last 6 months), and now I would like to invest a lot of time into FINALLY making HA fully working.

I needs ideas in order to make the development more efficient. In order to give you the best context, I’ll describe my environment:

  • I’m running HA (docker) on an Intel NUC.
  • I’m using my Mac and Visual Studio Code to modify yaml files.
  • Visual Studio Code is connected to my Intel NUC using SSH so I can edit the files right away without the need of uploading the file to the NUC each and every time I modify something
  • I’m using both Safari and Firefox in order to test.

When it comes to Lovelace, I’d rather use the YAML mode. So… when adding a new card, I actually modify the yaml file in Visual Studio Code, then I need to restart the Docker container every single time to see the changes. Since there is a lot of tries and errors for me it is very annoying to wait 1 or 2 minutes for a single-line modification.

So, the question, does any one know an efficient way to see the changes right away without rebooting? (like a command I could run inside the docker container in bash? or whatever)…

Any other ideas?

Thank you!

No you don’t. Lovelace yaml changes do NOT require a reboot. Just refresh the page.

Yeah… well that what I’ve read somewhere here… but there is probably something I’m doing wrong… maybe a setting I need to change in my browser because refreshing the page has just never worked. :frowning:

Edit: No matter if I’m using Firefox or Safari, both won’t display changes on refresh… I always need to reboot the entire docker… I’m probably missing out on something there…

Yep, you do :slight_smile: If you use YAML mode for lovelace, you have (and need) two seperate refreshes. :slight_smile:
One is the refresh button of the browser and the second is the refresh of lovelace, which you can do via the three dots in the upper right corner.

This works great for lovelace, but if you run into an error while doing a lovelace-refresh, you need to browser-refresh after solving the error and afterwards a lovelace-refresh to see the changes.

Only if you do changes to eg sensors (=> template_sensor!), you need to restart HA. A docker refresh is not necessary, as well as a reboot of your NUC.

1 Like

OMG!!! I’ve never actually realized ever since I’m trying stuff with HA that there was a Refresh button that was refreshing Lovelace… always though it would trigger the same refresh button as the browser!

It has done the trick! :smiley: Thank you for your help… much appreciated!

Just out of curiosity, is it possible at some point to create an hotkey for refreshing the lovelace part instead of using the mouse each and every time to manually click refresh? (if the answer is No… then, no worries! This solution is wayyy much better than rebooting the container. :wink: )

Glad I could help. I receive so much help and ideas in this community here, it’s a pleasure to be able to give back at least a tini-tiny-bit. :slight_smile: Unfortunately, I don’t know of a keyboard shortcut for the lovelace-refresh, sorry! :slight_smile:

Haha okay! No worries… really glad you took the time! :wink: