Giter Club home page Giter Club logo

Comments (5)

dfgas avatar dfgas commented on May 27, 2024 1

i would love to see this in Fahrenheit too

from node-red-contrib-thermostat-scheduler.

cdellis99 avatar cdellis99 commented on May 27, 2024

Has anyone rewritten it into Fahrenheit? I would convert my whole house to Celsius, but I think my wife would be frustrated. I am new to this type of programming (more of a ladder logic guy). I started converting everything to Fahrenheight, but due to uncommented code and not understanding all of what I am working with, I temporarily gave up. I do learn best by reverse engineering and have learned a lot about NodeRed from this code, but I wouldn't mind stealing someone else's code who has already done it just because I don't have enough time right now.

from node-red-contrib-thermostat-scheduler.

xhacks37 avatar xhacks37 commented on May 27, 2024

It reads whatever temp you have set up for your thermostat

Just need to update the UI with a new range in node red "Nest" line 234 and 235 need to be updated to whatever you like and it will automatically just work

I put 40 for the min and 100 for the max

Screenshot_20220207-103757_Home_Assistant 1

I am still lost on how the schedule works so good luck

from node-red-contrib-thermostat-scheduler.

cdellis99 avatar cdellis99 commented on May 27, 2024

Under the "Settings Page" node, you will find this very easy to change code:
function bar(mm,val)
{
if (val==12 || val==12.5) { $(mm).height("12%"); $(mm).css('background-color', '#1E88E5'); } //blue
if (val==13 || val==13.5) { $(mm).height("16%"); $(mm).css('background-color', '#039BE5'); }
if (val==14 || val==14.5) { $(mm).height("20%"); $(mm).css('background-color', '#00ACC1'); }
if (val==15 || val==15.5) { $(mm).height("24%"); $(mm).css('background-color', '#039BE5'); } // cyan
if (val==16 || val==16.5) { $(mm).height("28%"); $(mm).css('background-color', '#00ACC1'); }
if (val==17 || val==17.5) { $(mm).height("32%"); $(mm).css('background-color', '#00897B'); }
if (val==18 || val==18.5) { $(mm).height("36%"); $(mm).css('background-color', '#388E3C'); } // green
if (val==19 || val==19.5) { $(mm).height("40%"); $(mm).css('background-color', '#689F38'); }
if (val==20 || val==20.5) { $(mm).height("44%"); $(mm).css('background-color', '#C0CA33'); }
if (val==21 || val==21.5) { $(mm).height("48%"); $(mm).css('background-color', '#FDD835'); } // yellow
if (val==22 || val==22.5) { $(mm).height("52%"); $(mm).css('background-color', '#FBC02D'); }
if (val==23 || val==23.5) { $(mm).height("56%"); $(mm).css('background-color', '#FFA000'); }
if (val==24) { $(mm).height("60%"); $(mm).css('background-color','#E64A19'); } // red
}

Later down the code are other functions that I am having a hard time reverse engineering to determine what (if anything) needs to be changed:
(function(scope){
scope.ID = ID;
scope.send({payload: '29'})
scope.$watch('msg', function(msg) {
selec(last,0); last=msg.selector; selec(last,1);
for (var x=0; x<24; x++)
{
var w="#t"+x+ID; bar(w,msg.timing[((msg.days-1)*24)+x].toFixed(1));
var v="#v"+x+ID; $(v).text(msg.timing[((msg.days-1)*24)+x].toFixed(1)+"°")
}
for (var x=0; x<2; x++) { var w="#s"+x+ID; $(w).text(msg.timing[168+x].toFixed(1)+"°"); }
$("#d0"+ID).text(thedays[msg.days-1]);
if ((last>4) &&(last<29))
$("#current"+ID).text(msg.timing[((msg.days-1)*24)+last-5].toFixed(1) + "°");
else
$("#current"+ID).text("-");
if (msg.foryou!="") { stat(msg.foryou); }
});

from node-red-contrib-thermostat-scheduler.

rwGP-d3b6nx7Qv5JvqGB avatar rwGP-d3b6nx7Qv5JvqGB commented on May 27, 2024

I too would love to see a Fahreneit solution! I'm a total layman, but playing with it. I too wonder about the function. For the moment, I'm leaving it because I think whatever it's doing would only be until the schedule sends the next update. We'll see.

Obviously, a first step, but here's my conversion:
function bar(mm,val)
{
if (val==53.6 || val==54.5) { $(mm).height("12%"); $(mm).css('background-color', '#1E88E5'); } //blue
if (val==55.4 || val==56.3) { $(mm).height("16%"); $(mm).css('background-color', '#039BE5'); }
if (val==57.2 || val==58.1) { $(mm).height("20%"); $(mm).css('background-color', '#00ACC1'); }
if (val==59 || val==59.9) { $(mm).height("24%"); $(mm).css('background-color', '#039BE5'); } // cyan
if (val==60.8 || val==61.7) { $(mm).height("28%"); $(mm).css('background-color', '#00ACC1'); }
if (val==62.6 || val==63.5) { $(mm).height("32%"); $(mm).css('background-color', '#00897B'); }
if (val==64.4 || val==65.3) { $(mm).height("36%"); $(mm).css('background-color', '#388E3C'); } // green
if (val==66.2 || val==67.1) { $(mm).height("40%"); $(mm).css('background-color', '#689F38'); }
if (val==68 || val==68.9) { $(mm).height("44%"); $(mm).css('background-color', '#C0CA33'); }
if (val==69.8 || val==70.7) { $(mm).height("48%"); $(mm).css('background-color', '#FDD835'); } // yellow
if (val==71.6 || val==72.5) { $(mm).height("52%"); $(mm).css('background-color', '#FBC02D'); }
if (val==73.4 || val==74.3) { $(mm).height("56%"); $(mm).css('background-color', '#FFA000'); }
if (val==75.2) { $(mm).height("60%"); $(mm).css('background-color','#E64A19'); } // red
}
Later in the same settings node, I converted the send({payload: numbers as well.

from node-red-contrib-thermostat-scheduler.

Related Issues (20)

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.