GithubHelp home page GithubHelp logo

p1-to-influxdb's Introduction

P1-to-InfluxDB

Simple Node.js application to read the P1 Smart Meter data and send it to an InfluxDB server. This application can be used as an example on how to p1-reader NPM package

Usage

Simply fill in all values of the config.json file and you should be good to go. By default it stores only the Electricity "Received" values for Tariff 1 + 2 and the Gas readings but if you want more you can easily extend the script.

Have a look at https://github.com/ruudverheijden/node-p1-reader to view all values that can be retrieved from the P1 Smart Meter.

p1-to-influxdb's People

Contributors

ruudverheijden avatar

Watchers

 avatar

p1-to-influxdb's Issues

Code seems to be broken

Hi,

Are you sure this project still works?
I'm getting 2 downright errors.

First one:

p1Reader.on('connected', portConfig => {
    console.log('Connection with the Smart Meter has been established on port: ' + portConfig.port
        + ' (BaudRate: ' + portConfig.baudRate + ', Parity: ' + portConfig.parity + ', Databits: '
        + portConfig.dataBits + 'Stopbits: ' + portConfig.stopBits + ')');
});

Here the portConfig seems to be an empty object for me.
I'm guessing all portConfig names need to change to config.p1Reader?

Second one:

    for (let i = 0; i < dataPoints.length; i++) {
        influxPoints.push({
            measurement: influxMeasurement,
            tags: {},
            fields: { 
                electricity_tarrif1: dataPoints[i].electricity_tarrif1,
                electricity_tarrif2: dataPoints[i].electricity_tarrif2,
                electricity_actual: dataPoints[i].electricity_actual,
                gas_reading: dataPoints[i].gas_reading
            },
            timestamp: new Date(dataPoints[i].timestamp)
        });
    }

influxMeasurement does not exist. I traced it back, you probably want to have config.influxDb.measurementName there.

Could you take a good look at the code again and breath some life into it?
I'd love to use it :)

Cheers,
Mark

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.