2025 to now, still updating it

Zaylo Remote

The app that runs my light switch and blinds. It's a web app you can install on a phone, with live updates over MQTT, shared homes on Firebase, and a Bluetooth rescue screen for when a device loses its Wi-Fi.

Type
Installable web app (PWA)
Live updates
MQTT over WebSockets
Accounts
Firebase
Rescue
Web Bluetooth
This is the real app in demo mode, so tap around. The devices are pretend ones and nothing here talks to my hardware.

One place for everything

Once I had a light switch and a blinds controller, I wanted one place to control both. The dashboard opens straight away with the last state it saw, then updates as MQTT messages arrive from the devices.

Firebase handles sign-in and shared homes, so everyone in the house can use the same devices from their own phone and see the same state.

The other problem it solves is Wi-Fi. A new router or a changed password can leave a device offline, and without the app the only fix would be opening the case. Instead the setup screen connects to the device over Bluetooth, sends it the new details and shows its diagnostics.

How the app connects

There are three separate routes: Firebase for accounts and shared homes, MQTT for controlling the devices live, and Web Bluetooth for setting them up or rescuing them.

How Zaylo Remote connects The app talks to Firebase over HTTPS for accounts, to a Mosquitto broker over MQTT WebSockets, which relays messages to the ESP32-C6 devices. For setup and rescue the app connects to a device directly over Bluetooth. HTTPS WebSockets MQTT Bluetooth Firebasesign-in and shared homes Zaylo Remoteweb app on the phoneone shared state store Mosquitto brokerMQTT over WebSocketsrelays device state ESP32-C6 deviceslight switchblinds controller Setup and rescuestraight to one device
  1. App↔Firebase

    HTTPS, for sign-in and shared homes.

  2. App↔MQTT broker

    WebSockets, for live commands and state.

  3. Broker↔Devices

    MQTT, relaying the messages both ways.

  4. App→One device

    Bluetooth, for setup and rescue when Wi-Fi isn't working.

Solid lines carry everyday traffic. The dashed Bluetooth link is only used for setup and rescue.

What's going on inside

Everything hangs off one shared store that holds the devices, the home and the user. When a device changes, or someone else's phone sends a command, every screen updates from that one place, and sessionStorage carries it between pages.

A home groups the devices that belong together. Other people in the house join with an invite and their own account, and the Firestore rules only let members of a home see its devices.

Commands go out through the broker and the app listens for the state coming back from the device, so the controls stay in step with what the hardware is actually doing.

The Bluetooth rescue needs a browser with Web Bluetooth, so Chrome or Edge rather than Safari. It connects straight to a device nearby, shows its logs and sends it new Wi-Fi details. That's my way back in when something can't reach the router.

A service worker caches the files, so it can go on the home screen and open like a normal app. The demo at the top of this page swaps the broker and Firebase for pretend ones, so the blinds really do move, just not any real ones.

The screens

Most of these are in the demo at the top of the page.

  1. Home

    Every device with its live status, a switch between shared homes, and the invite flow for adding the rest of the household.

  2. Light switch

    On and off, the five modes, the alarm, the radar settings and schedules for the presence automations.

  3. Blinds

    A slider for any position from closed to open, saved favourite positions, sunrise and sunset schedules, single-step nudges, and recalibrating the limits if the chain changes.

  4. Spaces

    Scenes, groups and automations that control several blinds at once.

  5. Setup and rescue

    A step-by-step pairing flow over Bluetooth: pick a network, enter the broker details and check the device answers. Nothing to install.

  6. Diagnostics

    Live MQTT traffic, round-trip times, the service worker's state and the Firestore sync log. It's the screen I open when something looks wrong.

The hardware on the other end

I wrote the app for these two. Their pages go into the hardware and firmware properly.