# I need help in how to create a function where it allows me to turn on and off a switch by means of an infrared sensor using remote control, the control will allow to control LEDs

**URL:** https://discourse.nodered.org/t/i-need-help-in-how-to-create-a-function-where-it-allows-me-to-turn-on-and-off-a-switch-by-means-of-an-infrared-sensor-using-remote-control-the-control-will-allow-to-control-leds/54311
**Category:** General
**Created:** [26 November 2021 08:24 UTC](https://discourse.nodered.org/t/i-need-help-in-how-to-create-a-function-where-it-allows-me-to-turn-on-and-off-a-switch-by-means-of-an-infrared-sensor-using-remote-control-the-control-will-allow-to-control-leds/54311 "2021-11-26T08:24:28Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [26 November 2021 08:27 UTC](https://discourse.nodered.org/t/i-need-help-in-how-to-create-a-function-where-it-allows-me-to-turn-on-and-off-a-switch-by-means-of-an-infrared-sensor-using-remote-control-the-control-will-allow-to-control-leds/54311/2 "2021-11-26T08:27:04Z")

</div>

Welcome to the forum @joan895

Please have a look at this thread from earlier today asking pretty much exactly the same question - [I want to control someone else's leds using mqtt and an infrared sensor](https://discourse.nodered.org/t/i-want-to-control-someone-elses-leds-using-mqtt-and-an-infrared-sensor/54305)

---

_[View the full topic](https://discourse.nodered.org/t/i-need-help-in-how-to-create-a-function-where-it-allows-me-to-turn-on-and-off-a-switch-by-means-of-an-infrared-sensor-using-remote-control-the-control-will-allow-to-control-leds/54311)._
