Home Assistant Cookbook - Discussion Thread

From my experience on this forum, not enough.

I have always felt a fair amount of the documentation on the website is from an advanced user’s perspective. I would suspect it’s intimidating for a new user.

1 Like

I guess what I was saying i I don’t know how the docs are set-up or the hierarchy really. It has never made a lot of sense to me. I just google everything picking out integration keywords or describe some thing I want to do (or the customer wants to do) and find it that way.
When I’m looking a template Jinja2 thing, I pull up the page and word search it because it’s one document. I don’t get that one either. But this is me.
I don’t think a post would have me doing something different to see if there is an integration, for instance. Maybe others, don’t know.

That too is what I would explain.

You are not alone, I do the same thing. Although, I start with the forum then move to Google if I am running in circles. My thought process being, someone else most likely asked the same question at some point.

Then I have my own notes because as I have gotten older I forget a lot. :older_man:

2 Likes

It took me quite some time to find that out until Tom made me aware of this.
My idea was that integrations were 3rd party services, devices and didn’t think I would find something like the basic media player info amongst the integrations - now I do.
For newcomers, it’s not that obvious where to look for information.
Things have gotten better, but maybe that’s also my perception* because of being a regular.
Having more ‘upfront’ guidance in what do to, where to search, what to post when asking a question can be helpful.

Exactly this!

*edit

1 Like

It took me while to figure this out too. I only clicked it when I developed my own integration.

I think a cookbook is a good idea.

What I’m also thinking is whether one could reach out to the dev team to make a bigger change to the docs by creating a new top bar menu item called domains (for example). All these building blocks can then be put there.

I too find it odd that it’s under integrations when it’s not something you can directly use or configure. I know those pages typically call it out and that specific integrations will often link back to these building block pages, but the penny may not drop immediately.

@123
Just added this to the cookbook. It would be awesome if you did an edit to that to pull in your version of how to do this like you did in How do I create a unique name for scene within a blueprint? - #2 by 123. or however you want to present it. I did a header on my section in anticipation that you would add your section.

Your suggested method is easier than the template I had suggested back in 2021.

It’s true, but it requires a script or automation that has a trace and you can easily figure the context. Sometimes a random name/word is needed in just a template so yours can be a useful option. I would love to see it there but it is your choice.

( that template would make a useful custom_template as well…)

That said, if you want to persue that I’m hands off, but if you don’t, I would be happy to credit you on the code and share a custom template doing that in HACS, then post that as an alternative.
However I am pulling from your code, so you have to tell me it’s OK or I won’t.

1 Like

Ideally there would be Jinja2 function to generate UUID.

1 Like

True, but a custom template could do it.

By “custom template” do you mean a Jinja2 macro?

Given a choice of having a function versus a macro, I would choose a function for its convenience (no installation required and no “import” directive wherever it needs to be used).

Anyways, I added the following method, of creating a unique string, to the cookbook:

{{ now() | string | slugify }}
3 Likes

Very true, but of the 2 there is only 1 that I am capable of pulling off.
An [FR] could be started for the other one.

I added this today in the templates section. I needed it to pass on to someone and couldn’t find it again.

1 Like

On the subject of unique ids, someone posted today that they lost long term statistics when they added a unique id to an entity.

I imagine that this is because the entity becomes a different one as far as statistics is concerned - is this correct? If so it might be worth adding to the cookbook post. Is there anything about this in the docs?

Yes & No, you can’t loose LTS from adding a unique_id if you restart after adding the unique_id. The only way you could lose LTS for adding a unique_id. It is possible for that to happen if you add a unique_id to a yaml configuration and reload, but you should immediately notice that because your entity_id will now have a _2 after it instead of it’s original entity_id.

If you want to avoid that, whenever you add a unique_id, restart HA if the entity has existed in the system prior to adding a unique_id.

Any objection to adding this?
Looks extensive and well thought out.
It does have a couple of vids in it, but they seem to be exact subject only. (I didn’t watch them, though)

Zigbee networks: how to guide for avoiding interference + optimize using Zigbee Router devices (repeaters/extenders) to get a stable mesh network with best possible range and coverage.

It was already there. oops.

1 Like

@Stiltjack
I know it’s a group thing, and I have no problem pulling levers on links, but I thought the top description of the cookbook page needs help. When you reference the link, it pulls in a paragraph un-formatted with the beginning of the links. There is the lead sentence, then it starts with the links that get jumbled.
My thought is someone good with words such as yourself could make the paragraph longer so that it is a better explanation when you hand someone the link to the cookbook itself…
Looks like this here:

And looks like this everywhere else:
image

So filling in a longer paragraph at the top with a longer excerpt would help overall.
If someone else wants to take a shot, fine with me as well. It just needs help.

Looks fine here. What is “everywhere else”?

1 Like

It’s fine original.
Look at the pictures of external links…
If we add to the first line an excerpt, the explanation shown on external links will be more presentable.