bpmurray / node-red-contrib-dht-sensor

Node-RED node to process DHT11/22 sensor data
Apache License 2.0
6 stars 8 forks source link

Humidity #16

Open blokdk opened 5 years ago

blokdk commented 5 years ago

Dear @bpmurray, as you stated you decided to put only the temperature in the payload for compatibility. Do you have any suggestions on how to process the humidity on the broker side. I solved this issue in Node-Red by pausing/delaying the message for a few seconds and then with a change node change the payload to the msg.humidity and its own topic. But I suspect you have a more elegant way.

Thanks in advance, Peter Blok

bpmurray commented 5 years ago

Hi Peter

I'm not clear about what you need. Since the message contains the humidity, you can access it as msg.humidity. Did you want it explicitly in the payload? If so, perhaps connect this node to a script node that simply assigns the payload value to msg.humidity, or to change the payload to contain a struct "readings" so that you have readings.temperature and readings.humidity.

blokdk commented 5 years ago

Dear Brendan, When I have a debug look at the full msg on the broker end of the communication there is no humidity. I do not know if that is by design for some reason.As you put it "since the message contains the humidity" that is before it is send. Not at the receiving end. So if I want both measurements I have to recycle the message. First send it and receive the payload (temp) and then change the payload into msg.humidity. Is that  what you intended? Or am I just a fool without a clue? Feel free to acknowledge this as I am just starting with json, node-red and mqtt. Peter Blok

Am Freitag, 5. April 2019, 10:53:19 MESZ hat Brendan Murray <notifications@github.com> Folgendes geschrieben:  

Hi Peter

I'm not clear about what you need. Since the message contains the humidity, you can access it as msg.humidity. Did you want it explicitly in the payload? If so, perhaps connect this node to a script node that simply assigns the payload value to msg.humidity, or to change the payload to contain a struct "readings" so that you have readings.temperature and readings.humidity.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.