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 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-nordpool-cheapest-range

v1.5.4

Published

Homebridge plugin to create virtual sensors for the cheapest electricity hours within custom time windows using Nordpool data.

Downloads

847

Readme

Homebridge Nordpool Cheapest Range

Automate heavy appliances during the cheapest Nordpool electricity hours within your custom time windows.

This Homebridge plugin creates virtual Contact Sensors in HomeKit. The sensor opens (triggers) when the electricity is at its cheapest within a specific time frame that you define, allowing you to run water heaters, EV chargers, or heat pumps at the most optimal times.

🇫🇮 Suomenkieliset ohjeet löytyvät alempaa.


Features

  • Custom Time Windows: Define when your appliance can run (e.g., only between 20:00 and 08:00).
  • Cheapest Hours: Set how many hours the appliance needs to run within that window (e.g., the 3 cheapest hours).
  • "Double Pulse" Reliability: HomeKit automations can sometimes miss long, continuous states. This plugin uses a specialized "Double Pulse" strategy: every hour, the sensor briefly toggles its state to guarantee that your automations are reliably triggered, even if you create them mid-cycle.
  • Eve App History Support: Fully supports Fakegato-history. View your cheap/expensive hour logs beautifully graphed in the Eve app.
  • Solar Override: Includes support for solar panel overrides (if configured). (Not available yet!)

How It Works in HomeKit

To prevent accidental manual toggles by users, this plugin exposes devices as Contact Sensors (Door/Window sensors).

  • OPEN (Contact Not Detected) = Electricity is CHEAP. Turn your appliances ON.
  • CLOSED (Contact Detected) = Electricity is EXPENSIVE. Turn your appliances OFF.

Example Automation Setup

  1. Open the Apple Home app → Automations+A Sensor Detects Something.
  2. Turn ON Automation: Select your Cheapest Range sensor → Opens → Select your appliance (e.g., Water Heater) → Turn ON.
  3. Turn OFF Automation: Select your Cheapest Range sensor → Closes → Select your appliance → Turn OFF.

Installation

  1. Install Homebridge.
  2. Install this plugin:
npm install -g homebridge-nordpool-cheapest-range
  1. Configure the plugin through the Homebridge UI or update your config.json.

Configuration Example

{
  "platforms": [
    {
      "platform": "NordpoolCheapestRange",
      "devices": [
        {
          "name": "Water Heater",
          "cheapestHours": 3,
          "rangeStart": 22,
          "rangeEnd": 7
        },
        {
          "name": "EV Charger",
          "cheapestHours": 5,
          "rangeStart": 0,
          "rangeEnd": 23
        }
      ]
    }
  ]
}

🇫🇮 Suomenkieliset ohjeet

Automatisoi raskaat kodinkoneet Nordpoolin halvimpien tuntien aikana valitsemasi aikaikkunan sisällä.

Tämä Homebridge-liitännäinen luo HomeKitiin virtuaalisia Ovitunnistimia (Contact Sensor). Tunnistin “aukeaa”, kun sähkö on halvimmillaan määrittämäsi aikajakson sisällä. Tämän avulla voit ohjata esimerkiksi lämminvesivaraajaa, sähköauton laturia tai lämpöpumppua juuri silloin, kun sähkö on edullisinta.


Ominaisuudet

  • Mukautettavat aikaikkunat
    Määritä, milloin laitteesi saa olla käynnissä (esim. vain klo 20:00–08:00 välillä).

  • Halvimmat tunnit
    Valitse, kuinka monta tuntia laitteen tulee olla päällä kyseisen aikaikkunan sisällä (esim. 3 halvinta tuntia).

  • “Kaksoispulssi”-varmistus (Double Pulse)
    HomeKit-automaatiot saattavat joskus jättää reagoimatta pitkään jatkuviin tiloihin. Tämä lisäosa käyttää erityistä kaksoispulssitekniikkaa: sensori vaihtaa tilaansa hetkellisesti joka tasatunti varmistaakseen, että automaatiot laukeavat luotettavasti — myös silloin, jos automaatio luodaan kesken aktiivisen halvan jakson.

  • Eve App -historiatuki
    Täysi Fakegato-historiatuki. Voit tarkastella halpojen ja kalliiden tuntien historiaa kauniina graafeina Eve-sovelluksessa.

  • Aurinkosähkö-ohitus (Solar Override)
    Tukee aurinkopaneeliohjausta, jos ominaisuus on määritetty käyttöön. (Ei vielä käytössä)


Kuinka lisäosa toimii HomeKitissä

Jotta käyttäjät eivät voi vahingossa vaihtaa laitteen tilaa käsin, lisäosa näyttää laitteet HomeKitissä Ovitunnistimina (Contact Sensor).

  • AUKI (Open / Contact Not Detected) = Sähkö on HALPAA → käynnistä laitteet
  • KIINNI (Closed / Contact Detected) = Sähkö on KALLISTA → sammuta laitteet

Esimerkki automaation luomisesta Koti-sovelluksessa

  1. Avaa Apple Koti -sovellus → Automaatiot+Tunnistin havaitsee jotain.
  2. Käynnistysautomaatio:
    Valitse Cheapest Range -sensori → Aukeaa → Valitse ohjattava laite (esim. lämminvesivaraaja) → Laita päälle.
  3. Sammutusautomaatio:
    Valitse sama sensori → Sulkeutuu → Valitse ohjattava laite → Laita pois päältä.

Asennus

  1. Asenna Homebridge.
  2. Asenna tämä lisäosa:
npm install -g homebridge-nordpool-cheapest-range
  1. Määritä lisäosa Homebridgen käyttöliittymässä tai muokkaamalla config.json-tiedostoa.

Esimerkkikonfiguraatio

{
  "platforms": [
    {
      "platform": "NordpoolCheapestRange",
      "devices": [
        {
          "name": "Lämminvesivaraaja",
          "cheapestHours": 3,
          "rangeStart": 22,
          "rangeEnd": 7
        },
        {
          "name": "Sähköauton laturi",
          "cheapestHours": 5,
          "rangeStart": 0,
          "rangeEnd": 23
        }
      ]
    }
  ]
}