Device::NeurioTools - More complex methods for accessing data collected by a Neurio sensor module.
Version 0.04
This module allows access to more complex and detailed data derived from data collected by a Neurio sensor. This is done via an extended set of methods: - new - connect - set_rate - get_cost - get_kwh Please note that in order to use this module you will require three parameters (key, secret, sensor_id) as well as an Energy Aware Neurio sensor installed in your house. The module is written entirely in Perl and has been tested on Raspbian Linux.
use Device::Neurio; use Device::NeurioTools; my $my_Neurio = Device::Neurio->new($key,$secret,$sensor_id); $my_Neurio->connect(); my $my_NeurioTools = Device::NeurioTools->new($my_Neurio); $my_NeurioTools->set_timezone(); $my_NeurioTools->set_rate(0.08); my $kwh = $my_NeurioTools->get_kwh("2014-06-24T00:00:00".$my_NeurioTools->get_timezone(), "minutes", "2014-06-24T23:59:59".$my_NeurioTools->get_timezone(), "5");
All by default.
#*****************************************************************
Creates a new instance of NeurioTools which will be able to fetch data from a unique Neurio sensor. my $Neurio = Device::NeurioTools->new($neurio); This method accepts the following parameters: - $neurio : a valid CONNECTED Neurio object Returns 1 on success Returns 0 on failure
Defines the rate charged by your electricity provider. $NeurioTools->set_rate($rate); This method accepts the following parameters: - $rate : amount charged per kwh - Required Returns 1 on success Returns 0 on failure
Returns the value for rate set using 'set_rate()' $NeurioTools->get_rate(); This method accepts no parameters Returns rate
Sets the timezone offset. If no parameter is specified it uses the system defined timezone offset. $NeurioTools->set_timezone($offset); This method accepts the following parameters: - $offset : specified timezone offset in minutes - Optional Returns 1 on success Returns 0 on failure
Returns the value for the timezone offset in minutes $NeurioTools->get_timezone(); This method accepts no parameters Returns timezone offset
Calculates the cost of consumption over the period specified. $NeurioTools->get_cost($start,$granularity,$end,$frequency); This method accepts the following parameters: - start : yyyy-mm-ddThh:mm:ssZ - Required - granularity : seconds|minutes|hours|days - Required - end : yyyy-mm-ddThh:mm:ssZ - Optional - frequency : an integer - Optional Returns the cost on success Returns 0 on failure
Calculates the kwh of consumption over the period specified. $NeurioTools->get_kwh($start,$granularity,$end,$frequency); This method accepts the following parameters: - start : yyyy-mm-ddThh:mm:ssZ - Required specified using ISO8601 format - granularity : seconds|minutes|hours|days - Required - end : yyyy-mm-ddThh:mm:ssZ - Optional specified using ISO8601 format - frequency : an integer - Optional Returns the kwh on success Returns 0 on failure
Kedar Warriner, kedar at cpan.org
kedar at cpan.org
Please report any bugs or feature requests to C<bug-device-NeurioTools at rt.cpan.org> or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Device-NeurioTools I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command. perldoc Device::NeurioTools You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Device-NeurioTools
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Device-NeurioTools
CPAN Ratings
http://cpanratings.perl.org/d/Device-NeurioTools
Search CPAN
http://search.cpan.org/dist/Device-NeurioTools/
Many thanks to: The guys at Energy Aware Technologies for creating the Neurio sensor and developping the API. Everyone involved with CPAN.
Copyright 2014 Kedar Warriner <kedar at cpan.org>. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information.
To install Device::NeurioTools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::NeurioTools
CPAN shell
perl -MCPAN -e shell install Device::NeurioTools
For more information on module installation, please visit the detailed CPAN module installation guide.