npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pimatic-smartmeter3

v0.0.6

Published

Get energy usage data from P1 SmartMeter in pimatic

Downloads

0

Readme

pimatic-smartmeter3

Reading "Smartmeter" energy (electricity and gas) usage through P1 port. This plugin is a based on the smartmeter versions of saberone and rick00001. This plugin supports serialport version 6 (node v4 and v8) and gives the possibility to read ascii based Datagrams from Smartmeters (like the DSMR). You can change the regex formulas for the energy values in the device config. If this plugin doesn't fit, you could use the more advanced pimatic-smartmeter-obis plugin (https://github.com/bertreb/pimatic-smartmeter-obis).

Installation

To enable the smartmeter plugin add this to the plugins in the config.json file.

...
{
  "plugin": "Smartmeter3"
}
...

and add the following to the devices

{
  "id": "smartmeter3",
  "class": "Smartmeterdevice3",
  "name": "smartmeter3",
  "serialport": "/dev/ttyUSB0",
  "baudRate" : 115200,
  "dataBits" : 8,
  "parity" : "none",
  "stopBits" : 1,
  "flowControl" : true
}

Then install through the standard pimatic plugin install page.

Configuration

You can configure what serialport to use and the serialport settings.

The device provides the following 4 variables:

  • $<device id>.actualusage (Actual usage in Watt)
  • $<device id>.tariff1totalusage (Tariff 1 total usage in kWh)
  • $<device id>.tariff2totalusage (Tariff 2 total usage in kWh)
  • $<device id>.gastotalusage (Gas total usage in m3)

The number of decimals in de Gui can be changed via xAttributeOptions.

Different smartmeter versions

The current version has been tested with a DSMR5.0 smartmeter. If your smartmeter version uses different data field you can change the RegEx in de device config to meet your smartmeter.

A simple commandline tool can help to get your smartmeter data and build your RegExp. The tool is a node.js app/tool that dumps the P1 data straight to a file.

Run the following commands from the root of this plugin.

npm install
chmod +x logP1.js
./logP1.js

RegEx configuration

Below the 5 customizable Regular Expression (RegEx) fields in the config.json device section. The RegEx is used to filter out the specific data. A RegEx string need double backslashes (escape character in strings). If you edit the RegEx in the Gui Device page, you can use the normal single backslashes.

{
  "t1TotalUsage": "^1-0:1\\.8\\.1\\(0+(\\d+\\.\\d+)\\*kWh\\)",
  "t2TotalUsage": "^1-0:1\\.8\\.2\\(0+(\\d+\\.\\d+)\\*kWh\\)",
  "activeTariff": "^0-0:96.14.0\\(0+(.*?)\\)",
  "actualUsage": "^1-0:1.7.0\\((.*?)\\*",
  "gasTotalUsage" : "^0-1:24\\.2\\.1\\(\\d{12}.\\)\\(0+(\\d+\\.\\d+)\\*m3\\)"
}

If you have issues, please create an issue overe here : https://github.com/bertreb/pimatic-smartmeter3/issues