Ideally there would be Jinja2 function to generate UUID.
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 }}
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.
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)
It was already there. oops.
@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:
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.
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.
I’m enjoying the cookbook since it gives me a lot of good ideas on what I can do with home assistant and it jumpstarts many projects.
My contribution to the home assistant community is writing and updating guides. Two of them made it to the cookbook so far.
What is still missing?
Maybe we can use this topic to gather and vote on suggestions.
I hope this inspires others to help with writing good and complete documentation.
I fixed it. Another slight tweak today to shorten it a couple of characters.
Looks much better when the link is pulled into Discord or anywhere else.
aware the Common Tasks page in Home Assistant documentation is already linked, but I always feel it is a horrific page for finding stuff.
Among my most used commands there is running a specific version. Aka downgrading when new versions create havoc…
hence my suggestion to have a direct entry in the cookbook to
Heads up with editing the Cookbook.
It appears Discourse had a limit on how many of the auto-title links in a post. You know, the ones where you drop the link and add a “.” at the end so it displays pretty…
The cookbook is at the limit, so every new link added should use the
[link display](link)
nomenclature going forward.
Otherwise you add your link then someone has to come around and fix the oldest link that is now displaying the URL instead of the pretty words…
It’s happened to me a few times and I have fixed it already when others have added links, so be aware.
I hope they’re going to upgrade the forum soon. My weather integration guide is uneditable because changes to tables can duplicate part of the code. These inconveniences and restrictions cost a lot if time and withhold (newer) users from contributing.
Maybe more than one cookbook is called for.
Fix what, changing the Discourse page generation code?
We just need to use the html code because there is a limit on how many they do for us. This would not be a configuration parameter, rather just how it’s coded.
I could fix it now by editing the doc and converting a bunch then people could add new links for a while the easy way, but people adding links can just as easily code it when they put in new ones. Someone added one a couple of days ago and it went well for them.
So I get alphabetical, etc…
The big problem is that I have given out quite a few links to the zigbee section and now you have broken all those links. The Zigbee link is now different as Discourse adds a number on the end to keep the links unique within the document, even if the heading words are the same. The number is a count from the top of the document.
instead of 18, zigbee is now 20…
We have to think about adding sections and re-arranging sections for the sake of re-arranging them, these actions have a ripple effect…
It’s probably been broken before and I didn’t notice it, and I’ll get over it, but another thing to think about…