Repository navigation
ShellyEMMonitorLEDs v2.0-RC3 - Lets get testing!
I'm developing with a 3 channel Shelly EM3 Pro, but using it to monitor three different circuits 1) solar input, 2) grid input and 3) house consumption. I want to develop this to work with two standalone Shelly EMs. If you are willing to be a tester, please reach out.
What is this for? It's an information radiator. My goal is to have a clear visual indicator of how much FREE energy is available to use, mostly for my dear wife who has a love of turning on as many appliances as possible just after sunset!!!
Highlights
- Persistent Trends – 30‑minute and daily averages are now written to LittleFS (/history/24h.bin / /history/30d.bin) and reloaded at boot; the dashboard “Clear Stored History” button (and /history/reset) purges all three datasets when needed.
- Push-first Data Flow – The ESP32 automatically issues Shelly.Subscribe at every websocket connect, so NotifyStatus updates stream in without polling. Active polling is now an optional toggle on the config page.
- Chronological Charts – Real-time samples are timestamped with Shelly’s ts/sys.unixtime and inserted in order, eliminating “time-travel” kinks. The 24 h / 30 d graphs now use stacked bar charts for clearer comparisons.
- Less Noise – Source-map references were removed from bundled JS, preventing repeated LittleFS 404s. /history/reset handles missing .bin files gracefully.
Key Changes
- Added historical persistence layer: in-RAM 1 h buffer, plus 30‑minute (24 h) and daily (30 d) ring buffers stored on LittleFS; /history/reset and UI button wipe these files.
- Added activePollingEnabled setting, default off; Shelly push subscription lifecycle is now automatic via startShellySession().
- Updated timestamp pipeline (extractShellyTimestampMs, JSON responses include timestamp, frontend uses moment.utc) so all graphs use Shelly’s clock.
- Introduced chronological insertion helper addRealtimePoint() to keep Chart.js datasets strictly ordered.
- 24 h/30 d charts switched to stacked bars; history loads as soon as the dashboard opens.
- README updated for RC3 (capabilities, storage layout, release notes).
Upgrade Notes
- If you run uploadfs, the stored /history/24h.bin and /history/30d.bin files are erased; either back them up or let the device rebuild them over time.
- No new partition changes since RC2: once you’ve performed the original serial flash, OTA + uploadfs flows remain the same.
- After updating, consider clearing history once via the new button so the bar charts rebuild cleanly with RC3’s timestamp handling.