Homey and Aqara Sensor Temp

Hi everyone. I am new to the forum, I am programming Node-Red and I have a question.

I have a Homey with several Xiaomi Aqara sensors. The sensors read well on Node-Red and Homey.

I want to use the node-red-contrib-heater-controller heating programmer, but it indicates that in order for the control to run you need in the input a topic "currentTemp" and payload needs to be a float.

I can get the temperature data from the Homey, but the data is obtained as "measure-temperature" and I don't know how to pass it to "currentTemp" so the heating control can work.

I don't know if I will have explained myself well.

I appreciate the help, if you need me to share the flow, let me know.

Thank you very much for your help.

Working with properties is the thing you'll need to understand well to get your things done in Node-RED. So take a little time to explore examples here.
https://cookbook.nodered.org/#messages

Hi @hotNipi

Thanks for the link to understand a little Node-Red.

I'm trying to learn little by little and maybe the help I ask for is too much.

I have tried with the help examples, I have also "googled" and I have tried with several of the examples that seem, but, I am new and somewhat clumsy.

I share here the flow I'm working on, to see if they can help me, since I can't change the output message.

I appreciate in advance all the help...

[{"id":"b0cd40f9.fd8b5","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8ebd0aeb.307398","type":"mqtt in","z":"b0cd40f9.fd8b5","name":"","topic":"homie/homey-casa/sensor-despacho/measure-temperature","qos":"2","datatype":"auto","broker":"34be26c1.c0379a","x":330,"y":280,"wires":[["2f56347a.685d9c","fec8f1b6.a90cb"]]},{"id":"2f56347a.685d9c","type":"ui_gauge","z":"b0cd40f9.fd8b5","name":"Despacho","group":"d5b6efa.613331","order":1,"width":0,"height":0,"gtype":"gage","title":"Temperatura Despacho","label":"°C","format":"{{value}}","min":0,"max":"60","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":760,"y":280,"wires":[]},{"id":"a734320e.17849","type":"comment","z":"b0cd40f9.fd8b5","name":"Pestaña Salón","info":"","x":940,"y":280,"wires":[]},{"id":"e78b1305.76876","type":"ui_heater_controller","z":"b0cd40f9.fd8b5","name":"heater","group":"d5b6efa.613331","unit":"C","order":2,"width":0,"height":0,"topic":"currentTemp","title":"Programador","logLengthType":"days","logLength":1,"sliderMinValue":10,"sliderMaxValue":35,"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\": 22,\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":910,"y":520,"wires":[[]]},{"id":"fec8f1b6.a90cb","type":"change","z":"b0cd40f9.fd8b5","name":"Change","rules":[{"t":"set","p":"homie/homey-casa/sensor-despacho/measure-temperature","pt":"msg","to":"currentTemp","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":520,"wires":[["e78b1305.76876","93db76b8.8cf718"]]},{"id":"93db76b8.8cf718","type":"debug","z":"b0cd40f9.fd8b5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":930,"y":440,"wires":[]},{"id":"34be26c1.c0379a","type":"mqtt-broker","z":"","name":"Homey MQTT","broker":"192.168.11.150","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"d5b6efa.613331","type":"ui_group","z":"","name":"Pruebas Clima","tab":"51c2df7a.eaae8","order":3,"disp":true,"width":"7","collapse":true},{"id":"51c2df7a.eaae8","type":"ui_tab","z":"","name":"Pestaña Test","icon":"fa-television","order":2,"disabled":false,"hidden":false}]

OK, what the hater controller node expects is msg where topic is set correctly and payload is number. (measured temperature)
So first you'll need to be sure that value of your measurement is number.
Add debug node tou your MQTT node and see (show to us) what is the payload you get from it.
Then you'll need to add topic to to the message before you send it to the heater node.
I made a little example for that.

[{"id":"3530d86a.a76098","type":"ui_heater_controller","z":"7d06fca2.eb72a4","name":"heater","group":"82819028.ee8f2","unit":"C","order":2,"width":0,"height":0,"topic":"currentTemp","sliderMinValue":10,"sliderMaxValue":35,"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\": 22,\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":850,"y":160,"wires":[["bf99d4e3.c53e58"]]},{"id":"bf99d4e3.c53e58","type":"debug","z":"7d06fca2.eb72a4","name":"heater output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":910,"y":210,"wires":[]},{"id":"dd50d96a.a6df38","type":"change","z":"7d06fca2.eb72a4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"currentTemp","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":140,"wires":[["6af3242b.3daacc","3530d86a.a76098"]]},{"id":"d7cacd5b.dbb35","type":"function","z":"7d06fca2.eb72a4","name":"fake temperature reading","func":"msg.payload = parseFloat((15 + Math.random()*10).toFixed(2)) \nreturn msg;","outputs":1,"noerr":0,"x":500,"y":140,"wires":[["dd50d96a.a6df38"]]},{"id":"e99073c4.3837c","type":"inject","z":"7d06fca2.eb72a4","name":"","topic":"","payload":"","payloadType":"date","repeat":"6","crontab":"","once":false,"onceDelay":0.1,"x":490,"y":90,"wires":[["d7cacd5b.dbb35"]]},{"id":"6af3242b.3daacc","type":"debug","z":"7d06fca2.eb72a4","name":"heater input","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":880,"y":110,"wires":[]},{"id":"82819028.ee8f2","type":"ui_group","z":"","name":"Pruebas Clima","tab":"1304a4f5.625afb","order":3,"disp":true,"width":"7","collapse":true},{"id":"1304a4f5.625afb","type":"ui_tab","z":"","name":"Pestaña Test","icon":"fa-television","order":2,"disabled":false,"hidden":false}]

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