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

pimatic-mythermostat

v0.0.3

Published

Plugin to control my electric heater.

Downloads

3

Readme

pimatic-mythermostat

Thermostat plugin for the Pimatic

Synopsis

This plugin is a simple thermostat for Pimatic. Here are some examples of the functionality

  • scheduling and manual modes
  • Bang Bang and PID controllers
  • Early On (coming)
  • a simple but explicit UI

Image of Mythermostat

Requirement

To make it work, you'll need :

  • some heaters that can be witched on or off using a Pimatic rules or action
  • a thermometer controlling the temperature of the room

configuration

To include the plugin just add this code in the plugins section

{
  "plugin": "mythermostat"
},

The configuration is split in 3 different zones

  1. the observable and controllers
  2. the different programs
  3. the schedule
  4. a trick !

Observable and controllers

The thermostat is continuously observing the room temperature given by a variable variableTemp it will also switch On or Off the heaters by executing an Action

  "variableTemp": "temperature.variableName",
  "actionHeatingOn": "press heat-on-button",
  "actionHeatingOff": "press heat-off-button",

The different programs

The thermostat's objective temperature is based on programs.

  "programs": [
    {
      "id": 0,
      "temperature": 18.5
    },
    {
      "id": 1,
      "temperature": 19.5
    },
    {
      "id": 2,
      "temperature": 20.5
    }
  ],

The schedule

The schedule is expressed for each day of the week "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" , "Sun". For each day, you can set a program (ie a temperature) that starts at the given time and end at the next program

"timetable": [
{
  "day": "Mon",
  "schedule": [
    {
      "start": "0000",
      "programID": 0
    },
    {
      "start": "0700",
      "programID": 1
    },
    {
      "start": "0800",
      "programID": 0
    },
    {
      "start": "1800",
      "programID": 2
    },
    {
      "start": "2200",
      "programID": 0
    }
  ]
}, ...

The trick!

To refresh the UI when program changes, you must emit a variable. Pimatic will try to save it in the database and will throw an exception as it is an array.

Just add this to the deviceAttributeLogging

{
  "deviceId": "*",
  "attributeName": "currentProgram",
  "expire": "0d",
  "type": "*"
}

Full config

in the database section

"database": {
  "deviceAttributeLogging": [
    ...
    {
      "deviceId": "*",
      "attributeName": "currentProgram",
      "expire": "0d",
      "type": "*"
    }
  ],
}

Add as many thermostat devices as needed in the devicesection.

{
  "id": "thermostat",
  "class": "MyHeatingThermostat",
  "name": "Thermostat Salon",
  "comfyTemp": 21,
  "ecoTemp": 16,
  "controller": "PID",
  "variableTemp": "tempsalon.temperature",
  "actionHeatingOn": "press heat-on-button",
  "actionHeatingOff": "press heat-off-button",
  "programs": [
    {
      "id": 0,
      "temperature": 18.5
    },
    {
      "id": 1,
      "temperature": 19.5
    },
    {
      "id": 2,
      "temperature": 20.5
    }
  ],
  "timetable": [
    {
      "day": "Mon",
      "schedule": [
        {
          "start": "0000",
          "programID": 0
        },
        {
          "start": "0700",
          "programID": 1
        },
        {
          "start": "0800",
          "programID": 0
        },
        {
          "start": "1800",
          "programID": 2
        },
        {
          "start": "2200",
          "programID": 0
        }
      ]
    },
    {
      "day": "Tue",
      "schedule": [
        {
          "start": "0000",
          "programID": 0
        },
        {
          "start": "0700",
          "programID": 1
        },
        {
          "start": "0800",
          "programID": 0
        },
        {
          "start": "1800",
          "programID": 2
        },
        {
          "start": "2200",
          "programID": 0
        }
      ]
    },
    {
      "day": "Wed",
      "schedule": [
        {
          "start": "0000",
          "programID": 0
        },
        {
          "start": "0700",
          "programID": 1
        },
        {
          "start": "0800",
          "programID": 0
        },
        {
          "start": "1630",
          "programID": 2
        },
        {
          "start": "2200",
          "programID": 0
        }
      ]
    },
    {
      "day": "Thu",
      "schedule": [
        {
          "start": "0000",
          "programID": 0
        },
        {
          "start": "0700",
          "programID": 1
        },
        {
          "start": "0800",
          "programID": 0
        },
        {
          "start": "1800",
          "programID": 2
        },
        {
          "start": "2200",
          "programID": 0
        }
      ]
    },
    {
      "day": "Fri",
      "schedule": [
        {
          "start": "0000",
          "programID": 0
        },
        {
          "start": "0700",
          "programID": 1
        },
        {
          "start": "0800",
          "programID": 0
        },
        {
          "start": "1630",
          "programID": 2
        },
        {
          "start": "2200",
          "programID": 0
        }
      ]
    },
    {
      "day": "Sat",
      "schedule": [
        {
          "start": "0000",
          "programID": 0
        },
        {
          "start": "0700",
          "programID": 1
        },
        {
          "start": "0900",
          "programID": 2
        },
        {
          "start": "2200",
          "programID": 0
        }
      ]
    },
    {
      "day": "Sun",
      "schedule": [
        {
          "start": "0000",
          "programID": 0
        },
        {
          "start": "0700",
          "programID": 1
        },
        {
          "start": "0900",
          "programID": 2
        },
        {
          "start": "2200",
          "programID": 0
        }
      ]
    }
  ]
},

Next

This plugin is still under development.

  • PID is not correctly implemented, as of today, it is a simple proportional controller
  • PreHeat : start heating according to the next scheduled temperature
  • Make it smart : add a presence sensor and some maths (HMM?)
  • Off mode is not working
  • UI

License

Code released under the MIT license.