Skip to content

hassio: add Home Assistant add-on support - #2

Closed
stkang wants to merge 1 commit into
3735943886:masterfrom
stkang:anszom
Closed

hassio: add Home Assistant add-on support#2
stkang wants to merge 1 commit into
3735943886:masterfrom
stkang:anszom

Conversation

@stkang

@stkang stkang commented Aug 6, 2026

Copy link
Copy Markdown

Summary

This PR packages rethink-cloud as a native Home Assistant add-on, so it can
be installed from the Add-on Store, configured from the UI, and managed through
the Supervisor — no manual config file editing or separate container required.

Running as an add-on is opt-in and fully backward compatible: the existing
config.json flow is untouched. The add-on path only activates when the Home
Assistant Supervisor's options file (/data/options.json) is present.

What's included

  • hassio/config.yaml — Add-on manifest: identity, supported architectures
    (aarch64, amd64, armv7), device-facing ports, Ingress web UI panel,
    the mqtt:need service dependency, and the user-configurable options schema.
  • hassio/DOCS.md — End-user documentation shown on the add-on page:
    how it works, requirements, installation, options reference, ports, and
    data/persistence notes.
  • repository.yaml — Add-on repository descriptor so the repo can be added
    to Home Assistant as a custom add-on source.
  • util/hassio.ts — Builds a RawConfig from the add-on options
    (/data/options.json), with sensible defaults and MQTT broker resolution.
  • tests/util/hassio.test.ts — Unit tests covering option parsing, defaults,
    and MQTT resolution.
  • rethink-cloud.ts — Detects add-on mode via the options file and loads the
    config from options instead of config.json; the file-based path is unchanged.

How it works

  1. The Supervisor writes user options to /data/options.json and mounts the
    persistent data volume.
  2. On startup, rethink-cloud checks for that file. If present, it calls
    loadHassioConfig() to build the config from options; otherwise it reads
    config.json as before.
  3. MQTT resolution: an explicit mqtt_url wins; otherwise the add-on asks the
    Supervisor for the Home Assistant MQTT service (mqtt:need, auto-detected);
    otherwise it falls back to mqtt://localhost:1883.
  4. The management web interface is exposed through Ingress, so it opens
    directly from the add-on page with no extra port or login.

Configuration

All options are exposed under the add-on's Configuration tab and validated
against the schema in config.yaml. Key options: hostname, discovery_prefix,
rethink_prefix, bridge (ThinQ cloud bridge mode), mqtt_url / mqtt_user /
mqtt_pass, and log. See hassio/DOCS.md for the full reference.

Testing

  • tests/util/hassio.test.ts covers option parsing, default fallbacks, and MQTT
    broker resolution (explicit URL, Supervisor service, localhost fallback).
  • Backward compatibility: with no /data/options.json, the existing
    config.json flow runs unchanged.

Notes

  • Fully backward compatible — non-add-on usage is unaffected.
  • LG ThinQ is a trademark of LG, used for identification only. This project is
    not affiliated with LG and is provided WITHOUT ANY WARRANTY.
image image

Add the add-on manifest (config.yaml), repository descriptor, and docs,
and load config from the add-on options when running as a Hassio add-on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stkang stkang closed this Aug 6, 2026
@stkang

stkang commented Aug 6, 2026

Copy link
Copy Markdown
Author

anszom#127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants