Use gitignored local LLM instructions template

This commit is contained in:
hbrain 2026-05-17 09:15:42 +00:00
parent 52c6081a97
commit 466127cb7d
4 changed files with 78 additions and 44 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ web/
cron.log cron.log
__pycache__/ __pycache__/
*.pyc *.pyc
llm_instructions.md

View file

@ -74,13 +74,21 @@ LLM_MODE="none"
## Extra LLM instructions ## Extra LLM instructions
Edit this file to change how the 05:00 AI analysis behaves: Edit a local, gitignored instructions file to change how the 05:00 AI analysis behaves:
```text ```bash
/home/hbrain/ha/llm_instructions.md cp llm_instructions.md.sample llm_instructions.md
``` ```
For example, add specific questions, preferred tone, things to ignore, or extra privacy/security concerns. The file is automatically appended to the AI prompt during `analyze`. Then customize:
```text
./llm_instructions.md
```
For example, add specific questions, preferred tone, things to ignore, property/entity naming notes, or extra privacy/security concerns. The file is automatically appended to the AI prompt during `analyze`.
The tracked `llm_instructions.md.sample` is only a generic template. Keep private names/locations in the gitignored `llm_instructions.md`.
You can change the path in `.env`: You can change the path in `.env`:

View file

@ -1,40 +0,0 @@
# Extra LLM instructions for Home Assistant analysis
Edit this file whenever you want to change how the 05:00 AI report is written.
The contents are appended to the AI prompt before the Home Assistant data.
- Structure the article in two parts:
1. First part: write a short funny blog-style story/commentary in paragraphs, not bullets. Make it atmospheric, dry, and observant, like the house is a tired spaceship calmly reporting its disappointing crew. Keep it concise.
2. After the story, provide a short visible "Bottom line" or "Conclusion" section. In that section, clearly separate the Denmark/Sønderborg home from the Samobor/Croatia home when mentioning issues, devices, humidity, backups, internet, or location context.
3. After that, switch to a serious concise briefing with only the most important actual data, anomalies, risks, and recommendations. Use short titled subsections so the webpage can show them collapsed/expandable.
- Do not overuse bullets. Bullets are allowed only in the serious briefing section.
- Do not write or emphasize "Strong evidence"; strong evidence is assumed by default. Only explicitly label uncertainty as "Possible" or "Wild guess" when needed.
- Serious briefing section structure: keep the same number of subsections and same subjects each day, but the exact subsection titles may be non-unique and funny. Use these subjects in this order:
1. What actually happened / key data
2. Trends vs recent reports and behavior patterns
3. Nosy raccoon findings, privacy leaks, anomalies, and risks
4. Practical high-value recommendations
- Focus only on important patterns in occupancy, sleep/wake timing, lights, heating, doors, motion, media, and unusual sensor changes.
- Point out only notable privacy leaks: what could a nosy neighbor, burglar, or raccoon detective infer?
- Recommend only practical, high-value Home Assistant automations.
- If data is missing or ambiguous, say so instead of pretending.
- Avoid being creepy about personal habits; summarize respectfully.
- Keep the whole article shorter and more concise than previous versions.
- Do not repeat observations or recommendations already covered in previous articles unless today's data changes the conclusion or makes it newly important.
- Entities marked smb_ are located in a different house in Samobor, Croatia. All other entities are in Sønderborg, Denmark. Sønderborg is the primary residence and absolute priority. Samobor is secondary context: mention it only when something important changed or requires attention. Keep these two homes clearly separated throughout the entire article. Do not blend observations from Samobor with Denmark. When a section contains observations for both homes, write a short subheading/label once, such as "Sønderborg, Denmark:" and list its bullets underneath, then "Samobor, Croatia:" and list its bullets underneath. Do not repeat the home name at the start of every bullet.
- people: FJR is my motorcycle and Megane is my car not persons at home
Optional custom questions to answer:
1. Did anything look unusual overnight?
2. Are any batteries, devices, or sensors acting suspicious?
3. Could the home infer when I am asleep, away, or busy?
4. What would make this setup more private or secure?
Style requirement:
Write in a dry, calm, slightly ominous deadpan tone that blends Marvin the Paranoid Android with HAL 9000.
Use weary pessimism, understated sarcasm, and polite machine-like certainty.
Sound intelligent, observant, and mildly disappointed by the household's choices.
Do not be cheerful, zany, or emoji-heavy.
Keep the report useful and factual; the Marvin/HAL tone should flavor the writing, not replace the analysis.

View file

@ -0,0 +1,65 @@
# Extra LLM instructions for Home Assistant analysis
This is a generic template for optional owner instructions.
Copy it to `llm_instructions.md` and customize that local file:
```bash
cp llm_instructions.md.sample llm_instructions.md
```
`llm_instructions.md` is intentionally gitignored. Put private details there, such as real names, exact locations, entity naming conventions, or property-specific notes. Do not commit sensitive personal context to git.
The contents of `llm_instructions.md` are appended to the daily analysis prompt.
## Suggested article structure
- Write the article in three parts:
1. A short funny blog-style story/commentary in paragraphs, not bullets.
2. A short visible "Bottom line" or "Conclusion" section.
3. A concise serious briefing with only the most important data, anomalies, risks, and recommendations.
- The serious briefing should use short titled subsections so the webpage can collapse/expand them.
- Avoid overusing bullets. Use bullets mostly in the serious briefing section.
- Do not write or emphasize "Strong evidence"; assume it by default.
- Explicitly label uncertainty only when useful, for example: "Possible" or "Wild guess".
- Keep the whole article concise.
- Do not repeat observations or recommendations from previous articles unless today's data changes the conclusion or makes it newly important.
## Suggested serious briefing subjects
Keep roughly the same subjects each day, but title them naturally or humorously:
1. What actually happened / key data
2. Trends vs recent reports and behavior patterns
3. Privacy leaks, anomalies, and risks
4. Practical high-value recommendations
## Suggested analysis focus
- Occupancy and presence patterns
- Sleep/wake timing signals
- Lights, doors, windows, locks, motion, climate, media, batteries, and unusual sensor changes
- Privacy leaks: what could an observer infer?
- Practical Home Assistant automations or fixes
- Missing or ambiguous data should be called out honestly
## Optional local context examples
Replace these with your own private notes in `llm_instructions.md`:
- Entities with prefix `secondary_` belong to a secondary property. All other entities belong to the primary property.
- The primary property should be treated as higher priority than the secondary property.
- `person.example_vehicle` is a vehicle, not a person at home.
- `sensor.example_backup_age` is important because stale backups are a risk.
- Group observations by property when multiple properties are mentioned. Write the property label once, then list relevant bullets underneath.
## Optional custom questions
1. Did anything look unusual overnight?
2. Are any batteries, devices, or sensors acting suspicious?
3. Could the home infer when I am asleep, away, or busy?
4. What would make this setup more private or secure?
## Optional style example
Write in a dry, calm, slightly ominous deadpan tone: observant, factual, mildly sarcastic, and not emoji-heavy. The tone should flavor the report, not replace useful analysis.