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

node-red-contrib-nordpool-api-plus

v4.5.4

Published

A Node-Red Node for collecting `day ahead` prices from Nord Pool Group.

Downloads

1,035

Readme

Node Red Nordpool API

Platform NPM Total Downloads Dependencies JavaScript Style Guide

A Node-Red Node for collecting "day ahead" prices from Nord Pool Group. This plus node gives you more features and auto tested of codebase. To be more robust.

This is a fork of the original node-red-contrib-nordpool-api, but with source code on github to make pull request possible and issue handling....

..Later that year: the original code is now uploaded here

Installation

Go to your Node-RED user folder (e.g. ~/.node-red) and run:

npm i node-red-contrib-nordpool-api-plus

This node uses the unofficial nordpool API found here.

Usage

The area and currency can be changed by selecting from the drop down menu in the properties, or by inputting the setting via a msg:

Examples:

Use a inject node to trigger a request to nordpool, to get prices for today.

Its also possible to inject a msg.date to get price from a specific date, or pricing for tomorrow. msg.date accepts any value parsable with javascript new date(). If you request tomorrows data before 14:42 there's a risk that data is not available yet and you will get the data from the current date. See API issue#1

An 24 object long array is returned on success. The objects contains this properties: timestamp, price, currency and area.

Example get price of tomorrow:

Setup an inject node info a function node and then this node. Added this to the function node to get date of today and add 1 to it.

msg.date = new Date()
msg.date = msg.date.setDate(msg.date.getDate() + 1)
return msg;

Example with dashboard chart:

In Node-RED editor, click menu at top right corner -> Import -> Examples -> node-red-contrib-nordpool-api-plus -> basic-dashboard.

Use a function node to convert msg to values readable for dashboard chart node like this:

The function node in this example contains:

let msg1 = {}
for (var i = 0; i<msg.payload.length;i++){
    msg1 = {
        topic:msg.payload[i].currency, 
        payload:msg.payload[i].price, 
        timestamp:msg.payload[i].timestamp,
    }
    node.send(msg1)
}

This could be the displayed result in:

Example modify returned:

Send returned data into a function node with this content

for (let i of msg.payload) {
    i.timestamp = new Date(i.timestamp).toLocaleTimeString('DE') // Use DE format of time
    i.price = (i.price / 1000 * 1.25).toFixed(2) // Convert from MWh to kWh and add 20% tax
    node.send({ payload: { price: i.price, timestamp: i.timestamp } })
}

Example get current price

See issue#27 for different approach to get current price.