# Mqtt and ramp-thermostat

**URL:** <https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014>\
**Category:** General\
**Created:** [29 January 2020 20:47 UTC](https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014 "2020-01-29T20:47:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [29 January 2020 20:47 UTC](https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014/1 "2020-01-29T20:47:37Z")

</div>

i have problem with reading my mqtt send payload (temperature) but my thermostat doesnt recognize payload or idc i have no input normal i need output 1 or 0

```auto
[{"id":"53fe1dfa.050d84","type":"mqtt in","z":"d8e8a97b.a83608","name":"/espDHT11terari/DHT11/Temp","topic":"/espDHT11terari/DHT11/Temp","qos":"2","broker":"19efa301.6c402d","x":480,"y":1280,"wires":[["a4e1b4cf.38fcd8","da0c378c.df0d68","4910fc94.8b85d4","77c1a06.0ec066"]]},{"id":"77c1a06.0ec066","type":"ramp-thermostat","z":"d8e8a97b.a83608","name":"","profile":"6ec0545d.80524c","hysteresisplus":"0.5","hysteresisminus":"0.5","x":940,"y":1220,"wires":[["daf3059c.139e88"],[],[]],"inputLabels":["msg.payload"]},{"id":"19efa301.6c402d","type":"mqtt-broker","z":"","name":"","broker":"192.168.178.35","port":"1883","tls":"","clientid":"","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"6ec0545d.80524c","type":"profile","z":"","name":"controll temperature","time1":"00:00","temp1":"20","time2":"04:00","temp2":"21","time3":"07:00","temp3":"21","time4":"10:00","temp4":"23","time5":"12:00","temp5":"25","time6":"15:00","temp6":"27","time7":"18:00","temp7":"25","time8":"20:00","temp8":"23","time9":"22:00","temp9":"21","time10":"23:59","temp10":"20"}]

```

 ![problem mqtt](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/c/3c757a52bbd04d96528f413dedeea9be45cd066d.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [29 January 2020 22:08 UTC](https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014/2 "2020-01-29T22:08:22Z")

</div>

Have you read the [node-red-contrib-ramp-thermostat](https://flows.nodered.org/node/node-red-contrib-ramp-thermostat) readme?  
It say's;

> This node expects a `numeric` msg.payload containing the current temperature (number). The msg.topic should be set to `setCurrent`

You are injecting a 'string' msg.payload instead of a 'number'. ALSO the message topic is something like `"/espDHT11terary/DHT11/Temp"` instead of either `setCurrent` (or undefined).

The node will probably accept the msg.payload because although a 'string', it takes the form of a number, but the topic MUST be either `setCurrent` or 'undefined'.

Try adding this in front of the `node-red-contrib-ramp-thermostat` node.

```auto
[{"id":"6bc0bf32.bb4d9","type":"template","z":"222e1ed4.53fd52","name":"Change topic","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"setCurrent","output":"str","x":765,"y":325,"wires":[["5dcd016b.4c18f"]]}]

```

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [30 January 2020 05:20 UTC](https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014/3 "2020-01-30T05:20:51Z")

</div>

> [@Paul-Reed](#):
>
> [{"id":"6bc0bf32.bb4d9","type":"template","z":"222e1ed4.53fd52","name":"Change topic","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"setCurrent","output":"str","x":765,"y":325,"wires":[["5dcd016b.4c18f"]]}]

now input is good but output i need 1 or 0

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [30 January 2020 09:28 UTC](https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014/4 "2020-01-30T09:28:41Z")

</div>

A Change node can change the output to 1 or 0.

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [30 January 2020 17:17 UTC](https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014/5 "2020-01-30T17:17:34Z")

</div>

thank you everybody i made it

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 February 2020 17:20 UTC](https://discourse.nodered.org/t/mqtt-and-ramp-thermostat/21014/6 "2020-02-13T17:20:41Z")

</div>

Closed on 13 February 2020 17:20 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
