Flow App
June 2022
Built with three classmates for our PWR course: a Raspberry Pi reads the Fluvius digital meter over its P1 port and switches ESP8266-based smart plugs, a Python service parses the data and stores it in InfluxDB on Azure, and a React Native app (Flow) shows live usage, cost and per-appliance breakdowns.
The idea
This was a group project for our PWR course, built with three classmates over one semester. With electricity prices spiking, we wanted to give people a clear, live picture of what their home is actually using, down to the appliance, instead of the vague yearly estimate on a bill. The plan: read the digital meter directly, switch a few appliances through our own smart plugs, and show it all in a mobile app called Flow. The brief set real constraints too: the whole build had to stay under €80, the plug's own standby draw under 1W, and its PCB no bigger than a bank card.
System overview
The digital meter exposes live consumption over its P1 port. A Raspberry Pi reads that, reformats it, and pushes it to the cloud; from there an app on the phone can pull it back down. Separately, a handful of custom smart plugs (for things like the washing machine, an EV charger or the AC) can be switched from the same app, so usage and control live in one place.
Designing the smart plug's power supply
Each smart plug needed to make its own low-voltage supply from mains, on a budget of under 1W standby and a board no larger than a bank card. We designed a small flyback supply around a TNY278PN switching regulator: a bridge rectifier turns 230VAC into a rough DC bus, the TNY278 drives the transformer's primary, and an optocoupler feedback loop (OK1) regulates the output voltage. RC and LC filtering on the output keeps the 5V/12V rails clean enough for the relay and the ESP8266 on the secondary side.
Building the smart plug
Each plug is a NodeMCU (ESP8266) driving a relay module that switches the live conductor to the socket. The ESP connects over WiFi, so a plug can be switched, and its state read back, from the app anywhere on the network.
Reading the digital meter
The Fluvius digital meter streams a telegram out of its P1 port every few seconds: instantaneous power, cumulative day/night consumption, per-phase voltage and current, and gas usage, all as plain text. We built a small RS485/differential interface around a MAX3485 to read that port reliably and level-shift it into the Raspberry Pi.
Making sense of the data
Each value in the telegram is tagged with an OBIS code rather than a name, so a Python script on the Pi maps those codes (things like "1-0:1.7.0" for total power draw) to readable fields before anything gets stored.
Storing and serving the data
The parsed readings are written to an InfluxDB time-series database hosted on Azure, tagged per meter. An ExpressJS API in front of it lets the app request a given time range (hour/day/week/month) and metric, and also handles the cost calculation shown in the app.
Building the app
The Flow app itself is a React Native/TypeScript app that talks to our API, showing today's cost, a usage graph you can switch between hour/day/week/month, and a settings screen to control the smart plugs and toggle dark mode.