docs(ha_addon): make the add-on's DOCS.md the single source

The mkdocs page now covers install and points at the add-on documentation instead of repeating it. DOCS.md gains an options table and matches what the entrypoint does. Changelog entries for ha_ingress and the startup exit status.
This commit is contained in:
agessaman committed 2026-11-09 20:07:31 -08:00
1 parent 3177134cf8
commit 12e9db0fdd
5 files changed
+40 -46

No files matched your search

+2 -1
View File
@@ -9,7 +9,7 @@ semantic versioning.
### Added
- Home Assistant add-on in `homeassistant/meshcore_bot`. Add `https://github.com/agessaman/meshcore-bot` as a repository in the add-on store. Options set in the add-on configuration override the matching `config.ini` keys on each start. Options left empty leave those keys alone. The web viewer opens from the sidebar. The image is `ghcr.io/agessaman/meshcore-bot-ha` (amd64 and aarch64).
- `[Web_Viewer] ha_ingress` (default `false`) serves the web viewer through a Home Assistant ingress panel: requests from the Supervisor's proxy skip the password login, and links and Socket.IO traffic use the ingress path.
- Packet capture status messages include the radio's packet counters, as meshcore-packet-capture's do: `packets_received` and `packets_sent`, plus the firmware's own `recv`, `sent`, flood/direct counts and `recv_errors`. Dashboards that show an observer's packet counts had none for the bot.
- Web viewer, fresh install: until the bot has heard anything, the dashboard shows one panel instead of a grid of empty boxes, saying what the station is doing (listening, starting, or not running), what fills in first (nodes, then paths and hops, then one-hop neighbors), and, for admins, links to Real-time and Radio settings. Real-time's empty tape says how long the bot has been listening ("Listening since 2:28 PM (12 min) · nothing heard yet") and, after ten minutes with nothing, where to look.
- Web viewer recovery notices: when the bot starts running again or the radio reconnects, answers again or comes back online, a notice says so with how long it was down ("Radio back online at 2:23 PM · offline for 42 min, since 1:41 PM") and dismisses itself. Real-time records these, and dropped live links, as dividers on the tape. A dropped link's divider says whether the reconnect's replay covered the gap or which span isn't shown, and the 10-minute spark draws an uncovered span as unknown.
@@ -54,6 +54,7 @@ semantic versioning.
### Fixed
- The bot exits with status 1 when it can't reach the radio at startup, so launchd and the Home Assistant watchdog restart it. A failed startup connection used to end with status 0, which both read as an intentional stop.
- Incoming channel commands were handled twice after the bot had been up for a while on a BLE radio, so each command got two replies and the second copy of a cooled-down command was dropped. A reconnect could overlap another reconnect and subscribe to the same link twice. Relinks now run one at a time, a connection finishes setup only on the radio instance it opened, subscribing on an instance that already has handlers does nothing, and a channel or direct message repeated within 5 seconds is dropped ([#364](https://github.com/agessaman/meshcore-bot/issues/364)).
- MQTT weather sources (`wx custom.mqtt_weather.*`) in `json_template` mode no longer put a long Celsius value on air: the default template rendered `61.3°F (16.27777777777778°C)`. I now round `{temperature_c}` to one decimal, matching the precision of the °F reading, so it reads `16.3°C` (and 31.95°F reads `0.0°C`, not `-0.0°C`). Format specs such as `{temperature_c:.0f}` still work, and a missing reading still renders as empty rather than failing the template.
- The Nix flake builds again on current nixpkgs. The locked meshcore-cli (1.3.11) caps `bleak` below 2.0 and nixpkgs now ships 3.0.2, so its runtime dependency check failed; the flake relaxes that one pin ([#352](https://github.com/agessaman/meshcore-bot/issues/352)).
+6 -30
View File
@@ -1,37 +1,13 @@
# Home Assistant
MeshCore Bot runs as a Home Assistant add-on. The store entry lives in this repository, and the sidebar opens the web viewer.
MeshCore Bot is available as a Home Assistant add-on for Home Assistant OS and Supervised installs. It runs the bot, keeps its database and settings in Home Assistant's add-on storage, and adds a sidebar entry for the web viewer.
## Add the repository
In Home Assistant, open Settings, then Add-ons, then Add-on store. Open the menu in the upper corner and choose Repositories. Add:
1. In Home Assistant, open Settings, then Add-ons, then Add-on store.
2. Open the menu in the upper corner and choose Repositories.
3. Add `https://github.com/agessaman/meshcore-bot`, then install MeshCore Bot and start it.
```text
https://github.com/agessaman/meshcore-bot
```
The add-on image is built for 64-bit systems only (amd64 and aarch64). On a 32-bit install, use the regular [Docker image](docker.md) or a [normal install](installation.md) instead.
Install MeshCore Bot and start it. The image is `ghcr.io/agessaman/meshcore-bot-ha`, built for 64-bit Intel and ARM (amd64 and aarch64).
The add-on's Documentation tab has the connection choices, the sidebar, and the published viewer port. Short version:
- **Serial:** pick the USB device. A `/dev/serial/by-id/` path stays on the same radio across reboots.
- **TCP:** point the add-on at a MeshCore TCP companion.
- **Bluetooth Low Energy:** experimental, and it needs the host Bluetooth daemon.
## Startup failure
If the add-on cannot reach the radio when it starts, it exits with a failure status instead of stopping cleanly. Turn on the add-on's **Watchdog** toggle so Home Assistant restarts it automatically, for example when the radio is not ready yet after a reboot.
## Configuration
On each start the add-on writes `/config/config.ini`. On the host that file is `/addon_configs/<prefix>_meshcore_bot/config.ini`. Edit it with the File Editor or Samba add-on.
Options you set in the add-on configuration replace the matching keys on every start. An option you leave empty leaves that key in `config.ini` alone.
The database is `/data/databases/meshcore_bot.db`. Local plugins, their translation overrides, and the optional local config overlay are in `/config/local`, which you can edit with the File Editor or Samba add-on. If the overlay `/config/local/config.ini` sets a key the add-on manages, the add-on removes that key from the overlay so its own value wins. Logs go to the add-on log.
The sidebar uses your Home Assistant login. Publish the viewer port from the add-on's Network section when you also want it on the LAN, and set a web viewer password first.
## One radio, one serial owner
Sharing one USB radio with the meshcore-ha integration is not supported. A serial port has one owner. Use a TCP companion, a second radio, or the community proxy add-on at <https://github.com/vipje/Meshcore-bot-for-Home-Assistant>.
The add-on's Documentation tab covers the connection options, `config.ini`, backups, the sidebar, and publishing the viewer port. It is also on GitHub: [MeshCore Bot add-on documentation](https://github.com/agessaman/meshcore-bot/blob/main/homeassistant/meshcore_bot/DOCS.md).
+5 -1
View File
@@ -2,4 +2,8 @@
## 1.1.0
- First release of the MeshCore Bot add-on. Options cover the radio connection, bot name, log level, and web viewer password. The web viewer opens from the sidebar.
### Added
- First release of the MeshCore Bot add-on. The sidebar opens the web viewer through Home Assistant ingress, and the viewer port can be published for access outside Home Assistant.
- Options for the radio connection (serial, TCP, or Bluetooth Low Energy), bot name, log level, and web viewer password. Empty options leave `config.ini` alone; set options override the matching keys on each start.
- `config.ini` seeded from the example on first start, custom plugins and translations in `/config/local`, and the database and configuration backups under `/data`.
+25 -12
View File
@@ -7,43 +7,56 @@ The add-on runs the MeshCore radio bot and opens its web viewer from the Home As
1. In Home Assistant, open **Settings**, then **Add-ons**, then **Add-on store**.
2. Open the menu in the upper corner and choose **Repositories**.
3. Add `https://github.com/agessaman/meshcore-bot` and install **MeshCore Bot**.
4. Start the add-on. The first start copies the example configuration if you do not already have one.
4. Start the add-on. The first start copies `config.ini.example` to `/config/config.ini` if the file is not there yet.
The add-on is built for 64-bit systems (amd64 and aarch64). The image is `ghcr.io/agessaman/meshcore-bot-ha`.
## Options
| Option | `config.ini` key |
|--------|------------------|
| `connection_type` | `[Connection] connection_type` (`serial`, `tcp`, or `ble`) |
| `serial_port` | `[Connection] serial_port` |
| `tcp_host` | `[Connection] hostname` |
| `tcp_port` | `[Connection] tcp_port` |
| `ble_device_name` | `[Connection] ble_device_name` |
| `bot_name` | `[Bot] bot_name` |
| `log_level` | `[Logging] log_level` |
| `web_viewer_password` | `[Web_Viewer] web_viewer_password` |
Options you set are applied to `config.ini` on every start. An option you leave empty is not written, so the key in `config.ini` is left alone. The add-on also applies fixed values on every start: the database path, `local_dir_path`, an empty log file so logs go to the add-on log, and the viewer settings that run it at startup behind ingress on port 8080.
## Connection
Choose one connection type. Leave the other connection fields empty so they do not overwrite `config.ini`.
Choose one connection type. Leave the fields for the other types empty so they do not overwrite `config.ini`.
**Serial.** Set the connection type to `serial` and pick the USB radio. The device list shows tty devices. A path under `/dev/serial/by-id/` stays pointed at the same radio when the machine assigns a different `/dev/ttyUSB*` name. The add-on has UART access for this.
**TCP.** Set the connection type to `tcp` and enter the hostname (or IP address) and port of a MeshCore TCP companion. The port field maps to `tcp_port`. The host field maps to `hostname`. The companion's usual port is 5000.
**TCP.** Set the connection type to `tcp` and enter the hostname (or IP address) and port of a MeshCore TCP companion. The host option is saved as `[Connection] hostname`, and the port option as `[Connection] tcp_port`. The usual port is 5000.
**Bluetooth Low Energy.** Experimental. Set the connection type to `ble` and, if you want a specific radio, its device name or address. Leave the device name empty to let the bot discover one. The add-on sets `host_dbus` so it can talk to the host BlueZ daemon. BLE depends on that daemon and does not work on every Home Assistant install.
**Bluetooth Low Energy.** Experimental. Set the connection type to `ble` and, if you want a specific radio, its device name or address. Leave the device name empty to let the bot discover one. The add-on sets `host_dbus` so it can reach the host BlueZ daemon. BLE depends on that daemon and does not work on every Home Assistant install.
## Startup failure
If the add-on cannot reach the radio when it starts, it exits with a failure status instead of stopping cleanly. Turn on the add-on's **Watchdog** toggle so Home Assistant restarts it automatically, for example when the radio is not ready yet after a reboot.
If the add-on cannot reach the radio when it starts, the bot exits with status 1 instead of stopping cleanly. Turn on the add-on's **Watchdog** toggle so Home Assistant restarts it automatically, for example when the radio is not ready yet after a reboot.
## config.ini
Inside the add-on the file is `/config/config.ini`. On the host it is `/addon_configs/<prefix>_meshcore_bot/config.ini`. Open it with the File Editor add-on or the Samba add-on. `<prefix>` is the id Home Assistant assigns this repository.
The first start copies `config.ini.example` into that path when the file is missing, so the commented example is what you edit.
## Data and local files
Options you set in the add-on configuration are written into the matching keys on every start. An option you leave empty is not written, so a value you changed in `config.ini` stays. Fixed add-on paths (the database, local plugins, and an empty log file so logs go to the add-on log) are applied on every start.
The database is `/data/databases/meshcore_bot.db`. The web viewer uses the same file. Home Assistant includes `/data` in add-on backups. The add-on also writes a backup of `config.ini` to `/data/backups` before it changes the file.
The database is `/data/databases/meshcore_bot.db`. The web viewer uses that same file. Local plugins, their translation overrides, and the optional local config overlay live in `/config/local`, which you can open with the File Editor or Samba add-on. If the local overlay `/config/local/config.ini` sets a key the add-on manages, the add-on removes that key from the overlay so its own value wins. Home Assistant includes `/data` in add-on backups. Configuration backups the add-on takes before it rewrites `config.ini` are in `/data/backups`.
Local plugins, their translation overrides, and an optional local config overlay live in `/config/local`, which you can open with the File Editor or Samba add-on. If `/config/local/config.ini` sets a key the add-on manages, the add-on removes that key from the overlay on start so its own value wins.
## Sidebar
The add-on adds a sidebar entry that opens the web viewer through Home Assistant's login. The viewer listens on port 8080 inside the add-on. The sidebar works with that port left unpublished.
The add-on adds a sidebar entry that opens the web viewer. Home Assistant users are signed in automatically, so the viewer password is not needed there. The viewer listens on port 8080 inside the add-on, and the sidebar works with that port left unpublished.
## Publishing the viewer port
The **Network** section lists port 8080, turned off until you enable it. Publish it only after you set a web viewer password. The published port is on your network and is not covered by your Home Assistant login. The sidebar is.
Until a password is set, the log reports that the viewer is bound to every interface without one. Set the password in the add-on options (or in `config.ini`) before you publish the port.
The **Network** section lists port 8080, turned off until you enable it. Publish it only after you set `web_viewer_password` in the add-on options. Requests to the published port are not covered by your Home Assistant login; the sidebar is. The viewer password applies only to the published port. The add-on sets `[Web_Viewer] ha_ingress`, so the usual log warning about an open viewer without a password is skipped.
## Sharing a USB radio
+2 -2
View File
@@ -1,5 +1,5 @@
# MeshCore Bot
Home Assistant add-on for the MeshCore radio bot. The sidebar opens the web viewer.
Home Assistant add-on for the MeshCore radio bot. It runs the bot, keeps its database under `/data`, and adds a sidebar entry for the web viewer.
Set the radio connection in the add-on options. Everything else stays in `config.ini`, which you can edit with the File Editor or Samba add-on. The Documentation tab covers install, Bluetooth, and sharing a USB radio.
Set the radio connection in the add-on options. Other settings live in `config.ini`, which you can edit with the File Editor or Samba add-on. The add-on is built for 64-bit systems (amd64 and aarch64). The Documentation tab covers install, the connection options, backups, and publishing the viewer port.