Closed jpmeijers closed 12 months ago
I got a bit nerd-sniped yesterday evening, thus I tried implementing the ESP design using HTML/CSS/Jinja template with the custom Lovelace HTML Jinja2 Template card.
Preview
Dark Mode | Light Mode |
|
ESP Design | This Design |
|
O wow this is really amazing! Thanks a lot @ribeirompl. Shout when you're in town and I'll buy you a beer/coffee.
Brilliant! Great job @ribeirompl! Thank you for sharing!
@ribeirompl Thanks for this card. It's such a nice addition to my dashboard!
I recently started getting an error with this card though. From my logs: Error while processing template. Apart from updating my home assistant to the latest version, nothing changed on my side.
Do you perhaps experience the same issue?
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 568, in async_render render_result = _render_with_context(self.template, compiled, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2231, in _render_with_context return template.render(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render self.environment.handle_exception() File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "", line 177, in top-level template code TypeError: 'NoneType' object is not iterable
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 694, in async_render_to_info render_info._result = self.async_render( ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 570, in async_render raise TemplateError(err) from err homeassistant.exceptions.TemplateError: TypeError: 'NoneType' object is not iterable
@Viva57 I believe that issue may have been fixed with an update on 28 September. Check that you have the latest code: https://github.com/wernerhp/ha.integration.load_shedding/blob/master/examples/card5.yaml
The issue is likely due to having no upcoming scheduled loadshedding. This was the fix for the issue: https://github.com/wernerhp/ha.integration.load_shedding/pull/81/files
Let me know if you come right 👍
Ah, thanks @ribeirompl! I updated my code and tested it for a couple of days. All seems to be good again 🙌🏼
Not sure why but I simply cannot find that card in HACS in order to make use of this impressive example. Suggestions? I'm going to try to duplicate this using the Markdown Card to see if I can make that one work for a 2nd option.
Edit: The example code works flawlessly using the TailwindCSS Template Card from HACS as well
Not sure why but I simply cannot find that card in HACS in order to make use of this impressive example. Suggestions? I'm going to try to duplicate this using the Markdown Card to see if I can make that one work for a 2nd option.
Edit: The example code works flawlessly using the TailwindCSS Template Card from HACS as well
Try searching for: HTML Jinja2 Template card
or in your HA url, go to: /hacs/repository/205261230
Real newbie here.... I've managed to install the Jinja2 Template card, step 1 of the installation process, but then get stuck on the very next step: "Create a new "Manual" (YAML) card on your dashboard."
I've faffled around quite a bit and can't work out where/how to do this? What am I missing?
Thanks for any guidance!
@FFJacot
Bingo! That worked perfectly.... a great example of "a picture is worth a thousand words"!
Depressing viewing, though.
Thank you!
A further newbie question: I managed to work out how to give the card a title:
"title: Grahamstown 2 Load shedding"
But the title folds over in the displayed card. Is there a way of reducing the text size for the title?
Going to need a bit more info. Please share your code and/or 1000 word picture 😉
Here we go:
https://github.com/wernerhp/ha.integration.load_shedding/blob/master/examples/card5.yaml errors out to 404. Can someone provide me with the yaml file? Thanks!
Thanks,
Easy as py; sorry for not reading properly
On 12 Mar 2024, at 20:17, Werner Pieterson @.***> wrote:
https://github.com/wernerhp/ha.integration.load_shedding?tab=readme-ov-file#cards
— Reply to this email directly, view it on GitHub https://github.com/wernerhp/ha.integration.load_shedding/issues/72#issuecomment-1992278841, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWOV5HHKR5VG7FKPHBEQ65DYX5BDHAVCNFSM6AAAAAA2KFVYO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJSGI3TQOBUGE. You are receiving this because you commented.
The ESP details page looks like this
I would like to make this a bit more compact and only show the status bars as a card on a lovelace dashboard, something like this:
Does anyone know how to do this?