# device-control-service (Go) Status: not implemented yet. Responsibility: - Expose a gRPC API (see `proto/device_control.proto`) for issuing commands to devices — called by Laravel (manual control) and rule-engine-service (rule-triggered actions). - Publish the command to the device's MQTT topic (`devices/{device_id}/commands`) and listen for acknowledgements (`devices/{device_id}/ack`). - Maintain the Device Shadow pattern in Redis: `desired_state` (what the user wants) vs `reported_state` (what the device confirmed), plus `status` and `last_seen`. - Owns the health-check loop (or delegates to health-check-service): a ticker goroutine that flips a device to `offline` when `last_seen` exceeds a timeout, and emits an event for notification-service. Not this service's job: deciding *when* to send a command based on sensor thresholds — that's rule-engine-service's logic. This service only executes and tracks state for whatever command it's given.