Giter VIP home page Giter VIP logo

node-red-nest-thermostat's Introduction

NEST style thermostat Dashboard widget for Node-red

If you have made heating or cooling controls on Node-red you will need nice thermostat widget to display and control your device via Node-red dashboard.

thermostat

Fully responsive design. Touch enabled set-point makes it even more interactive. Press and hold finger or mouse and it will activate the set-point sliding function.

Also it has several display modes like heating, cooling and away. It makes it more interactable and user intuitive. For ECO friendly folks there is possible to turn on and off that little green leaf.

heating cooling away

How to install:

Open and copy all text from flow.js then go to your node-red application and press import > cliboard paste the text and you are done.

After import you should see something like this: noderedui

What data can I push in and out:

You can push the folowing values in json format. When target temperature is changed from UI node will push new values in the same structure in the output.

  • ambient_temperature your temperature readings numeric payloads.
  • target_temperature your thermostat setpoint numeric payloads.
  • hvac_state string (off, heating, cooling) payload.
  • has_leave boolean (true, false) payloads.
  • away boolean (true, false) payloads.
msg.payload = {
    "ambient_temperature": 21.1,
    "target_temperature": 23,
    "hvac_state": "heating",
    "has_leaf": false,
    "away": false
}

If you are familiar with CSS and JAVASSCRIPT there there are more stuff to customize dial colors nd ranges etc.

Some options in the script:

options = {
       diameter: options.diameter || 400,
       minValue: options.minValue || 10, //Minimum value for target temperature
       maxValue: options.maxValue || 30, //Maximum value for target temperature
       numTicks: options.numTicks || 200, //Number of tick lines to display around the dial
       onSetTargetTemperature: options.onSetTargetTemperature || function() {}, // Function called when new target temperature set by the dial
};

var properties = {
       tickDegrees: 300, // Degrees of the dial that should be covered in tick lines
       rangeValue: options.maxValue - options.minValue,
       radius: options.diameter/2,
       ticksOuterRadius: options.diameter / 30,
       ticksInnerRadius: options.diameter / 8,
       hvac_states: ['off', 'heating', 'cooling'],
       dragLockAxisDistance: 15,
       labels: {
              targetLabel: 'Set',
              ambientUnits: 'ºC'
       }
};

Translation to other languages

Mode, target and units labels can be edited inside properties part of the code.

What if I want several widgets on one dashboard page?

import several widgets just make sure you edit uniq ID in these 2 lines inside the code of UI_Template block. Top of the code.

<div id="thermostat1"></div>

var thermostatId = "thermostat1";

What if I want farenheit units?

change minValue and maxValue temperatures to Farenheit in the options part of the code. The rest should be fine.

options = {
       targetOnCenter: options.targetOnCenter || true, //Display target temperature in center of dial. Otherwise, display ambient temperature
       diameter: options.diameter || 400,
       minValue: options.minValue || 50, // Minimum value for target temperature Farenheit
       maxValue: options.maxValue || 86, // Maximum value for target temperature Farenheit
       numTicks: options.numTicks || 200, // Number of tick lines to display around the dial
       onSetTargetTemperature: options.onSetTargetTemperature || function() {}, // Function called when new target temperature set by the dial
};

What if I want to round temperatures to .1 steps?

Search the code and find roundHalf function:

function roundHalf(num) {	
       return Math.round(num*2)/2;	
}	

Change to this:

function roundHalf(num) {	
       return Math.round(num*10)/10;	
}	

What if I want to display ambient temperature in center of dial?

Search the code and find targetOnCenter and set it to false

options = {
       targetOnCenter: false, //Display target temperature in center of dial. Otherwise, display ambient temperature
};

Issues:

Use the GitHub issues log for raising issues or contributing suggestions and enhancements. GITHUB

node-red-nest-thermostat's People

Contributors

automatikas avatar elperepat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.