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

domoticz-heaters

v1.5.8

Published

Piloting Domoticz heaters with Node.js.

Downloads

21

Readme

Managing the temperature in your house with Domoticz, Google Docs and Node JS

This package is to be used with:

  • A working Domoticz instance where you have heaters and thermometers
  • A first Google Calc spreadsheet where you define which temperature you want per room, day, hour
  • A second Google Calc spreadsheet where you simply want to see the total electricity consumption per room, day.
  • A state (probably as a state.json file) Javascript object that represents the state of your house, including rooms, heaters, ...

Once you have all this, you can create a simple script (see example.js) that will:

  1. Figure out which temperature you want in each of your rooms by fetching that data in a Google Calc sheet
  2. Fetch the temperatures in your rooms by asking that to Domoticz
  3. Send the right ON/OFF commands to your heaters
  4. compute how much power you have used and upload that to Google Calc

The context

I live in an old house with electric heating. I set up Domoticz so that I could fine tune when the heaters start and stop. For that I have a few thermo sensors and one Chacon remote contact per heater. Most of them are plugged to the pilot thread with a diode in a way that when the Chacon module is ON, it means that the heater is OFF. Most of my old 1000W heaters are directly plugged to the Chacon so they are ON when the module is ON.

I made some LUA scripts but they were not really nice. I tried to make Python work with Domoticz but couldn't figure it out.

Then I found that you could do everything with Domoticz with its JSON API. You simply need to have access to Domoticz API. There is nothing to setup in Domoticz for that. If you have access to Domoticz's web interface, then you have access to the JSON API.

So here are the scripts that I use at home. Feel free to fork them to your needs.

They run on a Raspberry Pi on which also runs Domoticz with my RFXCom.

Open the example.js file to get hints on how to cron that script so that it runs every minute.

Resending commands

I discovered that some orders sometimes got lost (thick walls) ... so every 15 minutes, I ressend the commands up to three times.

State machine

This module is basically managing the state machine that represents the house. The state is inside the state variable. Insite that state var, we have the rooms object that contains all the room objects. Insite de rooms, we have all the heaters that are in the heaters object that contains all the heater objects. So for example, we have: state.rooms.Kitchen.heaters.35 : that is the heater with device ID 35 (in Domoticz) in the room called Kitchen.

Install

You can install it with git or npm:

npm install domoticz-heaters

Then open and edit the example.js file to suit your needs. Do the same with configs-default.json and house_state.json.

If you want to use it like me, use two different Google Calc documents. There is a very good tutorial on how to set up access to Google Calc sheets from NodeJS on Twilio.

Copy:

:star: Don't hesitate to star that repo if it was of any use for you ;-)

small notes

Upgrading node on raspberry pi:

curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs