Home Assistant Cookbook - Discussion Thread

Good idea. But think of a particular task that someone might want to perform and use that to demonstrate. The posts you link to are very theoretical.

Show, not tell! :grin:

Context will be difficult because all the information that’s widely used about it is simply wrong. People are using a blanket copy/paste template to get a specific scenario and that’s it. Context is extremely powerful, but there’s plenty of gotcha’s related to it.

E.g.

If you get the context in an automation between the trigger and actions, it’s 100% wrong unless you get it from the trigger.

If you get the context in the action section, it’s correct.

Context is populated after conditions and before actions run.

2 Likes

Indeed! There are many, many posts on contexts. These are just two of my own reference ones that I’ve saved.

Petro’s articulated the problem:

I’m not sure yet how to distill this into useful, concrete information.

I’ve never been able to get very reliable code working using contexts, except for the simplest of cases, because one needs to infer things. You have to basically generate the different scenarios for your own case and it gets quite tricky if you have e.g. a script called from an automation and in the script you access the script’s context.

Perhaps the real issue is that some of this should rather be baked in at at a deeper level or even provided by integrations themselves.

1 Like

Rate limit clarifications by parautenbach · Pull Request #32151 · home-assistant/home-assistant.io (github.com)

I’ve been mulling one for triggers, trigger variables, limited templates in my head since this started, but it always turns into a bible . too long. Working on breaking that up.

2 Likes

Hello, I was wondering if it would be appropriate to add the following installation guide

Installing HAOS in a VM on TrueNAS Scale

EDIT: Added to cookbook

2 Likes

Please do… :grin:

Edit: Thank you!

1 Like

Found something cool, added it in.
Custom Search Links for Frequent Searchers.

1 Like

Added: How to keep your recorder database size under control.

3 Likes

Would anyone like to do a piece on importing files into HA for local access? How to import them; where to store them; how to reference them in dashboards and media players etc.

I imagine it would mention File Editor and Samba Share, both of which are “official” add-ons.

1 Like

Added the trigger_variable one I’ve been mulling over.
Automations #3: trigger_variables

3 Likes

I have some ideas, but not the complete picture on the importing stuff. I use Samba but don’t have a complete story. I’d be glad to colab on it if someone wants to start one in a private group chat.

Thank you! How about adding some examples? :grin:

2 Likes

Done, and it looks a lot better.

I have to be careful that it is expanding the discussion and not repeating it on that one.

2 Likes

@MaxK Good one, thank you!

This one from Tom looks like it should be in the Cookbook.
Comments? Does it still look up to date?

The images still refer to snapshots, so they could do with updating. Perhaps @tom_l could comment?

Yeah it needs an update.

I have a suggestion but I’d like to bounce it off you guys, especially the mods and anyone working directly for HA who might be reading this.

The cookbooks point to the relevant pages in the docs, but shouldn’t it also be the other way round too? What if the docs also had a link to the cookbook?

Imagine you’re just starting out and actually read the docs. You can read the words on the screen, but you barely understand any of it because, let’s face it - it was written by someone who is more technically inclined.
Wouldn’t it help if there was a link to a cookbook written in a more beginner-friendly way right on that page?

2 Likes

That would be a policy question, probably…
@MissyQ @frenck would be the owners of the social media and the Docs…

2 Likes