Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Matching uses **unique_id** patterns (`{entry_id}_relay_*`, `{entry_id}_serial_*

2. **Options flow menus** — some steps use **`vol.In({...})`** instead of **`SelectSelector`** for broader HA compatibility.

3. **Translations** — `options.step.remote_commands` needs **`description`** + **`{hint}`** placeholder. **`options.step.init.data.next`** in `strings.json`. IR/serial command JSON uses **`TextSelector(multiline=True)`** (textarea), not a single-line field. Learn IR uses **`learn_ir`** / **`learn_ir_capture`** with placeholders `{timeout}`, `{command}`, `{detail}`.
3. **Translations** — `options.step.remote_commands` needs **`description`** + **`{hint}`** placeholder. **`options.step.init.data.next`** in `strings.json`. IR/serial command JSON uses **`TextSelector(multiline=True)`** (textarea), not a single-line field. Learn IR uses **`learn_ir`** / **`learn_ir_capture`** with placeholders `{timeout}`, `{command}`, `{detail}`, and **`{ir_hint}`** on `learn_ir` (always pass a non-empty placeholder so HA does not show the raw token). When creating a remote mid-learn, the form key is **`remote_name`** (not `name`) because `CONF_REMOTE_NAME` and `CONF_CMD_NAME` both serialize as `"name"`.

4. **Do not use `listen` as a config-flow field key** — Home Assistant does not apply `options.step.*.data.listen` labels; UI shows raw `listen`. Use **`monitor_incoming`** with label *Monitor incoming data (persistent connection)* (plain **`bool`**, same as `append_cr`).

Expand All @@ -92,7 +92,7 @@ Matching uses **unique_id** patterns (`{entry_id}_relay_*`, `{entry_id}_serial_*

13. **Git / releases** — semver bumps via [`.github/workflows/release.yml`](.github/workflows/release.yml) (workflow_dispatch). Each release attaches **`globalcache_itach.zip`** (integration files at zip root) for HACS `zip_release` download counting; [`hacs.json`](hacs.json) sets `zip_release` + `filename`. `WORKFLOW_TRIGGER_TOKEN` enables automated manifest-bump PRs; without it, open the compare URL from the workflow summary. **Do not** add `Co-authored-by: Cursor` to commits; history was rewritten (2026-06-05) to remove it from `main` and retag `v1.0.0`.

14. **Pinhole Learn IR** — Options **Learn IR command (pinhole)** calls `get_IRL`, waits for one `sendir` line, `stop_IRL`, then stores `full_sendir` on the chosen remote via `rewrite_sendir_connector` (learner always reports `1:1`).
14. **Pinhole Learn IR** — Options menu is built by [`options_menu.build_options_init_menu`](custom_components/globalcache_itach/options_menu.py). **Learn IR command (pinhole)** is **always** listed (even with zero remotes); edit/remove remote/relay/serial entries are omitted when their lists are empty. Flow: `get_IRL` → wait for one `sendir` → `stop_IRL` → store `full_sendir` via `rewrite_sendir_connector` (learner always reports `1:1`). With no remotes, `async_step_learn_ir` collects remote name + module/port and creates the remote on successful capture.

15. **Infrared timing padding** — `infrared-protocols` NEC (and similar) frames end on a mark with no trailing space. `us_timings_to_gc_pairs` pads with a **~40 ms** off pulse (not the ~80 µs GC minimum), otherwise LG Infrared / other consumers fail to decode on the TV.
## Documentation
Expand Down Expand Up @@ -134,19 +134,25 @@ cannot import name 'DhcpServiceInfo' from 'homeassistant.components.dhcp'

Config entry shows **`setup_error` / Import error**. Deploy manifest **1.0.2+** (or cherry-pick the one-line import change in `config_flow.py`), then restart HA or reload the integration.

## Production / deployment snapshot (2026-07-31)
## Production / deployment snapshot (2026-09-21)

| Environment | Integration version | Status |
|-------------|---------------------|--------|
| **HACS default** | Search **Global Caché iTach** / **GlobalCache** | Added via [hacs/default#8063](https://github.com/hacs/default/pull/8063) |
| **Latest release** | **v1.0.3** | https://github.com/Shaffer-Softworks/GlobalCache/releases |
| **Latest release** | **v1.1.3** | https://github.com/Shaffer-Softworks/GlobalCache/releases/tag/v1.1.3 |

Install via HACS (default feed) preferred; custom-repository install is no longer needed.

### v1.1.3 release notes (summary)

- **IP2CC config validation** — accept bare `getversion` firmware replies ([#17](https://github.com/Shaffer-Softworks/GlobalCache/issues/17))
- **iTach RECEIVER probe** — skip on non–Global Connect so IP2IR / WF2IR stop logging spurious reload warnings ([#18](https://github.com/Shaffer-Softworks/GlobalCache/issues/18))
- **`via_device_id`** — replace deprecated `via_device` for HA 2027.8 ([#19](https://github.com/Shaffer-Softworks/GlobalCache/issues/19))

## Optional follow-ups (not implemented)

- YAML import from core `itach` integration if applicable

---

*Last updated: 2026-09-20 — bare getversion / IP2CC config validation (#17).*
*Last updated: 2026-09-21 — Learn IR always visible in Configure; CONTEXT production snapshot → v1.1.3.*
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,22 @@ Open **Configure** on the integration card (gear icon on older layouts):
| **IR defaults** | Carrier frequency, repeat, offset, sendir ID policy (auto-increment vs fixed). |
| **Timeouts** | Connect and command timeouts. |
| **Add remote** | Name, module/port (e.g. module `1`, port `2` → connector **1:2**), repeat multiplier, **JSON command list**. |
| **Learn IR command (pinhole)** | Pick a remote and command name → Submit → aim the handheld at the iTach **pinhole** within the timeout. Saves a **`full_sendir`** button (rewrites connector to the remote’s module:port). Same name replaces an existing command. |
| **Edit remote** / **Remove remote** | Change or delete a configured remote (entity IDs stay stable on edit). |
| **Learn IR command (pinhole)** | Always available in Configure. Pick an existing remote (or enter a name + IR connector to create one) and a command name → Submit → aim the handheld at the iTach **pinhole** within the timeout. Saves a **`full_sendir`** button (rewrites connector to the remote’s module:port). Same name replaces an existing command. |
| **Edit remote** / **Remove remote** | Change or delete a configured remote (entity IDs stay stable on edit). Shown only when at least one remote exists. |
| **Add relay** / **Edit relay** / **Remove relay** | Relay `switch` entities via `setstate` / `getstate`. |
| **Add serial port** / **Edit serial** / **Remove serial** | Serial `text` entity, optional preset **buttons**, **Last received** sensor. |

#### Learn IR (pinhole)

iTach / GC-100 / Flex do **not** expose room IR receive (`RECEIVER`). Use **Configure → Learn IR command (pinhole)** (`get_IRL` / `stop_IRL`) instead:

1. Open **Configure** on the hub (Learn IR is always in the Action list, even with no remotes yet).
2. If you already have remotes: pick one, enter a command name and timeout.
3. If you have none: enter a new remote name, IR module/port, command name, and timeout — the first successful capture creates that remote.
4. Submit on the capture step, then hold the handheld remote 1–2 inches from the iTach **pinhole** and press one button within the timeout.

The learned line is stored as a **`full_sendir`** command button (connector rewritten to the remote’s module:port). Automations can also use services `ir_learner_start` / `ir_learner_stop` and the bus event `globalcache_itach_ir_learned`.

### Devices and entities

Each **gateway** is one hub device with diagnostic sensors (**TCP connected**, **Last gateway poll**, **Configured remotes**, optional **Gateway diagnostics**), plus one **`infrared` emitter** per IR connector discovered via `getdevices` (and, on **Global Connect** only, an optional **receiver** when a jack is in `RECEIVER` mode). Each configured **remote** appears as a child device with one **button** per JSON command.
Expand Down Expand Up @@ -178,7 +189,7 @@ Protocol reference: [iTach API (PDF)](https://www.globalcache.com/files/docs/API
- One **serialized** TCP client per config entry with **connect retries** and **EOF recovery** so the next command opens a new session. Multiple Home Assistant instances or other controllers talking to the same iTach can still contend on port **4998**.
- **Relay** and **serial** connectors are configured in **integration options** (like remotes). Serial payloads use the Unified TCP data socket (**control port + module**, e.g. 4999 for module 1 when control is 4998). Confirm module/port wiring on your SKU (IP2CC relays are often module **3**; **GC-100-12** relays are module **3**, IR emitters modules **4** and **5** — run `get_devices` or check diagnostics).
- **GC-100** allows only **one** TCP client on port **4998** at a time; avoid iHelp/other tools holding that port while Home Assistant is connected.
- **IR learner** — use **Configure → Learn IR command (pinhole)** to capture a `sendir` line and append it to a remote as a **button** (`full_sendir`). Services `ir_learner_start` / `ir_learner_stop` and bus events remain for automations; Global Caché’s **iLearn** utility is still useful for advanced editing.
- **IR learner** — use **Configure → Learn IR command (pinhole)** (always listed, even with no remotes yet) to capture a `sendir` line and append it to a remote as a **button** (`full_sendir`). With no remotes, the same flow creates one. Services `ir_learner_start` / `ir_learner_stop` and bus events remain for automations; Global Caché’s **iLearn** utility is still useful for advanced editing.
- **`infrared` receivers** / `set_IR RECEIVER` / `receiveIR` are **Global Connect only** (Unified TCP API). On iTach/GC-100/Flex the integration does not probe for RECEIVER or create receiver entities; use emitters plus the **pinhole learner** (`get_IRL`). Raw `set_ir` / `receive_ir` services remain for advanced use but `RECEIVER` is invalid on non–Global Connect hardware.
- Removing a remote, relay, or serial port from options **deletes** its entities from the registry on reload (they are not left as orphaned grey entities).

Expand Down
Loading
Loading