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

node-red-contrib-predictive-heating

v1.0.2

Published

Predictive outdoor temperature for heating curve control using weather forecast and solar UV correction

Readme

node-red-contrib-predictive-heating

Predictive outdoor temperature node for heating and cooling curve control. Uses weather forecast and solar UV correction to calculate a more realistic outdoor temperature — saving energy without sacrificing comfort.

How it works

Instead of using only the current outdoor temperature for heating/cooling curve control, this node calculates a weighted predictive temperature that takes upcoming weather into account:

  • Cold front coming → AT_pred drops → heating reacts earlier
  • Warm front coming → AT_pred rises → cooling reacts earlier
  • High UV / solar gain → AT_pred rises → passive solar heating is accounted for
  • No sun → no correction → heating/cooling runs normally

Works automatically for both heating and cooling — no mode switching needed.

Inputs

| Property | Type | Description | |----------|------|-------------| | msg.at_current | number | Required - Current outdoor temperature (°C) | | msg.avg_day0 | number | (optional) Forecast avg temperature today (°C) | | msg.avg_day1 | number | (optional) Forecast avg temperature tomorrow (°C) | | msg.avg_day2 | number | (optional) Forecast avg temperature day after tomorrow (°C) | | msg.uv_day0 | number | (optional) UV index today (0–12) | | msg.uv_day1 | number | (optional) UV index tomorrow (0–12) |

Forecast values are stored in node context — only send them when they change (e.g. once per hour from your weather API). at_current can be sent as often as needed. If a forecast value is missing and no stored value exists, it falls back to at_current.

Output

{
  "at_predictive": 3.5,
  "correction": -1.5,
  "solar_offset": 0.5,
  "mode": "cooling"
}

| Field | Description | |-------|-------------| | at_predictive | Calculated predictive outdoor temperature → use as AT input for heat/cool curve | | correction | Delta between predictive and current AT (forecast influence only) | | solar_offset | Solar UV correction applied (°C) | | mode | "warming" / "cooling" / "stable" |

Algorithm

AT_pred = (AT_current × w0 + avg_day0 × w1 + avg_day1 × w2 + avg_day2 × w3) / total_weight

uv_avg = (uv_day0 + uv_day1) / 2
solar_offset = (uv_avg / 12) × uvMaxOffset   // positive: high UV = warmer

AT_final = AT_pred + solar_offset

Configuration

| Parameter | Default | Description | |-----------|---------|-------------| | Weight Current | 4 | Weight of current outdoor temperature | | Weight Day 0 | 2 | Weight of today's forecast | | Weight Day 1 | 1 | Weight of tomorrow's forecast | | Weight Day 2 | 0.5 | Weight of day after tomorrow's forecast | | Max UV Offset | 2 | Maximum solar correction in °C (at UV index 12) |

Use Cases

| Application | Description | |-------------|-------------| | Heating curve | Feed at_predictive as outdoor temp → pre-heat before cold front | | Cooling curve | Feed at_predictive as outdoor temp → pre-cool before heat wave | | HVAC control | Reduce energy by accounting for solar gains |

Tips

Tip: Instead of using the current momentary outdoor temperature as at_current, use a 24h rolling average. This eliminates short-term fluctuations and represents the actual thermal load of the building — exactly how professional DDC/BMS systems work. The weighted forecast then builds on a stable base, making the prediction much more accurate.

Weather API Integration

Example function node to map WeatherAPI response:

var w = msg.payload;
msg.at_current = global.get('gWeatherAvg24hTemp') ?? w.current.temp_c;
msg.avg_day0   = w.forecast.forecastday[0].day.avgtemp_c;
msg.avg_day1   = w.forecast.forecastday[1].day.avgtemp_c;
msg.avg_day2   = w.forecast.forecastday[2].day.avgtemp_c;
msg.uv_day0    = w.forecast.forecastday[0].day.uv;
msg.uv_day1    = w.forecast.forecastday[1].day.uv;
return msg;

Node Status

  • AT 5 → 3.5°C (cooling) - Cold front detected (blue)
  • AT 5 → 7.2°C (warming) - Warm front detected (yellow)
  • AT 5 → 5.4°C (stable) - Stable weather with solar gain (green)

Author

sr.rpo

License

MIT