Device::Neurio - Methods for accessing data collected by a Neurio sensor module.
Version 0.04
This module provides a Perl interface to a Neurio sensor via the following methods: - new - connect - fetch_Last_Live - fetch_Recent_Live - fetch_Samples - fetch_Full_samples - fetch_Energy_Stats 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. Here is some sample code: use Device::Neurio; my $Neurio = Device::Neurio->new($key,$secret,$sensor_id); $Neurio->connect(); $data = $my_Neurio->fetch_Last_Live(); $data = $my_Neurio->fetch_Recent_Live(); $data = $my_Neurio->fetch_Recent_Live("2014-06-18T19:20:21Z"); print Dumper($data); undef $Neurio;
Creates a new instance to fetch data for a unique Neurio sensor. my $Neurio = Device::Neurio->new($key,$secret,$sensor_id); This method accepts the following parameters: - $key : unique key for the account - Required parameter - $secret : secret key for the account - Required parameter - $sensor_id : sensor ID connected to the account - Required parameter The Object is returned if successful. If one or more parameters is omitted, 0 is returned to indicate failure.
Opens a secure connection via HTTPS to the Neurio server which provides access to a set of API commands to access the sensor data. $Neurio->connect(); This method accepts no parameters Returns 1 on success and 0 on failure.
Retrieves recent sensor readings from the Neurio server. $Neurio->fetch_Recent_Live($last); This method accepts the following parameters: $last - yyyy-mm-ddThh:mm:ssZ - Optional parameter Return value is a Perl data structure containing all the raw data
Retrieves the last live sensor reading from the Neurio server. $Neurio->fetch_Last_Live(); This method accepts no parameters Return value is a Perl data structure containing all the raw data
Retrieves sensor readings within the parameters specified. $Neurio->fetch_Samples($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 - freqnecy : an integer - Optional Return value is a Perl data structure containing all the raw data On failure, 0 is returned
Retrieves full sensor readings including all phases within the parameters specified. $Neurio->fetch_Full_Samples($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 - freqnecy : an integer - Optional Return value is a Perl data structure containing all the raw data On failure, 0 is returned
Retrieves energy statistics within the parameters specified. $Neurio->fetch_Energy_Stats($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 - freqnecy : an integer - Optional Return value is a Perl data structure containing all the raw data On failure, 0 is returned
Kedar Warriner, kedarwarriner at gmail.com
kedarwarriner at gmail.com
Please report any bugs or feature requests to C<bug-device-Neurio at rt.cpan.org> or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Device-Neurio> 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::Neurio You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Device-Neurio
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Device-Neurio
CPAN Ratings
http://cpanratings.perl.org/d/Device-Neurio
Search CPAN
http://search.cpan.org/dist/Device-Neurio/
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. 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::Neurio, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Neurio
CPAN shell
perl -MCPAN -e shell install Device::Neurio
For more information on module installation, please visit the detailed CPAN module installation guide.