Home Assistant Cookbook - Discussion Thread

New one. It’s often asked in context of energy entities, but applies to anything really: “I need to replace x. How can I keep my history?”

Good one - what’s the answer???

This seems to be the answer (at least for now): Rename entity ids and retain statistics - #8 by AngellusMortis

EDIT: though I’m not 100% convinced it works because of this: "New entity_id is already in use" error when renaming any entity · Issue #115747 · home-assistant/core · GitHub

2 Likes

42

3 Likes

Why? :slight_smile: Shouldn’t we use the less complicated things in the Cookbook? Genuine question. :slight_smile:

I would have recommended something like petros Jinja macros:

The example in that topic isn’t taking any user settings into account (what it should in my opinion, to get his place in the Cookbook).

There’s already a link from Getting time and date with templates. Added by @nickrout I think.

Thoughts anyone?

That’s perfect, can’t you add it there? That would make way more sense in my eyes, than linking that other topic. :slight_smile:

I personally am not a fan of so complicated to explain one liners, and wouldn’t recommend them much. One topic, where all these are bundled is a great alternative for such things. One can take a look, if necessary, but not o present for “newer” users. :slight_smile:

Same, but sometimes the sheer genius of them is a sight to behold. The stuff that some of the users come up with makes me feel dumb in comparison lol

1 Like

Over 60% of my forum bookmarks are posts from Taras (123). :smiley: It really amazes me, what he’s doing.

I can say, he personally saved me around 400 or 500 lines of code in my YAML files, if that’s even enough. :+1: :rofl:

3 Likes

Between him and petro over the years, SAME!

2 Likes

Yep, petro is the same, the above mentioned time macro saves a ton of code for me, and it’s soooooo easy to use. Love it! :slight_smile:

I wouldn’t want to leave these one-liners out of the Cookbook, they are very, very useful, but not in a spreaded out way - they need to be collected in one or two places. :slight_smile: Where experienced users can find them, but not to prominent, for unexperienced users.

1 Like

I’m actually not against a cookbook entry with a bunch of one liners in it for various tasks. The experienced users might pick up a few they didn’t know about and the inexperienced users might learn a thing or two (imho). Given how “wonderful” the forum search can be sometimes, it might actually help having a cookbook entry just titled “sample templates” or “community templates” or something like that?

IDK… just spitballing titles here lol

1 Like

So that would leave us with two ideas:

  • One or two topics, where we could collect these one-liners
  • A new category like “Advanced code snippets” or something like that

Let’s see, what others say! :slight_smile:

So… First things first.

  • Keep “Easy date and time card”
  • Remove “Easy date and time card”
0 voters

Sorry - just had to try out the poll thing. :grin:

4 Likes

:rofl: :+1:

If I could get the third free text answer: After the suggestion from @code-in-progress I’d like to take the “categroy” variant, where we could list “one-liners” for experienced users, that would fit nicely, don’t you think?

And we could collect more entries for that “category”, I’m quite sure there are a lot of useful links in my bookmarks… :slight_smile:

But I’d maybe put this category in a “hide”-menu.

This one:

Advanced usage examples

Caution, use at your own risk, and only when you know what you do!

  • first link
2 Likes

And second question… How to present “one liners” and other more advanced stuff?

  • One or two topics, where we could collect them
  • A new category like “Advanced code snippets”
  • Advanced usage examples where appropriate in a “hide” menu
0 voters

This is fun! :rofl:

Better give both polls a few hours to brew.

2 Likes

At least these are reasonable questions! :smiley: I remember a poll, where the question was “Do you use Home Assistant?” :rofl: :rofl:

Can’t we have both? A category “Advanced code snippets”, that is hidden? Maybe a new poll could give some insight…? :rofl: Sorry, couldn’t resist :rofl:

  • Yeah, let’s have a new poll
  • No, don’t be daft
0 voters
1 Like

I voted against it because we already have a markdown dictionary, and the format of that just confused the shit out of me. I had to read it like 5 times before I decided it’s a one line markdown statement with odd choices.
Basically the way it’s written I had problems with, I guess not really the content.

I know I also confuse people when I explain things, but that was obtuse as an attempt at entertainment, I didn’t like it.

2 Likes

This is a bit long but there’s no wasted space.

Updating Templates with the new default values in 2021.10.x.

  • Cookbook
  • Not Cookbook
0 voters