whaleygeek / pyenergenie

A python interface to the Energenie line of products
MIT License
81 stars 51 forks source link

Create a sample data logging/monitoring application for energy usage #54

Closed whaleygeek closed 8 years ago

whaleygeek commented 8 years ago

31 indicates the need for a complete example program for energy monitoring. As the existing monitor.py is just a messaging test harness, something a bit more 'out of the box' focused on monitoring long term energy usage from MiHome plugs would be useful.

Another thing I'm a little interested in is monitoring the power used by a MIHO005. I don't have any plans around this, but I can see how graphing power usage, or calculating the cost (given a per kwh figure as input?) might be useful. The monitor.py already does some of this, but it seemed a more general monitoring program than this specific use case.

whaleygeek commented 8 years ago

I've added this to the list of demo apps to write, mihome_energy_monitor.py. I might or might not write this as part of the device_classes testing branch (I want to get this work tested and merged back to master soon), so it might happen a bit later than that.

whaleygeek commented 8 years ago

I've written this demo on the device_classes branch, called mihome_energy_monitor.py.

It is not yet tested, until I test with real hardware. But it should work fine. It includes on screen display, logging to a csv file, and also get_power() calls on all found devices to display power readings, showing 3 different ways that you can generate an energy monitoring application.

whaleygeek commented 8 years ago

There is a very simple data logging application in the demo mihome_energy_monitor.py that should act as a good starting point. I'll write a better one when a couple of minor issues with the Registry/Router are resolved, but this should be good enough for people that just want to log data to a csv file, to use out of the box (seed the registry.kvs with your devices or turn on discovery_auto).