Issue with Heater node, not heating

Hi, as not all to experience with Node Red, I am having an issue with the node-red-contrib-heater-controller. All works fine, but how does it turn on my heater?

The node will work just fine on my dashboard, temperatures are displayed and the heaterStatus is updated as it should. N

I want it to turn a switch, I am using a Shelly 1 for this. I only need to switch a DC voltage of 12V. Injecting an on / off to the Shelly will flick the switch.

But what do I need to do to have the heater node to control the switch, I think I am missing something?

(how to insert my flow into this post??)

image

According to the node's readme:

Output

A message is emited when the status is recalculated (when the user is changing the target temperature or a new input message is received)

So you will need to look at that output, determine what to do and thenturn the switch on/off. How you do that will depend on what the shelly needs and having a node to communicate with the Shelly (I don't own a Shelly so I can't tell you exactly how to do it)

Shelly 1 has MQTT support so you could use an MQTT node to communicate

Shelly1 MQTT docs are here
https://shelly-api-docs.shelly.cloud/#mqtt-support

I do use MQTT to control the Shelly, it also give me the temperature.

Via the ON / OFF injection to the Shelly it will turn on/off
I have tried all I could think of. but not sure how the heater node will make this work.

Start by putting a debug node on the output of the heater node and see what comes out (I see you have done that alread). Then, read the node red docs page Working with Messages which should help you convert that data to whatever you need to send to MQTT.
If you can't work it out then show us what you see in the debug node and tell us what it needs to be converted to.

The only that seems to be changing is the "currentheaterstatus" this is either on or off.

16-6-2020 15:22:04node: bdc94203.ef713shellies/shelly1-500291F0142B/relay/0/command : msg.payload : Object

object

currentTemp: 19.2

targetValue: 22

isUserCustom: true

currentSchedule: object

nextSchedule: object

userTargetValue: 22

currentHeaterStatus: "on"

time: "16-6-2020 15:22:05"

I guess I would need to use this, to control the Shelly 1

[{"id":"30e1839a.cade6c","type":"exec","z":"8c99ec05.74e658","command":"sleep 20","addpay":false,"append":"","useSpawn":"false","timer":"10","oldrc":false,"name":"","x":420,"y":423,"wires":[["dccd5011.4926e"],["64252707.f9e7"],["a9768a27.692d6"]]},{"id":"127167a5.30506","type":"inject","z":"8c99ec05.74e658","name":"Go","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":124,"y":389,"wires":[["30e1839a.cade6c","7d39cdd0.42cc64"]]},{"id":"dccd5011.4926e","type":"debug","z":"8c99ec05.74e658","name":"OP/1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":590,"y":383,"wires":[]},{"id":"64252707.f9e7","type":"debug","z":"8c99ec05.74e658","name":"OP/2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":588,"y":425,"wires":[]},{"id":"a9768a27.692d6","type":"debug","z":"8c99ec05.74e658","name":"OP/3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":588,"y":465,"wires":[]},{"id":"7d39cdd0.42cc64","type":"debug","z":"8c99ec05.74e658","name":"START","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":601,"y":334,"wires":[]}]

Eh? Why? What has delaying 20 seconds got to do with anything?
Can't you just need to use a Change node to Move msg.payload.currentHeaterStatus To msg.payload and feed that to the MQTT node. That assumes you need to send "on" or "off" to MQTT. You haven't told us what it needs.

If you do want to delay for 20 seconds for some reason you can use a Delay node.

Sorry, copied the wrong flow into my reply.
I was wondering, what are you taliking about, I see no 20 sec delay.

[{"id":"47c40612.e45b58","type":"tab","label":"Thermo","disabled":false,"info":""},{"id":"799417af.39fcd8","type":"inject","z":"47c40612.e45b58","name":"","topic":"currentTemp","payload":"19.2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":220,"wires":[["fd7cbb12.049ec8","dbd55f6f.845a2"]]},{"id":"fd7cbb12.049ec8","type":"ui_heater_controller","z":"47c40612.e45b58","name":"Heating","group":"aa24bae5.94e3c8","unit":"C","order":0,"width":"6","height":"4","topic":"shellies/shelly1-500291F0142B/relay/0/command","title":"","logLengthType":"days","logLength":"0","sliderMinValue":16,"sliderMaxValue":25,"sliderStep":0.5,"thresholdRising":0.5,"thresholdFalling":0.5,"calendar":"{\n    \"Monday\": {\n        \"00:00\": 19,\n        \"06:20\": 22,\n        \"08:00\": 19,\n        \"16:40\": 22,\n        \"23:59\": 19\n    },\n    \"Tuesday\": {\n        \"00:00\": 19,\n        \"06:20\": 22,\n        \"08:00\": 19,\n        \"16:40\": 19,\n        \"23:59\": 19\n    },\n    \"Wednesday\": {\n        \"00:00\": 19,\n        \"06:20\": 22,\n        \"08:00\": 19,\n        \"16:40\": 22,\n        \"23:59\": 19\n    },\n    \"Thursday\": {\n        \"00:00\": 19,\n        \"06:20\": 22,\n        \"08:00\": 19,\n        \"16:40\": 22,\n        \"23:59\": 19\n    },\n    \"Friday\": {\n        \"00:00\": 19,\n        \"06:20\": 23,\n        \"08:00\": 19,\n        \"16:40\": 22,\n        \"23:59\": 19\n    },\n    \"Saturday\": {\n        \"00:00\": 19,\n        \"08:00\": 20,\n        \"20:00\": 22,\n        \"23:59\": 19\n    },\n    \"Sunday\": {\n        \"00:00\": 19,\n        \"08:00\": 20,\n        \"20:00\": 22,\n        \"23:59\": 19\n    }\n}","x":400,"y":300,"wires":[["bdc94203.ef713","a1554fa5.cdb21"]],"inputLabels":["shellies/shelly1-500291F0142B/ext_temperature"]},{"id":"dbd55f6f.845a2","type":"debug","z":"47c40612.e45b58","name":"","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","x":620,"y":220,"wires":[]},{"id":"c4825bba.a86178","type":"mqtt in","z":"47c40612.e45b58","name":"Input sensor","topic":"shellies/shelly1-500291F0142B/ext_temperature/0","qos":"2","datatype":"utf8","broker":"8d9f9a83.656348","x":190,"y":160,"wires":[["ee3549d9.691538"]]},{"id":"bdc94203.ef713","type":"debug","z":"47c40612.e45b58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":300,"wires":[]},{"id":"ee3549d9.691538","type":"change","z":"47c40612.e45b58","name":"Temp conv.","rules":[{"t":"set","p":"topic","pt":"msg","to":"'currentTemp'","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":160,"wires":[["dbd55f6f.845a2"]]},{"id":"6ccd2b52.cf3ed4","type":"inject","z":"47c40612.e45b58","name":"","topic":"shellies/shelly1-500291F0142B/relay/0/command","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":410,"y":360,"wires":[["2da60404.b1042c"]]},{"id":"26bc7e8b.f43d52","type":"inject","z":"47c40612.e45b58","name":"","topic":"shellies/shelly1-500291F0142B/relay/0/command","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":410,"y":420,"wires":[["2da60404.b1042c"]]},{"id":"2da60404.b1042c","type":"mqtt out","z":"47c40612.e45b58","name":"Switch","topic":"shellies/shelly1-500291F0142B/relay/0/command","qos":"","retain":"","broker":"8d9f9a83.656348","x":810,"y":480,"wires":[]},{"id":"a1554fa5.cdb21","type":"change","z":"47c40612.e45b58","name":"","rules":[{"t":"set","p":"msg.payload.currentHeaterStatus","pt":"msg","to":"payload","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":360,"wires":[["2da60404.b1042c"]]},{"id":"aa24bae5.94e3c8","type":"ui_group","z":"","name":"Thuis","tab":"ce3e8b8f.5efca8","disp":true,"width":"7","collapse":false},{"id":"8d9f9a83.656348","type":"mqtt-broker","z":"","name":"musquitto","broker":"192.168.0.133","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"ce3e8b8f.5efca8","type":"ui_tab","z":"","name":"Home","icon":"mi-visibility","disabled":false,"hidden":false}]

If I change the Move msg.payload.currentHeaterStatus To msg.payload, I will get an error, conveerting circulair structure to JSON

That's not how to spell Move

image

1 Like

Thanks Colin, :grin:

that did the trick. working now. I had tried this, only had not used the Move.

You saved my day

Blockquote

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