# Node-red-contrib-ramp-thermostat

**URL:** <https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008>\
**Category:** Share Your Nodes\
**Created:** [18 November 2018 18:33 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008 "2018-11-18T18:33:59Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [10 December 2018 17:18 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/21 "2018-12-10T17:18:25Z")

</div>

New version 0.8.0 available.

- setProfile with more than 10 points

Example:

![chart10](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/43ac1d46ebef036250a4c9e44e5ae40236a0f136.png)

---

<div class="post-metadata">

**Author:** ![hominidae](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hominidae/32/4174_2.png) [@hominidae](https://discourse.nodered.org/u/hominidae)\
**Post date:** [10 December 2018 17:23 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/22 "2018-12-10T17:23:37Z")

</div>

@cflurin,  
thank you, guess it is time to start learning javascript 😊  
I am playing with your simulation right now...thank you for that...is there a way to change a flows system-time or timezone o the fly? 🤔

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [10 December 2018 17:35 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/23 "2018-12-10T17:35:34Z")

</div>

> [@hominidae](#):
>
> @cflurin,  
> thank you, guess it is time to start learning javascript 😊  
> I am playing with your simulation right now...thank you for that...is there a way to change a flows system-time or timezone o the fly? 🤔

It depends on your OS -\> search for `date -set` or similar.

---

<div class="post-metadata">

**Author:** ![hominidae](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hominidae/32/4174_2.png) [@hominidae](https://discourse.nodered.org/u/hominidae)\
**Post date:** [10 December 2018 17:47 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/24 "2018-12-10T17:47:22Z")

</div>

...that would change date/time for the entire underlying system node-red is running on. But I have other flows and services running there.  
For the simulation, I was thinking adding User-Input for the current temp and a slider, changing time or timezone in order to test the profile manually.  
...maybe I can use docker to run a sandbox instance and have this set to a different time 🤔

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [10 December 2018 18:37 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/25 "2018-12-10T18:37:58Z")

</div>

> [@cflurin](#):
>
> setProfile with more than 10 points

Hey Flurin, I assume this new functionality is **not** available via the config screen (by looking at the html file)? Do you have plans to do there the same? If so, don't hesitate to give me a call if you need any assistence!  
Bart

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [10 December 2018 20:33 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/26 "2018-12-10T20:33:04Z")

</div>

@BartButenaers,

Thanks for your proposal!  
I guess 10 points are enough for 95% of all use cases. Some users asked for more than 10 points, so I think the actual solution using `setProfile` is sufficient and furthermore flexible (unlimited points).

I'll come back if there'd be a request to expand the config UI.

---

<div class="post-metadata">

**Author:** ![martymcfly](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@martymcfly](https://discourse.nodered.org/u/martymcfly)\
**Post date:** [21 June 2021 19:30 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/27 "2021-06-21T19:30:04Z")

</div>

The way the actuator output of this component works seems specific to heating.  
ie. it turns on when the current temperature is below the target - hysteresis, and turns off when the current temperature is above the current temperature plus hysteresis.

Is there a way to use this for cooling/AC? I thought of just inverting the actuator output, which kind of works once it gets into a cooling on/off cycle. But if I deploy my flow and the current temperature is within the dead-zone, the ramp thermostat will initialise to 'off', which gets inverted and starts my AC. Not a big deal but a potential enhancement is to say whether a profile is a heating or cooling profile and set the actuator output accordingly?

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [22 June 2021 09:27 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/28 "2021-06-22T09:27:07Z")

</div>

If you are using the `ramp-thermostat` only for cooling, you could try to change the `getState`function in `ramp-themostat.js`:

```auto
    if (current > target_plus) {
      state = false;
      status = {fill:"grey",shape:"ring",text:current+" > "+target_plus+" ("+profile.name+")"};
    } else if (current == target_plus) {
      state = false;
      status = {fill:"grey",shape:"ring",text:current+" = "+target_plus+" ("+profile.name+")"}; 
    } else if (current == target_minus) {
      state = true;
      status = {fill:"yellow",shape:"dot",text:current+" = "+target_minus+" ("+profile.name+")"}; 
    } else if (current < target_minus) {
      state = true;
      status = {fill:"yellow",shape:"dot",text:current+" < "+target_minus+" ("+profile.name+")"};    
    } else { // deadband
      state = context.get('pre_state') || false;
      if (state) {
        status = {fill:"yellow",shape:"dot",text:target_minus+" < "+current+" < "+target_plus+" ("+profile.name+")"};
      } else {
        status = {fill:"grey",shape:"ring",text:target_minus+" < "+current+" < "+target_plus+" ("+profile.name+")"};
      }
    }

```

Change line 240:

```auto
      state = context.get('pre_state') || true;

```

and add this new line before `context.set('pre_state', state);`

```auto
state = !state;

```

---

<div class="post-metadata">

**Author:** ![martymcfly](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@martymcfly](https://discourse.nodered.org/u/martymcfly)\
**Post date:** [22 June 2021 13:14 UTC](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008/29 "2021-06-22T13:14:47Z")

</div>

Thanks! I will do that, and I'll see if I can send a pull request to make it configurable by profile or something.

[Previous page](https://discourse.nodered.org/t/node-red-contrib-ramp-thermostat/5008.md?page=1)
