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

smartbox2mqtt

v1.5.0

Published

MQTT to smartbox heater adapter

Readme

smartbox2mqtt

MQTT bridge for smartbox electric heaters.

Overview

smartbox2mqtt is a standalone Node.js adapter that bridges MQTT and smartbox electric heaters. It provides a simple MQTT interface for monitoring and controlling heater modes, target temperatures, and real-time power consumption.

This project is based on the hass-smartbox Home Assistant integration and the smartbox Python library. Adapted to Node and MQTT by Claude.

Installation

npm install -g smartbox2mqtt

Configuration

Create a configuration file at ~/.config/smartbox2mqtt/config.json (Linux) or ~/Library/Preferences/smartbox2mqtt/config.json (macOS):

{
  "smartbox": {
    "username": "smartbox email",
    "password": "smartbox password",
    "apiName": "key of one of /src/smartbox-client.js:6, for example 'api-hjm'",
    "reconnectInterval": 600000
  },
  "mqtt": {
    "host": "localhost",
    "port": 1883,
    "username": "mqtt username",
    "password": "mqtt password",
    "baseTopic": "smartbox"
  }
}

Configuration Options

smartbox section

  • username (required): Your smartbox account email
  • password (required): Your smartbox account password
  • apiName (required): API endpoint key (e.g., api-hjm). See /src/smartbox-client.js:6 for available options
  • reconnectInterval (optional): Interval in milliseconds for periodic Socket.IO reconnection. Default: 600000 (10 minutes). This ensures the WebSocket connection stays fresh and auth tokens are refreshed. Set to 0 to disable periodic reconnects.

mqtt section

  • host (required): MQTT broker hostname
  • port (optional): MQTT broker port. Default: 1883
  • username (optional): MQTT broker username
  • password (optional): MQTT broker password
  • baseTopic (optional): Base topic prefix for all MQTT messages. Default: smartbox

Usage

smartbox2mqtt

The bridge will:

  1. Connect to your smartbox account
  2. Discover all available heaters
  3. Connect to your MQTT broker
  4. Start publishing status updates and listening for commands

MQTT Topics

For each heater ({nodeName}), topics are structured as: {baseTopic}/{nodeName}/...

Control Topics (Write)

  • {baseTopic}/{nodeName}/mode/set - Set heater mode: manual, auto, or off
  • {baseTopic}/{nodeName}/temperature/set - Set target temperature in °C

Status Topics (Read-only)

  • {baseTopic}/{nodeName}/mode - Current mode
  • {baseTopic}/{nodeName}/temperature - Target temperature (°C)
  • {baseTopic}/{nodeName}/current_temperature - Measured room temperature (°C)
  • {baseTopic}/{nodeName}/comfort_temperature - Comfort mode temperature (°C)
  • {baseTopic}/{nodeName}/eco_temperature - Eco mode temperature (°C)
  • {baseTopic}/{nodeName}/ice_temperature - Frost protection temperature (°C)
  • {baseTopic}/{nodeName}/active - Actively heating: ON or OFF
  • {baseTopic}/{nodeName}/power - Real-time power consumption in Watts
  • {baseTopic}/{nodeName}/online - Connection status: ON or OFF

Bridge Topics

  • {baseTopic}/lwt - Bridge availability: Online or Offline (retained, with MQTT Last Will)

Example Usage

Set heater to manual mode

mosquitto_pub -t "smartbox/living-room/mode/set" -m "manual"

Set target temperature to 21°C

mosquitto_pub -t "smartbox/living-room/temperature/set" -m "21.0"

Monitor current temperature

mosquitto_sub -t "smartbox/living-room/current_temperature"

Monitor power consumption

mosquitto_sub -t "smartbox/living-room/power"