Skip to content

Releases: discostu105/lox

v0.11.0 — Multi-Miniserver Contexts

Choose a tag to compare

@discostu105 discostu105 released this 24 Mar 06:54
ca4d193

Manage multiple Miniserver connections from a single CLI — switch between home, office, or client installations instantly. Inspired by kubectl config use-context.

✨ New: lox ctx — Context Management

lox ctx add home --host 192.168.1.100 --user admin --pass secret
lox ctx add office --host 10.0.0.50 --user admin --pass secret
lox ctx use office        # switch active context
lox ctx list              # show all contexts with ● active marker
lox ctx current           # print active context name
lox --ctx home status     # one-off command against a different context

All subcommands

Command Description
lox ctx add <name> Add a named Miniserver context
lox ctx use <name> Switch the active context
lox ctx list List all contexts (supports --json)
lox ctx current Print the active context name
lox ctx remove <name> Delete a context
lox ctx rename <old> <new> Rename a context
lox ctx init Create project-local .lox/ directory with .gitignore
lox ctx migrate Convert existing flat config to a default context
--ctx <name> Global flag — run any command against a specific context

📁 Project-Local Configs

Like .git, lox now walks up from your working directory to find project-specific Miniserver configs:

cd ~/projects/smart-home
lox ctx init --host 192.168.1.100 --user admin --pass secret
# Creates .lox/config.yaml — all lox commands in this tree use it automatically

🔀 Config Resolution Order

  1. LOX_CONFIG env var (absolute priority)
  2. Project-local .lox/config.yaml (walk up from cwd)
  3. Global ~/.lox/config.yaml (flat or multi-context)
  4. --ctx flag overrides context selection within global config

📦 New Multi-Context Config Format

active_context: home
contexts:
  home:
    host: https://192.168.1.100
    user: admin
    pass: secret
  office:
    host: https://10.0.0.50
    user: admin
    pass: secret

Existing flat configs continue to work — opt in with lox ctx migrate.

🐛 Bug Fixes

  • Gen2 Miniserver compatibility — all commands now handle numeric JSON Code/value fields returned by Gen2 firmware (previously only string values were accepted). Fixes print_resp, input set, set, and all token commands. (#99)

Install / Upgrade

# macOS / Linux (Homebrew)
brew upgrade lox

# Windows (PowerShell)
irm https://raw.githubusercontent.com/discostu105/lox/main/install.ps1 | iex

# From source
cargo install --git https://github.com/discostu105/lox --tag v0.11.0

Full Changelog: v0.10.1...v0.11.0

What's Changed

Full Changelog: v0.10.1...v0.11.0

v0.10.1 — Gen2 telemetry fix

Choose a tag to compare

@discostu105 discostu105 released this 22 Mar 16:51

Highlights

Gen2 Miniserver fixlox status no longer shows blank rows for unsupported diagnostic endpoints. Gen2 Miniservers (firmware 16.x) return empty strings for contextswitches, ints, comints, contextswitchesi, and ntp — these are now handled gracefully.

Fixed

  • Blank diagnostic rows — context switches, interrupts, comm interrupts, and context switches (idle) showed empty on Gen2 Miniservers. Unsupported rows are now hidden in --diag; empty values show "—" in --net/--bus/--lan
  • xml_attr: handle numeric JSON values — the JSON parser now also handles unquoted numeric values ("value": 123456), future-proofing against firmware that returns counters as numbers
  • OTLP extract_lox_value — now tries as_f64() before as_str(), so numeric JSON values are recorded as metrics

Added

  • 12 new regression tests covering every diagnostic endpoint in both Gen1 (XML) and Gen2 (JSON) response formats
  • nonempty_attr() helper — consistent empty-value handling across all status sections

Verified

Tested against real Gen2 Miniserver (firmware 16.1.11.6):

$ lox status --diag
┌─ Diagnostics ───────────────────────────────────────
│  CPU:              CPU:12 SPS:28 Cycles:99
│  Tasks:            61
│  SD read:          7182 kB/s
│  SD write:         6132 kB/s
│  SD errors:        ✓ No errors
│  SD usage:         0.0%
└─────────────────────────────────────────────────────

Upgrade

# macOS / Linux
brew upgrade lox

# Windows
irm https://raw.githubusercontent.com/discostu105/lox/main/install.ps1 | iex

Full Changelog: v0.10.0...v0.10.1

What's Changed

  • fix: handle numeric JSON values from Gen2 Miniserver endpoints by @discostu105 in #98

Full Changelog: v0.10.0...v0.10.1

v0.10.0 — Deep Telemetry

Choose a tag to compare

@discostu105 discostu105 released this 22 Mar 15:44

Highlights

Deep telemetrylox status and lox otel now expose every diagnostic endpoint the Miniserver offers. Interrupts, SD card health, parity errors, buffer exhaustion — if the Miniserver tracks it, lox can show it and ship it to your OTLP backend.

Added

  • lox status --diag — 3 new metrics: hardware interrupts, communication interrupts, context switches (idle)
  • lox status --diag — SD card response parsed into structured fields: read/write speed, error count, usage %, manufacturer ID, card metadata. No more raw string blobs
  • lox status --net — DNS 2 (previously only DNS 1 was shown)
  • lox status --bus — CAN bus parity errors
  • lox status --lan — TX underruns, buffer exhaustion, no-buffer events
  • 11 new OTLP metrics in lox otel serve / lox otel push:
    • loxone.system.interrupts, loxone.system.comm_interrupts, loxone.system.context_switches_idle
    • loxone.can.parity_errors
    • loxone.lan.tx_underruns, loxone.lan.exhaustion, loxone.lan.no_buffers
    • loxone.sd.read_speed, loxone.sd.write_speed, loxone.sd.errors, loxone.sd.usage
  • OTLP metric reference tabledocs/guides/opentelemetry.md now has a complete table of all exported metrics with units

Fixed

  • xml_attr handles JSON responses — Gen2 Miniservers return JSON (not XML) from /jdev/ endpoints. The parser now handles both formats transparently, so all diagnostic commands work on Gen1 and Gen2 alike

Changed

  • License — switched from MIT to dual-license: GPL-3.0 + Commercial
  • GitHub Pages — fixed terminal demo and install block formatting

Example

$ lox status --diag
┌─ Diagnostics ───────────────────────────────────────
│  CPU:              12%
│  Tasks:            44
│  Context switches: 123456789
│  Interrupts:       987654
│  Comm interrupts:  12345
│  Ctx switches (i): 98765432
│  SD read:          540 kB/s
│  SD write:         370 kB/s
│  SD errors:        ✓ No errors
│  SD usage:         2.8%
│  SD manufactured:  2014/2 (mfr 27)
└─────────────────────────────────────────────────────

$ lox status --diag -o json | jq .sd_card
{
  "raw": "SD Performance: Read: 540kB/s, ...",
  "read_speed_kbs": 540,
  "write_speed_kbs": 370,
  "error_type": 0,
  "error_count": 0,
  "usage_pct": 2.79
}

Upgrade

# macOS / Linux
brew upgrade lox

# Windows
irm https://raw.githubusercontent.com/discostu105/lox/main/install.ps1 | iex

Full Changelog: v0.9.1...v0.10.0

What's Changed

  • Switch project licensing from MIT to dual GPL-3.0 and Commercial by @discostu105 in #92
  • Improve terminal and install block styling with semantic markup by @discostu105 in #93
  • feat: add missing Miniserver telemetry endpoints by @discostu105 in #95

Full Changelog: v0.9.1...v0.10.0

v0.9.1 — Windows standalone fix

Choose a tag to compare

@github-actions github-actions released this 22 Mar 10:26

Highlights

Windows binary fix — the Windows release binaries now statically link the C runtime, so they work out of the box without requiring the Visual C++ Redistributable to be installed. lox is now a true zero-dependency, single-file binary on all platforms.

Fixed

  • Windows: statically link CRT — the binary was dynamically linking VCRUNTIME140.dll and api-ms-win-crt-* DLLs, which meant lox.exe would fail to start on machines without the Visual C++ Redistributable. Added .cargo/config.toml with +crt-static for both x86_64 and aarch64 MSVC targets. (#91)

Docs

  • Added Kubernetes CronJob example for automated config backups (#90)

Upgrade

# Windows
irm https://raw.githubusercontent.com/discostu105/lox/main/install.ps1 | iex
# macOS / Linux
brew upgrade lox

Full Changelog: v0.9.0...v0.9.1

v0.9.0 — Light Moods

Choose a tag to compare

@discostu105 discostu105 released this 22 Mar 08:59

Highlights

Light moods — discover and set moods on LightControllerV2 controls. The new lox light moods command connects via WebSocket to read the mood list directly from the Miniserver, so you always see what's actually configured.

Added

  • lox light moods <name> — list available moods (ID + name) for any LightControllerV2, with table or JSON output
    • Alias: lox light list-moods
    • Resolves moodList TextState via WebSocket from the initial state dump
    • 10-second timeout with clear error message
  • stream_events_until — new early-exit variant of stream_events for one-shot state queries
  • Codecov configuration — coverage reports now correctly map source paths

Fixed

  • lox light mood <name> <id> now sends on before setMood — the Miniserver silently ignores setMood when the light is off
  • lox mood <name> <id> — same fix applied to the standalone mood command
  • Flaky config tests — serialized env var access with a mutex to eliminate intermittent test failures under parallel execution

Changed

  • MOOD_OFF constant extracted (setMood/778) to deduplicate the hardcoded mood ID across cmd_light and cmd_mood
  • ws_authenticate made pub for reuse by stream_events_until
  • codecov-action upgraded from v4 to v5 (Node.js 20 deprecation)

Example

$ lox light moods "Lichtsteuerung [EG Wohnzimmer]"
ID      NAME
──────────────────────────────
1       Gedimmt
777     Viel Licht
778     Aus

3 moods

$ lox light moods "LED Küche" -o json
[
  { "id": 2, "name": "Warmweiß", "control": "LED Küche", "control_uuid": "..." },
  ...
]

Full Changelog: v0.8.0...v0.9.0

What's Changed

  • feat: add lox light moods command for LightControllerV2 by @discostu105 in #89

Full Changelog: v0.8.0...v0.9.0

v0.8.0 — Windows support

Choose a tag to compare

@discostu105 discostu105 released this 21 Mar 23:48
47b8ab3

Highlights

Windows support — pre-built binaries for Windows x86_64 and aarch64 are now included in every release.

Added

  • Windows binaries (lox-windows-x86_64.exe, lox-windows-aarch64.exe) attached to releases
  • lox config init/pull/log/restore — git-based config version tracking
  • lox health — device health dashboard (battery, signal, offline, bus errors)
  • lox schema — command schema introspection for AI agent discovery
  • --dry-run, --non-interactive, --trace-id, -v/--verbose global flags
  • --all-in-room flag on lox on/lox off
  • Structured JSON error envelopes with -o json

Changed

  • TLS crypto backend switched from aws-lc-rs to ring (fixes Windows compilation)
  • lox extensions now queries /data/status for richer device information
  • CI: lint job split to Ubuntu-only; Windows builds no longer run redundant checks

Removed

  • lox daemon, lox automation, lox service (automation subsystem)
  • timezone: config field

Full Changelog: v0.7.0...v0.8.0

What's Changed

Full Changelog: v0.7.0...v0.8.0

v0.7.0

Choose a tag to compare

@discostu105 discostu105 released this 16 Mar 21:49

What's New

GitOps config versioning (lox config init/pull/log/restore)

Track every change to your Miniserver configuration in a local git repository. Downloads the config via FTP, decompresses it, and commits with semantic diff messages that describe exactly what changed (controls, rooms, users added/removed/renamed).

lox config init ~/loxone-config   # Initialize git repo, save path in config
lox config pull                   # Download, decompress, diff, auto-commit
lox config log                    # Show config version history
lox config restore abc123 --force # Restore config from any git commit
  • Multi-Miniserver ready — configs stored in <repo>/<serial>/ subdirectories
  • Safe restore: uploads the original backup.zip from git history (no risky recompression)
  • Cron-friendly --quiet mode for automated pulls
  • Stores config.Loxone (XML), backup.zip (original binary), and metadata.yaml per version

Device health dashboard (lox health)

Monitor the health of every device in your Loxone installation from the terminal. Pulls live data from the Miniserver's /data/status endpoint to show online/offline status, battery levels, firmware versions, and CAN bus errors.

lox health                # Full device health report
lox health --type air     # Only wireless (Air) devices
lox health --problems     # Just warnings + offline devices
lox health -o json        # JSON for monitoring pipelines

Devices are classified as online, warning (battery < 20%), or offline — making it easy to spot issues at a glance.

Agentic CLI enhancements (--dry-run, lox schema, error envelopes)

First-class support for AI agents and automation scripts:

  • Structured JSON errors: Errors in --output json mode return machine-readable envelopes with error codes (control_not_found, ambiguous_control, unauthorized, etc.)
    {"ok": false, "error": "control_not_found", "message": "No control matching 'nonexistent'"}
  • Dry-run mode (--dry-run): Validates inputs and resolves controls without executing commands — great for previewing what would happen
    lox --dry-run -o json blind down "South Window"
  • Schema introspection (lox schema [command]): AI agents can self-discover all commands, arguments, control types, and valid actions at runtime
    lox schema          # All commands
    lox schema blind    # Blind-specific schema with valid actions
  • Non-interactive mode (--non-interactive): Guarantees no prompts — automatically implied by --output json
  • Trace IDs (--trace-id): Correlate agent actions across log output

Bug Fixes

  • Fix lox extensions reporting 0 devices — now queries /data/status instead of LoxApp3.json, which doesn't populate extension data (#68, #70)
  • Fix lox health reporting 0 devices — same root cause as above (#70)

Testing & Docs

  • Add tests for shell completions command (#66)
  • 242 tests total (150 unit + 92 integration)
  • Updated COMMANDS.md, README.md, CHANGELOG.md, and DESIGN.md for all new commands

What's Changed

Full Changelog: v0.6.3...v0.7.0

What's Changed

Full Changelog: v0.6.3...v0.7.0

v0.6.3

Choose a tag to compare

@discostu105 discostu105 released this 16 Mar 21:02

Bug fixes

  • Fix xml_attr word-boundary bug: value no longer matches value2 attribute names
  • Fix 6 CLI bugs found via manual testing (PR #64): flag conflicts, wrong endpoints, path formatting, binary stats alignment, missing JSON output, filename patterns

Improvements

  • Extract 8 inline functions into testable helpers (lox_epoch, parse_stats_entries, stats_data_offset, stats_period, stats_file_path, find_stats_files, abs_path, lox_timestamp_to_string)
  • DRY up 4 duplicate Loxone epoch constructions
  • Add LOX_CONFIG env var override for integration testing

Testing

  • Add 92 CLI smoke tests — --help for every subcommand catches clap definition bugs
  • Add 35 new unit tests for xml_attr, matches_filters, bar, kb_fmt, stats helpers, and path helpers
  • Total test count: 237 (145 unit + 92 integration)

What's Changed

Full Changelog: v0.6.2...v0.6.3

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 15 Mar 13:51

Bug Fixes

  • Fix lox ls ignoring local host config on Gen 2 Miniservers (#59): Loxone Miniserver Gen 2 redirects HTTP requests to a cloud DynDNS URL, causing 401 errors. Added a same-origin redirect policy that blocks cross-origin redirects with a clear error message.
  • Fix UTF-8 panic in verbose body truncation: Use floor_char_boundary() for safe string slicing.
  • Fix credential redaction for duplicate query params: All occurrences of sensitive params are now redacted.
  • Fix redirect policy host parsing: Bare hostnames/IPs (without scheme) are now correctly parsed.

New Features

  • Add -v/--verbose flag: Global -v (requests) and -vv (requests + response bodies) flags log HTTP interactions to stderr with credential redaction.

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 15 Mar 13:42

Full Changelog: v0.6.0...v0.6.1