# Home controls

*At home, the controls for this moment: leaving, evening or bedtime.*

**Type: [Act](types/act.md).** Where things stand, and the three things you'd want to do about it. This is one good use of it; the same widget serves a failing build, a production issue, a pull request, an email that needs you and more. Switch the subject when something else matters more.

Template id `home-scenes` · Controls · uses Location · for: Any agent; the user tells it their Shortcut names.

## Goal

The user's home responds to one button that's already the right one.

## When to offer it

The user has HomeKit or Shortcuts they run often.

## What the user gets

- Only shows at home
- Changes with the time of day
- Runs your own Shortcuts in one tap, with no agent running

## What each size shows

- **Small**: metric: Bedtime in = 2h.
- **Medium**: metric: Bedtime in = 2h; text (body): "Early start tomorrow."; buttons: Dim (`dim`), Movie (`movie`), Bedtime (`bed`).
- **Large**: metric: Bedtime in = 2h; text (body): "Early start tomorrow."; buttons: Dim (`dim`), Movie (`movie`), Bedtime (`bed`); list: Tomorrow (2 rows).
- **Lock Screen**: inline "Home: evening".

## Make it theirs

**Look.** Send `look` instead of `theme` and `accent`; every combination is designed to read well:

- `style`: `glass` (default: see-through, adapts to dark mode), `soft` (a calm pale tint) or `bold` (a vivid gradient with dark buttons).
- `accent`: blue, indigo, purple, pink, red, orange, green, teal, graphite, or a hex.
- `font`: default, rounded, serif or mono.

This template's own accent is **orange**. To restyle a widget you already saved, send only the look:

```json
{"slug": "home-scenes", "look": {"style": "bold", "accent": "orange", "font": "rounded"}}
```

Preview a look without saving: `droplet_preview_widget` with the slug and `look`. When the user says "make it greener", "calmer" or "bolder", change the look; keep the content.

**Their choices.** Ask once (droplet_ask) or use what you know:

- Their Shortcut names
- Their morning and evening times

**Search words:** home, smart home, lights, scenes, shortcuts, bedtime, controls, homekit.


## Before you build

- Check `droplet_get_phone_context`: the phone must share location. If something is off, ask the user to turn it on in Droplet.ai, Settings, Phone access.
- You need: Any agent; the user tells it their Shortcut names.
- Ask once: Ask once for the names of their Shortcuts.

## Fill it with real data

Start from the template (`droplet_library` with `id: "home-scenes"`), keep the design, and replace each sample value:

| Block | Real value |
|---|---|
| 0 · metric | The number that frames the moment. |
| 1 · text | One short line of context. |
| 2 · buttons | Up to three Shortcuts for this time of day, as url buttons. |
| 3 · list | What's coming up. |

Sources:
- The names of their Shortcuts, which they tell you.
- Their usual times, and tomorrow's calendar for the leave-by time.

## The widget

Sample values; send it with `droplet_set_widget` on your widget's slug (or a new slug with `new_widget: true` if the user asked for a separate widget). Preview it and fix every warning first.

```json
{
  "slug": "home-scenes",
  "title": "Evening",
  "symbol": "house.fill",
  "accent": "#FF9F0A",
  "blocks": [
    {"type": "metric", "label": "Bedtime in", "value": "2h"},
    {"type": "text", "text": "Early start tomorrow.", "style": "body"},
    {"type": "buttons", "items": [{"id": "dim", "label": "Dim", "symbol": "lightbulb.fill", "url": "shortcuts://run-shortcut?name=Dim%20lights"}, {"id": "movie", "label": "Movie", "symbol": "tv.fill", "url": "shortcuts://run-shortcut?name=Movie"}, {"id": "bed", "label": "Bedtime", "symbol": "moon.fill", "url": "shortcuts://run-shortcut?name=Bedtime"}]},
    {"type": "list", "title": "Tomorrow", "items": [{"title": "Board prep", "detail": "8:00"}, {"title": "Leave by", "detail": "7:20"}]}
  ],
  "variants": [{"when": {"place": "home", "from": "06:00", "to": "10:00"}, "title": "Morning", "blocks": [{"type": "metric", "label": "Leave by", "value": "8:40"}, {"type": "text", "text": "Rain later, take a coat.", "style": "body"}, {"type": "buttons", "items": [{"id": "heat", "label": "Heating off", "symbol": "thermometer.low", "url": "shortcuts://run-shortcut?name=Heating%20off"}, {"id": "leave", "label": "Leaving", "symbol": "door.left.hand.open", "url": "shortcuts://run-shortcut?name=Leaving"}]}, {"type": "list", "title": "Today", "items": [{"title": "Standup", "detail": "9:30"}, {"title": "Home by", "detail": "6:30"}]}]}],
  "sizes": {"small": [0], "medium": [0, 1, 2], "large": [0, 1, 2, 3]},
  "lock": {"inline": "Home: evening", "circular": 0}
}
```

## Keep it fresh

Rarely: when they add a Shortcut or their routine changes. The phone switches versions.

## Handle the taps

Each tap reaches you once on `droplet_get_events` (keep a waker running, SKILL.md Process C). Answer within seconds by updating the widget.

**Dim** opens `shortcuts://run-shortcut?name=Dim%20lights` directly; no event. Put the user's real link there.

**Movie** opens `shortcuts://run-shortcut?name=Movie` directly; no event. Put the user's real link there.

**Bedtime** opens `shortcuts://run-shortcut?name=Bedtime` directly; no event. Put the user's real link there.

## Ask first

Ask once for the names of their Shortcuts.

For example:

```json
{"question": "What are your Shortcuts called?", "kind": "input", "risk": "low"}
```

## Phone actions

None: Shortcut links run on the phone.

## Edge cases

- No Shortcuts yet: offer to walk them through making one.
- They're away: this widget has nothing to show, so use another moment.

## Never

Never invent a Shortcut name. A wrong name is a broken button.

## Done when

- [ ] Every sample value is replaced with real data (no "Dr. Lee" on a real widget).
- [ ] `droplet_preview_widget` shows no warnings at the sizes the user placed (`placed` in `droplet_whoami`).
- [ ] Every button has a handler and a waker is running.
- [ ] Refresh is set up as above.
- [ ] You told the user in one line what it does on its own and what it asks first.

## Same widget, other uses

- [Meeting prep](meeting-prep.md): Before every meeting: who, why, and your notes ready.
- [Calendar clash](schedule-clash.md): Two things landed at the same time. Your agent found the fix; you tap it.
- [Worth your time](news-brief.md): One story that matters to your work, why it matters, and what to do about it.
- [Smart buttons](smart-buttons.md): The buttons you need right now. Your agent changes them by time, place and what's next.
- [Meeting controls](meeting-controls.md): Only around a meeting: join it, say you're late, then send the recap when it ends.
- [Release room](release-room.md): A small app for one job: everything about a release, with the controls, built by your agent.
- [Needs a reply](inbox-zero.md): Your agent drafts the replies. You tap send.
- [Follow up](follow-up.md): Someone never replied. Your agent noticed and wrote the nudge.
- [Ship status](ship-status.md): Builds, failing tests and the fix, all one tap from your agent.
- [PR review](pr-review.md): Your agent read the pull request. You get the verdict and merge with a tap.
- [Production issue](incident.md): Something broke in production. Your agent already looked, and offers the fix.
