I’m investigating a ‘solution’ to the problem of monitoring energy usage with [tt]DataYours[/tt]. The basic requirements I am working towards are:
[ol][li]No need to individually select variables for power monitoring[/li]
[li]Usage aggregated into kWh per day / month / …[/li]
[li]Compatible with existing archives and plotting[/li]
[li]Possibility to use custom graphics in future[/li]
[li]Possibility to export to external services (like SEG, etc.)[/li][/ol]
As a start (1,2, and 3 above), I have modified [tt]DataWatcher[/tt] to use Vera’s [tt]live_energy_usage[/tt] reporting documented here: [url=http://wiki.mios.com/index.php/Luup_Requests#live_energy_usage]Luup Requests - MiOS. This report is polled every minute, the results converted to kWh per minute, and each value reported for each device with serviceId [tt]urn:micasaverde-com:serviceId:EnergyMetering1[/tt] and variable name [tt]EnergyUsage[/tt].
To accumulate the results correctly, data storage should be configured with an archive structure which starts with [tt]“1m:1d”[/tt] and an aggregation function of “sum”. A typical example would be [tt]“1m:1d, 1d:5y”[/tt]. This means that for the first day, the by-the-minute data is available, for any times greater than that (up to 5 years) the daily usage will be stored. If you wanted monthly reporting instead, use something like [tt]“1m:1d, 1d:30d, 30d:10y”[/tt].
In order to make this archive configuration automatic, a new rule should be added to each of the storage configuration files in the Whisper database directory:
[EnergyUsage] pattern = \.EnergyUsage retentions = 1m:1d,1d:5y
[EnergyUsage] pattern = \.EnergyUsage xFilesFactor = 0 aggregationMethod = sum
Finally, to enable this feature, the new [tt]DataWatcher[/tt] configuration variable [tt]LIVE_ENERGY_USAGE[/tt] should be set to 1. The new Whisper database files should appear on the Whisper treemap, and can be plotted as usual. Any device which is reporting power usage will be flagged as being watched in the Devices display, although viewing the individual variables of any such device will not show that anything is being watched in the conventional sense (because it isn’t.)
The performance of this entirely relies on the accuracy of Vera’s live_energy_usage reporting, but I’ve been trying it out for a few days and it seems OK. A simple example of a daily and weekly report is attached below, along with the updated [tt]L_DataWatcher.lua[/tt] file.
I’d welcome any experiences of anyone trying this out. Thanks.