# Multipurpose sensor

**URL:** <https://discourse.nodered.org/t/multipurpose-sensor/66348>\
**Category:** General\
**Created:** [12 August 2022 07:51 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348 "2022-08-12T07:51:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [12 August 2022 07:51 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/1 "2022-08-12T07:51:14Z")

</div>

Hi i have a Samsung Multipurpose sensor, i like to have on My garage port. I hav not Mounted yet, I can see on ZHA\_events that it do come out with readings on movement.  
I do have my setup for zigbee (not mqtt), can somebody help me out to set up a node, so when it’s moving out of a position when my port is open so I can activate a light I have in my garage

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 August 2022 08:19 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/2 "2022-08-12T08:19:28Z")

</div>

If you are using zigbee then I highly recommend using zigbee2MQTT. It works extremely well and is almost trivial to setup. With that running you use the standard MQTT nodes to access the devices.

---

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [14 August 2022 07:36 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/3 "2022-08-14T07:36:16Z")

</div>

I have try to learn how to setup mqtt, but I don’t get it 😕 There is to much different documentation, I have my setup in docker (iotstack)on a raspberrypi 4 8gb with a conbee2 my zigbee devices I have setup runs to zha deconz (do I comment it out with# in my docker-compose.yml file I have the container mqtt and zigbee2mqtt. Do I setup a user under my user in Ha (user\_mqtt)?? I have try to find mqtt files, but for all of them it returns with ‘no assess’ (idk if it because I do my search on my win laptop over terminal) or do I just add something to cd ./IOTstack/docker-compose.yml file  
I’m kinda lost in it, I have try to read a lot of instructions and watch many YouTube videos. And mabye to much to keep it simple

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 August 2022 09:09 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/4 "2022-08-14T09:09:18Z")

</div>

I don't use Docker or HA so I can't help much if you want to go that route.

For an excellent tutorial that will tell you everything you need to know about working with MQTT (but not installing it) see [MQTT Essentials - All Core Concepts explained](https://www.hivemq.com/mqtt-essentials/)

I use Mosquitto as the MQTT broker which is usually trivial to install.

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [14 August 2022 21:50 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/5 "2022-08-14T21:50:20Z")

</div>

It's worth learning, MQTT is the bee's knees.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [14 August 2022 22:17 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/6 "2022-08-14T22:17:00Z")

</div>

> [@droneman83](#):
>
> I have try to learn how to setup mqtt, but I don’t get it 😕 There is to much different documentation, I have my setup in docker (iotstack)on a raspberrypi 4 8gb with a conbee2 my zigbee devices

OK showus your docker compose so we can see which containers out of the iotstack you are running and can then give some better advice.

I would also suggest that you rcheckout the iotstack discord server as they are pretty good on there with Newbies

Craig

---

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [15 August 2022 06:23 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/7 "2022-08-15T06:23:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/5661ca59be2778479f4819de98df91ac6ac1a15e.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/74a51ac8ea23edfd342ab18f34dab300c0d46a95.png)

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [15 August 2022 22:10 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/8 "2022-08-15T22:10:03Z")

</div>

OK so you have got all the necessary containers running (including MQTT) and Node Red.

So can you take us through what you have done ?

1. Assume you have some form of Zigbee Hub/receiver running - if so which one and where is it connected ?

2. Assume you have registered the Samsung Sensor on the Zigbee network ?

---

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [16 August 2022 09:33 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/9 "2022-08-16T09:33:41Z")

</div>

thank you 🙂  
yes i have a conbee2 stick on dev/ttyACM0 connected to my rpi 4.  
yes the sensor is connected to my ZHA, all of my devices are connected to zha. I don't mind if i have to move all to MQTT if neede 🙂  
I thing all of them are run through deconz container, even if I have not setup Phoscon/Deconz (do I mark it out the container out with #)??

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [16 August 2022 09:41 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/10 "2022-08-16T09:41:42Z")

</div>

Well it looks like you have everything you need to get your data into MQTT - it should be automatically happening

Can you load up MQTT explorer (I assume you are on Windows) and then point it to the IP Address of the PI on Port 1883 and see what it is seeing ?

Craig

---

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [16 August 2022 10:06 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/11 "2022-08-16T10:06:03Z")

</div>

when I go to 192.168.50.15:1883 it say can not connect to page??

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [16 August 2022 15:49 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/12 "2022-08-16T15:49:46Z")

</div>

Is that using MQTT explorer ?

You can not connect using a browser etc to that address

Craig

---

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [16 August 2022 21:44 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/13 "2022-08-16T21:44:41Z")

</div>

I don’t know how to use mqtt or set it up 🫣🫣

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [16 August 2022 21:55 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/14 "2022-08-16T21:55:49Z")

</div>

MQTT is already setup as part of your IOTSTACK - it is called Mosquitto

I am asking you to install in windows a program called MQTT explorer

Craig

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 August 2022 06:24 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/15 "2022-08-17T06:24:17Z")

</div>

> [@droneman83](#):
>
> I don’t know how to use mqtt or set it up

To learn more about MQTT then see this essential reading [MQTT Essentials - All Core Concepts Explained](https://www.hivemq.com/mqtt-essentials/)

---

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [17 August 2022 06:44 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/16 "2022-08-17T06:44:14Z")

</div>

hehe yes okey, it is installed on windows and connectede via my ip 192.168.50.15 🙂 👍  
do I reconnect my devices here??

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [17 August 2022 06:54 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/17 "2022-08-17T06:54:29Z")

</div>

Well based on the IOTSTACK that you have deployed your devices should be communicating through the MQTT broker (Mosquitto) now.

So what you want to do is setup a connection in MQTT Explorer to point to that IP address on the correct port as i stated and in the left hand window you should be able to see a whole heap of topics that these devices are talking on - here is mine for instance

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/f/4f41d1ab4688ea1390baa5c70ba7071352838b19.png)

---

<div class="post-metadata">

**Author:** ![droneman83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/droneman83/32/85519_2.png) [@droneman83](https://discourse.nodered.org/u/droneman83)\
**Post date:** [17 August 2022 07:03 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/18 "2022-08-17T07:03:01Z")

</div>

mine is look like this, but there is no devices in it 🙃 :upside\_down\_face

 ![Skærmbillede 2022-08-17 090020](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/2/222b2bf23ce3d73ad0362b430968f5ad2e91815a.jpeg)

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [18 August 2022 06:59 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/19 "2022-08-18T06:59:35Z")

</div>

Yes there is - look at the load under broker - expand that p what are the 63 messages about ?

Craig

---

<div class="post-metadata">

**Author:** ![dougle03](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dougle03/32/32979_2.png) [@dougle03](https://discourse.nodered.org/u/dougle03)\
**Post date:** [18 August 2022 07:39 UTC](https://discourse.nodered.org/t/multipurpose-sensor/66348/20 "2022-08-18T07:39:48Z")

</div>

Do you also have HA running on the Pi? If so, is the Conbee stick already talking to HA? If it is, then you can filter the events all node in the HA add-on to listen to the Conbee traffic, then pull out what you need from there. No need to go down the MQTT route if you don't want to.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/68c8b27dba83a820afcbacac83bacc08ddf384a5.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a64692e7e07f04d6ef19709cf91369d092b7fbd2.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/c/2c4d23d2bd14b432b6aa41b036c7ea90e9692963.png)

I use the above to monitor simple Zigbee remote push buttons. With a little trial and error you can easily filter out the commands or sensor outputs you need to trigger your outbound flow (Turn a light on)

[Next page](https://discourse.nodered.org/t/multipurpose-sensor/66348.md?page=2)
