Energy monitoring with a Current Cost 128 is a bit boring, plus their software/web based thing is pants.
That all worked well in the past, but unfortunately, it broke with MySQL 5.7 (and yes, I did try changing every instance of ‘mysql_xxx’ to ‘mysqli_xxx’, but nothing’s ever that simple).
The python/datalogger side still worked fine for dealing with the XML and stuffing the database, so I boshed some crude php together (and learned a lot about MySQL5/flot/js in the process), threw in a date/timepicker and here we go:
I use a separate php page for each channel and session variables to send the date/time info back for each query. It needs some tidying up (thinning out the data, for a start), but has proved pretty stable so far.
I ditched the CC USB (PL3032?) serial adapter and went straight from the RJ45 on the display unit to the serial GPIO pins on the Raspberry Pi 3 (well, I needed the USB adapter for torturing BT Home Hub 5As, but that’s another story).
The third dataset (channel) is not used as I have only two sensors feeding it for now, but the empty channel is used (always ‘displayed’) so as to give the second x-axis (time) something to go on – I couldn’t figure out how to give a dataset more than one x-axis scale (i.e. day/date on top and time of day on bottom), so I just use the time stamps (from dataset3) with zero data.
This is because (like most things) I’m just too damn lazy to do it properly. 🙂