How it works
This Coreflux LoT template turns a machine state signal into a downtime log on the broker. Raw state comes in under raw/factory/hall-a/line-1/<machine>/machine_state (0 planned stop, 1 running, 2 idle, 3 fault). A line clock ticks each machine every 5 seconds. When a machine goes idle or faults, one Action opens a downtime episode, counts its seconds and closes it when the machine runs again. Operators send a reason code over MQTT from any HMI button, scanner or phone app. Stops shorter than 60 seconds are filed as micro-stops, and stops nobody coded stay as unknown, so the Pareto shows how much downtime has no explanation. It runs on the free Community licence.
