Activities - dckiller51/astrion-custom-dashboard GitHub Wiki
An Activity is what you're doing in a room: Watch Apple TV, Listen to music, Play Xbox. One tap starts it: the right devices turn on, inputs switch, the volume keys go to the right device and the right page opens. Another tap, or Off, ends it.
Like Harmony, Astrion runs one Activity per room at a time. Starting Listen to music in the living room replaces Watch Apple TV there, without touching the bedroom.
Two kinds of Activities
| Composed Activity | Tracked tile | |
|---|---|---|
| What it is | Astrion drives each device itself: IR, Harmony device, Home Assistant entity, Apple TV | A tile that already does everything by itself (a Harmony activity, an HA script…), flagged as an Activity |
| When to use it | Several devices, no existing Harmony activity or script for it | You already have a Harmony activity or an HA script |
| Where | Builder › 2. Activities › + New Activity | On a scene_grid tile: tick Track as Activity + a Room |
Both kinds show in Active Activities, outline their tile while running, and stop with Off.
Creating a composed Activity
In the builder, 2. Activities › + New Activity. A wizard guides you:
- What kind of Activity? Watch TV, Watch a Movie, Netflix, Listen to Music, Smart TV or Custom. This only suggests a name.
- Name & room, plus an optional icon. Activities with the same room replace each other.
- Devices: pick everything involved. You can mix:
- Configure each device:
- Power on / Power off commands;
- Input to select, a single command or a full input sequence from a Harmony profile;
- Power on when this Activity starts: uncheck it for an always-on device;
- Power off when another Activity takes the room;
- Delay after power on, for slow TVs.
- Volume: which device the VOLUME / MUTE keys control while this Activity runs, and its commands.
- Review, plus Now playing on the dock clock: the device whose title and artwork the dock screen shows (since 1.2.8). Then Save Activity.
Putting it on the dashboard
A composed Activity starts from a scene_grid tile:
- Add or edit a scene_grid card and add a tile.
- In Composed Activity, pick your Activity.
- Optionally set Page to open. Otherwise the tile's own page becomes the Activity's page.
Saving that tile also binds the Activity's volume keys on that page.
Switching between Activities
When a new Activity takes the room, Astrion compares the two:
- a device used by both (e.g. the amp) is left alone: no power cycle, and its input only changes if the new Activity needs a different one;
- a device only in the old one is powered off, if power off on exit is set;
- a device only in the new one is powered on.
So going from Watch Apple TV to Watch TV doesn't switch your amplifier off and on again.
Active Activities
Swipe down from the top of the screen to see what's running, grouped by room:
- tap an Activity to go to its page;
- Stop turns it off;
- Help (composed Activities) fixes things that got out of sync, like Harmony's Help button. It lists each device with what Astrion thinks (on / off / unknown, last input). Tap a device to correct it, then Fix powers on what's off and selects the inputs again. Nothing is sent until you press Fix.
Turning an Activity off
- Stop in Active Activities;
- a tile's Turn off a room's Activity field: the room's name, or
*for every room; - a hotkey Turn off a room's Activity, e.g. a long press on Power with
*, like Harmony's power-off (see Hotkeys); - for a Harmony activity, anything that powers the hub off (the Harmony remote, the app, Home Assistant). The tile follows the hub's live state.
Pages that follow the Activity
In a page's settings (⚙ in the builder):
- Hide unless this Activity is running: the page's dot appears only while the Activity runs. Tick Hide completely to also skip it when swiping, and leave it automatically when the Activity stops.
- A hotkey Return to current Activity jumps to the page of whatever runs in a room.
Tracked tiles: details
On a scene_grid tile with Track as Activity:
- Room: required.
- Devices (optional): the catalogue ids of the devices this tile turns on. A later composed Activity in the same room then knows they're already on and won't toggle them needlessly. Useful for Harmony activities, whose devices Astrion can't see.
- Now playing on the dock clock (optional, since 1.2.8).
Hotkeys can be tracked too, in the JSON: "track": true, "room": "Living room".
Example (JSON)
"activities": [
{
"id": "watch_apple_tv",
"name": "Watch Apple TV",
"room": "Living room",
"devices": [
{ "deviceId": "tv_lg", "source": "ir", "powerOnCommand": "power_on", "inputCommand": "hdmi2", "delayAfterMs": 3000 },
{ "deviceId": "amp", "source": "ir", "powerOnCommand": "power_on", "inputCommand": "input_bd" },
{ "deviceId": "media_player.appletv_salon", "source": "ha" }
],
"volumeDeviceId": "amp",
"volumeUpCommand": "volume_up",
"volumeDownCommand": "volume_down",
"muteCommand": "mute",
"nowPlayingEntity": "media_player.appletv_salon"
}
]
See also: Hotkeys · Card Scene grid · Recipes