This is a new library of mine built on top of the recently announced esp8266_web_settings library.
It provides a generic framework for sensors or other "devices" (devices, unfortunately, being a somewhat ambiguous term in this context) that should make assembling sketches with an nice settings UI fairly easy. Hopefully we can build up a good library of "devices" if people like this.
There is much documentation there, and a fully working example that happens to be the code I'm using for an Ikea Vindriktning air quality sensor with an added SHT31-D temperature/humidity sensor.
Technically the UI belongs to the esp8266_web_settings library, but here's a screen shot of the web interface:
Via the esp8266_web_settings, a soft access point with a captive portal for initial configuration is provided automatically.
At present two physical sensors, the Vindriktning and the SHT31-D are supported; plus 5 "devices" as can be seen from the screen shot:
- System Overview: a continually updating summary of system information;
- System Details: a static list of system information like chip ID, sketch size, and the like;
- WiFi status: a continually updating summary of WiFi status;
- WiFi: a configuration panel for WiFi (does not scan for networks);
- and MQTT: a configuration panel for MQTT (message publishing) that works with Home Assistant.
The main .ino file ends up being fairly simple, and you only get the bits you need; the compiler is smart enough to omit code that isn't used (aside: as long as there are few or no static variables).
More snapshots of the individual panels are in the Git repository.
One interesting issue that came up in development, though, is the size of the ESP Async Web Server library. The standard one, GitHub - me-no-dev/ESPAsyncWebServer: Async Web Server for ESP8266 and ESP32, compiles to a whopping 959K library file, and is correspondingly large in the ESP8266 binary (I got up to 60% of flash on my D1 Mini). The ESP Home fork, GitHub - esphome/ESPAsyncWebServer: Async Web Server for ESP8266 and ESP32, weighs in at 540K. Unfortunately, the ESP Home folks haven't said what they took out to reduce it to that size, but at least for the usage in this framework both libraries seem to work equivalently, aside from the size. So my recommendation is to use the me-no-dev version if you have the space to allow it, and use the esphome version if you don't. I am, personally, in the latter space; I can't fit the full sketch on the D1 Mini and have it function with the me-no-dev version.