# Combine 2 Sensor outputs

**URL:** <https://discourse.nodered.org/t/combine-2-sensor-outputs/47456>\
**Category:** General\
**Created:** [22 June 2021 06:06 UTC](https://discourse.nodered.org/t/combine-2-sensor-outputs/47456 "2021-06-22T06:06:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GTiglio](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@GTiglio](https://discourse.nodered.org/u/GTiglio)\
**Post date:** [22 June 2021 06:06 UTC](https://discourse.nodered.org/t/combine-2-sensor-outputs/47456/1 "2021-06-22T06:06:53Z")

</div>

Hi all,  
…this can‘t be that complicated… :-/

Ich have 2 messages coming via MQTT, one delivers true or false, the other one delivers a number, which I converted via a function-node also into a boolean. Now I want to combine both values, that mean if both values are true, make this, otherwise make make that…  
Could someone please point me into the right direction?  
Cheers, Georg

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 June 2021 06:08 UTC](https://discourse.nodered.org/t/combine-2-sensor-outputs/47456/2 "2021-06-22T06:08:46Z")

</div>

See [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

Once you have both values in one msg you can compare both.

---

<div class="post-metadata">

**Author:** ![GTiglio](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@GTiglio](https://discourse.nodered.org/u/GTiglio)\
**Post date:** [22 June 2021 06:46 UTC](https://discourse.nodered.org/t/combine-2-sensor-outputs/47456/3 "2021-06-22T06:46:25Z")

</div>

Wow, that was fast…  
thanks Steve, I‘ll try that…

---

<div class="post-metadata">

**Author:** ![GTiglio](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@GTiglio](https://discourse.nodered.org/u/GTiglio)\
**Post date:** [23 June 2021 19:34 UTC](https://discourse.nodered.org/t/combine-2-sensor-outputs/47456/4 "2021-06-23T19:34:04Z")

</div>

…and works perfectly!

Thanks, Steve!

---

<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:** [7 July 2021 19:34 UTC](https://discourse.nodered.org/t/combine-2-sensor-outputs/47456/5 "2021-07-07T19:34:42Z")

</div>

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