How anszom/rethink works
rethink is a local replacement for LG ThinQ’s cloud service: it receives appliance traffic, translates device state and commands into Home Assistant-compatible MQTT, and optionally forwards traffic to LG’s cloud for coexistence or reverse engineering. The main stages are ThinQ connectivity, device/model interpretation, and Home Assistant publication; management exposes runtime controls. The bridge has separate authentication and forwarding responsibilities. Some runtime entry-point and protocol files were not sampled, so those links rely on README statements or are omitted where the caller is not evidenced.
Main entry points: bridge/index.ts Bridge coordinator · devmgr.ts Device manager · management/index.ts Management API · device.ts ThinQ2 connection
Components 21
Runtime and management
- Cloud service
rethink-cloud.ts - Management API
management/index.ts - Device manager
cloud/devmgr.ts - Runtime configuration
util/config.ts
ThinQ protocols
- Device MQTT broker
cloud/mqtt-broker.ts - ThinQ1 connection
cloud/thinq1/device.ts - ThinQ2 connection
cloud/thinq2/device.ts - CLIP messages
cloud/thinq2/clip.ts
Device translation
- Appliance adapters
cloud/devices - Adapter base
cloud/devices/base.ts - Home Assistant translation
cloud/ha_bridge.ts - Home Assistant MQTT
cloud/homeassistant.ts
LG cloud bridge
- ThinQ API client
bridge/thinqApi.ts - OAuth2
bridge/oauth2.ts - Bridge coordinator
bridge/index.ts - ThinQ1 forwarding
bridge/thinq1connection.ts - ThinQ2 forwarding
bridge/thinq2connection.ts
Other components
- Operator
- LG appliances
- Home Assistant
- LG ThinQ cloud
Connections 25
- Operator → Management API: controls
README.md - LG appliances → Cloud service: connects to
README.md - Cloud service → ThinQ1 connection: emulates ThinQ1
- Cloud service → ThinQ2 connection: emulates ThinQ2
- ThinQ2 connection → Device MQTT broker: uses broker
cloud/thinq2/device.ts - ThinQ2 connection → CLIP messages: parses messages
cloud/thinq2/device.ts - ThinQ1 connection → Device manager: registers devices
cloud/devmgr.ts - ThinQ2 connection → Device manager: registers devices
cloud/devmgr.ts - Device manager → Home Assistant translation: announces devices
cloud/ha_bridge.ts - Home Assistant translation → Appliance adapters: selects model adapter
cloud/ha_bridge.ts - Appliance adapters → Adapter base: extends base
cloud/devices/F3P2CYUBE__.ts - Home Assistant translation → Home Assistant MQTT: translates properties
cloud/ha_bridge.ts - Home Assistant MQTT → Home Assistant: publishes MQTT
README.md - Home Assistant → Home Assistant MQTT: sends commands
cloud/homeassistant.ts - Management API → Device manager: manages devices
management/index.ts - Management API → Home Assistant translation: observes status
management/index.ts - Management API → Bridge coordinator: controls bridge
management/index.ts - Bridge coordinator → Device manager: tracks devices
bridge/index.ts - Bridge coordinator → ThinQ API client: authenticates and adds
bridge/index.ts - ThinQ API client → OAuth2: requests tokens
bridge/thinqApi.ts - Bridge coordinator → ThinQ1 forwarding: forwards ThinQ1
bridge/index.ts - Bridge coordinator → ThinQ2 forwarding: forwards ThinQ2
bridge/index.ts - ThinQ1 forwarding → LG ThinQ cloud: forwards traffic
README.md - ThinQ2 forwarding → LG ThinQ cloud: forwards traffic
README.md - Runtime configuration → Home Assistant MQTT: configures connection
cloud/homeassistant.ts