Edmir Soares
Edmir Soares

[IOT_05] · Learning project

IoT MQTT Controller

Remote valve control over MQTT with a command and confirmation flow.

  • Flutter
  • BLoC
  • MQTT
Source code on GitHub (opens in a new tab)
Phone simulator showing the valve control panel next to the MQTT client log with OPEN and CLOSED status messages.

[01] Problem

Learn how a mobile app commands an industrial device and stays in sync with its real state.

[02] Solution

  • Two MQTT topics: the app publishes OPEN or CLOSED on the command topic; the device answers on the status topic.
  • The UI only changes when the status comes back: command, then confirmation.
  • Clean Architecture (domain, data, presentation), BLoC, get_it and explicit errors with Either (fpdart).
  • Broker settings kept out of the source code in .env.

[03] Result

  • Valve state shown in real time from the status topic, tested with an MQTT client against a public broker.

[04] Architecture

  1. Flutter UI
  2. ValveBloc
  3. MQTT · cmd
  4. Device
  5. MQTT · status