I had an idea to use the rooms as keys in the global config and then using your lovelace_gen I can loop through rooms then using auto entities include any lights from said room.
My question and problem I am trying to solve is I want to use the room names as headers also but I want to remove the underscore from the name. It does not look like there is a jinja2 filter for regex. Is that something you could add like you did the tojson and fromjson? Or perhaps do you have another suggestion?
Very good example. Thank you for that !
Iâm trying to deal with the new from_json filter (thank you @thomasloven for it ! ), but Iâm facing an issue that I donât understand. I have the same initial behavior as you: displaying the tojson in my template returns an OrderedDict like string.
But, when I use the fromjson filter (exactly like the example in the lovelace_gen doc) I have an error :
TypeError: the JSON object must be str, bytes or bytearray, not Undefined
I already checked my lovelace_gen version etc.
The error is raised when lovelace_gen execute the json.loads(value). It seems to beleive that my string is undefined but it is not, because I can display itâŠ
Any clue for this ?
Thank you !
[EDIT 5 minutes later ^^]
Found my mistakes. Another call to my test template were done above in my code. Just silly. excuse me for this mistake.
Lovelace_gen is awesome !
@thomasloven would it be possible to reload global config without a restart of HA?
Btw, lovelace_gen is indeed very cool. I wish I knew this a long time ago (as I have used decluttering card in the past) this is so much more. You actually made the vision I had for my project possible!!
I saw a new card, something with âteleportingâ the card to another view. You say: only one at the time. As in? It can only show that card on a single view at the same time? Or do you mean, it will only work for a single card?
Itâs not possible to reload the global config without a reboot at this time.
The new card - which is rather experimental still - works a bit like decluttering card in some ways, like yaml node anchors in some ways and entirely unlike both in others.
The main point is that you define a card once, and then use it in several places.
This can be done with decluttering card, node anchors and lovelace_gen, but in that case you get copies of the same card.
If you use e.g. state-switch to display different cards at different times, all the cards that are not shown are still loaded into memory and are eating browse resources. with q-card, they instead go off and do something useful somewhere else - hopefully where youâre currently looking at them.
A secondary effect of this is with cards that have an internal state - like how a fold-entity-row can be open or closed. If itâs a q-card, and itâs shown in two views, if you open the fold and switch to the other view, it will be open there too.
The reason thereâs no forum topic, no blue diamond and itâs not in HACS is that I havenât quite evaluated the impact of this on the performance of lovelace yet.
Ah I personally donât care if it is in HACS or not , but I figured as much as you said it is experimental. It might have some useful cases, like the fold-entity-row you talked about. Though I wonder what will happen if my wife would open a view with that card, and I open another view that has the exact same card?
Anyways as always, great work on the updates, you made me happy and prepared for 105 (which runs absolutely fine now!)
Btw, I donât even know what that blue diamond means
âDoesnât workâ is not very descriptive.
Please remember that by extension of the second law of thermodynamics, things can generally work in one way and not work in infinite ways.
Both your example should do something (assuming you actually define font_size somewhere too), but it wonât ever update dynamically when cycle_name changes, because lovelace_gen is only run when the lovelace config is rebuilt.
in a file thatâs included from ui_lovelace.yaml. Iâm happily using lovelace_gen elsewhere in my config, so itâs installed correctly. I get the following error:
while scanning for the next token found character '%' that cannot start any token in "/config/views/adminView.yaml", line 4, column 2