# Aqara window contact

**URL:** <https://discourse.nodered.org/t/aqara-window-contact/74001>\
**Category:** General\
**Created:** [21 January 2023 09:15 UTC](https://discourse.nodered.org/t/aqara-window-contact/74001 "2023-01-21T09:15:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [21 January 2023 21:56 UTC](https://discourse.nodered.org/t/aqara-window-contact/74001/3 "2023-01-21T21:56:58Z")

</div>

I posted a solution on the [old thread](https://discourse.nodered.org/t/zigbee2mqtt-aqara-cube-nodered/19260/5) that you originally asked this on:

You could use a Switch node that sends the `true` out on one output and the `false ` out on the other. Then use Change nodes in those two paths to set msg.payload to string on or off. If you don't know how to do that then I assume you are a beginner to node-red so I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

_[View the full topic](https://discourse.nodered.org/t/aqara-window-contact/74001)._
