# 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:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![joan895](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@joan895](https://discourse.nodered.org/u/joan895)
#### Post date: [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/1 "2021-11-26T08:24:28Z")

</div>

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

---

<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)

---

<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: [25 January 2022 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/3 "2022-01-25T08:27:38Z")

</div>

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