AppDaemon for Home Assistant — VS Code extension
Version: 0.2.0
Install or update
Open Extensions, select … → Install from VSIX…, and choose
vscode-appdaemon-0.2.0.vsix. Reload VS Code when prompted.
Log explorer
Select $(list-tree) AD Logs in the VS Code status bar, or run AppDaemon: Explore Logs from the Command Palette. The explorer opens in a central editor tab, including when no document is open.
By default, it reads the existing AppDaemon text logs from the workspace:
logs/appdaemon.loglogs/error.loglogs/virtualsensors.log
The explorer groups lines by the app name in the standard AppDaemon log format. It provides INFO/WARNING/ERROR counts, expandable app histories, relative timestamps, sorting by latest activity or app name, text/time/level filters, live updates, and raw-log navigation. Duplicate error lines found in multiple files are merged. The log reader handles file rotation, truncation, multiline exceptions, UTF-8, and legacy Windows-1252 bytes.
AD Logs turns red when the loaded logs contain an ERROR or CRITICAL entry. Clear logs empties the configured log files and clears the current explorer history.
The standard AppDaemon text logs do not contain causal links or reliable initialization boundaries. The details panel will say so for ordinary entries. Existing messages that already contain trace or initialization metadata can still be grouped or linked; the explorer does not create that metadata. No AppDaemon Python changes are needed for this raw-log view.
Settings
{
"appdaemon.haUrl": "http://homeassistant:8123",
"appdaemon.haToken": "<HOME_ASSISTANT_TOKEN>",
"appdaemon.adUrl": "http://localhost:5050",
"appdaemon.errorLogPath": "logs/error.log",
"appdaemon.mainLogPath": "logs/appdaemon.log",
"appdaemon.entityRefreshInterval": 300,
"appdaemon.logExplorerPaths": [
"logs/appdaemon.log",
"logs/error.log",
"logs/virtualsensors.log"
],
"appdaemon.logTimezone": "Europe/Berlin",
"appdaemon.logEncoding": "auto"
}
| Setting | Purpose |
|---|---|
haUrl, haToken |
Home Assistant connection for entity information |
adUrl |
AppDaemon HTTP API URL |
errorLogPath, mainLogPath |
Log locations relative to the workspace |
entityRefreshInterval |
Entity refresh interval in seconds |
logExplorerPaths |
Text log files followed by the explorer |
logTimezone |
Timezone used to interpret AppDaemon timestamps |
logEncoding |
auto, utf8, or windows-1252 for text logs |
Do not commit your Home Assistant token. Use user settings or an ignored local settings file.
Other extension features
- Home Assistant entity completion and hover information in Python/YAML.
- Navigation to AppDaemon app and virtual-sensor definitions.
- AppDaemon errors as VS Code diagnostics and an output channel.
- Status bar actions for app reload, Home Assistant restart, log exploration, and apps defined in the active YAML file.
| Shortcut | Action |
|---|---|
| Ctrl+Shift+A / Cmd+Shift+A | Go to App |
| Ctrl+Shift+V / Cmd+Shift+V | Go to Virtual Sensor |
Commands are available under AppDaemon: in the Command Palette: Go to App, Restart Apps in Current File, Reload Apps, Restart Home Assistant, Toggle Production Mode, Show Error Log, Refresh Entity List, Clear Error Diagnostics, and Explore Logs.
Verification
npm test
The log explorer preview is available at docs/log-explorer-preview.html in the
workspace; it uses sample data and is not a live log server.