data aquisition & database

  • So, I got my first Shellies going over MQTT, Plug & Plug-s. Incomming signals seem to be fine. Now the design work on the database is on its way.

    I'm using SQLite. First the set up for energy. A Shelly Plug emits data every 30s (and some extras now and then). Those are written to an array with a length of "1 hour" (~120 data points) in the e30s table. There's a trigger that checks when the next hour starts. A new array is now being filled. Also the last energy value goes into an array in the e1h table, that array is "24h" long. Once full, same again to a 1year array (365 data points long) in the energy year table. Over time the e30s data will be pruned.

    Now, what to do with power? When a hour long 30s array is full, should I just average the power values to write in the 1day long 1hour array? What value / meaning does that average have? I understand the Shellies only report the power at the moment of data transmission. Not some average over an interval?

    I have not looked at roll over, drop outs, resets etc. An easy way out would be to set the counters to zero every 24h. But that does not seem possible? A reboot works but is not possible by MQTT? Is http//.../reboot the only way?

    (Eine antwort auf Deutsch ist kein problem fuer mich)

    SIMPLEX SIGILLVM VERI