logo elektroda
logo elektroda
X
logo elektroda

LED strip control with D1 Wemos + IR TSOP1736 by Domoticz

maystero 8214 43
Best answers

Can I use a Wemos D1 with ESP Easy and a TSOP1736 receiver to control an LED strip by PWM and IR remote commands through Domoticz?

Yes — ESP Easy can drive an LED strip with PWM and it can also handle IR input through a supported IR build plus Rules. For PWM, use the control URL like `http:///control?cmd=PWM,13,500`, where `13` is the GPIO and `500` is the 0–1023 PWM value; the pin must be configured as an output first [#17568706] For IR, upload an ESP Easy BIN with IR support (for example a Mega build that includes it), then enable Rules and map the received `IR` values to actions in a rule [#17623041][#17568706] If IR reading behaves oddly, one reported fix was to use the 2018.12.04 Mega build because later versions had a bug [#17623618] For the TSOP receiver, proper decoupling/power wiring matters; adding the recommended capacitor and wiring it as in the datasheet fixed random IR interference for one user [#17852042][#17854239]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 17852405
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    maystero wrote:
    Hello

    Late at night, I also noticed it was missing:
    Code: Bash
    Log in, to see the code
    .

    I have added it to the RULES:
    Code: Bash
    Log in, to see the code
    .

    It works as I described in the post above.
    Quote:
    It only goes off when I press another button on the remote....


    And LOG
    Code: Bash
    Log in, to see the code


    You can see that it didn't change the state to the opposite....
    as if it did not change the Switch_1 value

    Added after 12 [hours] 30 [minutes]:

    I don't know what's going on anymore myself.
    I have assembled a second circuit.
    I am using the TSOP1736 for testing.
    The ESP in the DEVICES list has a TSOP4838.
    Could this have an effect on this strange circuit behaviour?
    .
    Aprpos of the lack of state change, I had a similar problem and figured out that there must be a space between the IF and the condition, unfortunately this "compiler" is quite flawed. In my case it worked after such a change.
    Code: C / C++
    Log in, to see the code
    .
    Please test.

    And as for the problem with reading from the TSOP, connect as written @khoam .

    Greetings
  • ADVERTISEMENT
  • #32 17854239
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    khoam wrote:
    Maybe connect the power supply to the TSOP as DS recommends to start with:

    LED strip control with D1 Wemos + IR TSOP1736 by Domoticz
    .

    Thanks!
    It helped, although, I remember running a similar circuit once and there everything worked without the 4.7uF capacitor....

    I will now check this RULES and let you know.

    Added after 6 [minutes]:

    Slawek K. wrote:
    .
    Aprpos of not changing the condition, I had a similar problem and figured out that there must be a space between the IF and the condition, unfortunately this "compiler" is quite flawed. In my case it worked after such a change.
    Code: C / C++
    Log in, to see the code
    .
    Please test.

    And as for the problem with reading from the TSOP, connect as written @khoam .

    Greetings
    .

    Adding a space helped!
    Thanks.
    I've already used up the "helped" pool so I'm sending you some points.
  • ADVERTISEMENT
  • #33 17854289
    Anonymous
    Level 1  
  • #34 18166311
    demsy
    Level 22  
    Posts: 887
    Help: 17
    Rate: 178
    Hello
    I didn't want to open a new topic because I have a similar problem with the control of LED's
    Namely the command than works
    Code: VB.net
    Log in, to see the code
    .
    but still
    Code: VB.net
    Log in, to see the code
    .
    immediately turns off my LEDs
    the firmware in the ESP I have
    Code: VB.net
    Log in, to see the code
    .
  • #36 18166393
    demsy
    Level 22  
    Posts: 887
    Help: 17
    Rate: 178
    with this syntax, the LEDs only light up for a moment and then go out
    Code: VB.net
    Log in, to see the code
    .
    Code: VB.net
    Log in, to see the code
    .
  • #37 18166398
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    At which one?
  • #38 18166400
    demsy
    Level 22  
    Posts: 887
    Help: 17
    Rate: 178
    Code: VB.net
    Log in, to see the code
    .
  • ADVERTISEMENT
  • #39 18166401
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    Give a screenshot of the Devices tab.

    Greetings
  • #40 18166407
    demsy
    Level 22  
    Posts: 887
    Help: 17
    Rate: 178
    LED strip control with D1 Wemos + IR TSOP1736 by Domoticz .

    Added after 10 [minutes]:

    I read on the forum that
    pwm,12,1024,1000,4000
    <pwm><GPIO><fill><time><frequency>
    and when switched on it brightens the LED strip, but at fill "0" it goes out immediately(no smooth dimming effect)
  • #41 18166463
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    If the fill is 0 then there is no control voltage for the mosfet gate, so the effect you are after is missing.

    Greetings
  • ADVERTISEMENT
  • #42 18166548
    Anonymous
    Level 1  
  • #43 18166746
    demsy
    Level 22  
    Posts: 887
    Help: 17
    Rate: 178
    my settings in domoticz
    LED strip control with D1 Wemos + IR TSOP1736 by Domoticz .

    the action that turns the LEDs on works correctly

    Added after 19 [minutes]:

    https://espeasy.readthedocs.io/en/latest/Plugin/P000.html?highlight=pwm

    Added after 4 [minutes]:
    LED strip control with D1 Wemos + IR TSOP1736 by Domoticz
    problem solved
    firmware upload helped
    ESP_Easy_mega-20190903_normal_core_241_ESP8266_4M1M.bin

    Added after 9 [hours] 3 [minutes]: .

    khoam wrote:
    .
    The fill cannot be 1024.

    and the padding is 1023
  • #44 18719232
    uzi18
    Level 24  
    Posts: 751
    Help: 37
    Rate: 81
    the current documentation is on readthedocs as a colleague wrote above, the old wiki should be considered as a supplement.

    For some time now, espeasy also accepts a condition without a space after the IF, for syntactic cleanliness it used to be required, but it has been noted that some examples without spaces could be found on the wiki

Topic summary

✨ The discussion addresses controlling an LED strip using a D1 Wemos module integrated with Domoticz, focusing on on/off switching and brightness adjustment via PWM. The user aims to add IR remote control functionality using a TSOP1736 or TSOP4838 IR receiver connected to GPIO pins (e.g., D3). ESP Easy firmware is used for device control, with PWM commands issued through HTTP URLs. PWM control is confirmed feasible via ESP Easy, but Domoticz lacks native PWM support. IR command handling requires enabling the Rules feature in ESP Easy and uploading a firmware version with IR support (e.g., ESP_Easy_mega-20181208_normal_IR_ESP8266_4096.bin or R147). Users report issues with IR decoding, firmware bugs, and syntax errors in Rules scripts, such as missing spaces after IF statements and incorrect bracket usage. Solutions include using Dummy Devices to store toggle states, consolidating IF conditions within a single ON event, and ensuring proper wiring and power supply to the TSOP IR receiver, including adding a 4.7µF capacitor for stability. The IR remote codes are captured as events, and Rules scripts toggle GPIO outputs accordingly. Firmware version compatibility is critical, with older versions sometimes more stable for IR functions. PWM commands follow the syntax http:///control?cmd=PWM,,,,, with fill values from 0 to 1023; a fill of 0 immediately turns off LEDs without smooth dimming. Firmware updates (e.g., ESP_Easy_mega-20190903_normal_core_241_ESP8266_4M1M.bin) resolve some PWM issues. The discussion includes practical examples of Rules scripting for IR command handling and PWM control, emphasizing careful syntax and device configuration.
Generated by the language model.

FAQ

TL;DR: 0-1023 PWM range gives 1024 brightness steps and “ESP Easy can be controlled by PWM” [Slawek K., #17568706]. Use an IR-enabled ESP Easy build plus a TSOP4838 on D3 to read TV-remote codes.

Why it matters: One board handles Wi-Fi, fading LEDs and IR control without extra microcontrollers.

Quick Facts

2. What PWM command string should I use?

Format: PWM,GPIO,DUTY. Example: /control?cmd=PWM,12,512 sets 50 % duty [Elektroda, Slawek K., post #18166363] Add optional TIME,Hz for fades (e.g. PWM,12,0,1000,4000).

3. Why does duty 0 switch the strip off instantly?

A duty of 0 resets the pin to LOW, exiting PWM mode; smooth fade needs a small non-zero value (e.g. 20) then ramp down [Elektroda, khoam, post #18166548]

4. How do I enable smooth fade on power-down?

Issue two commands: 1. PWM,12,1023,1000,4000 to ramp to full; 2. PWM,12,20,1000,4000 then finally PWM,12,0. Each step lasts the TIME parameter (ms).

5. Which firmware contains the IR Input plugin?

Any build name ending in IR (e.g. ESP_Easy_mega-20181204_normal_IR_ESP8266_4096.bin) or _normal_core241... after 2019-09-03 [Elektroda, maystero, #17623041; demsy, #18166746].

6. How do I wire the TSOP4838/1736 correctly?

Connect Vs to 3.3 V, GND to GND, OUT to D3 (GPIO 0/Pad3). Add 4.7 µF electrolytic across Vcc–GND and a 100 Ω series resistor on Vs to suppress noise [Elektroda, khoam, post #17852042]

7. I see random codes in the log—what’s wrong?

Noise or unstable supply. The capacitor + resistor filter removes >90 % of false triggers. Also keep receiver away from CFL and plasma TV sources [Elektroda, khoam, post #17852042]

8. How do I capture IR codes and toggle specific GPIOs?

  1. Enable Rules in Tools→Advanced. 2. In the log note IR_RECEIVER#IR value. 3. Create a rule:

on IR_RECEIVER#IR do
if [IR_RECEIVER#IR]=2017267209
gpio,14,![14]
endif
endon
This inverts GPIO 14 each time that code is received [Elektroda, Slawek K., post #17624215]

9. My rule never toggles twice—why?

Ensure a space after IF: if [var]=value. Missing space prevents the parser from updating the variable, so the second press appears identical [Elektroda, Slawek K., post #17852405]

10. "Unknown or restricted command!" after flashing—fix?

A bug exists in builds after 2018-12-08; downgrade to 2018-12-04 or newer 2019-09-03 core 2.4.1 build [Elektroda, Slawek K., #17623618; demsy, #18166746].

11. How can I integrate with Domoticz if it lacks PWM widgets?

Create a virtual switch in Domoticz and point its On/Off action URLs to ESP Easy PWM commands. Alternatively use a Dummy device and Rules to translate MQTT messages to PWM [Elektroda, maystero, post #17570596]

12. What’s the maximum current the ESP8266 GPIO can drive?

Each GPIO sources about 12 mA max; always drive LED strips through a MOSFET or LED driver, not directly [Espressif Datasheet, 2020].

13. What edge-case firmware failure should I watch?

Build 2018-12-08_normal_IR blocks all GPIO, returning "Unknown command"; many users spent hours debugging before rolling back [Elektroda, Slawek K., post #17623618]

14. Quick 3-step setup for IR-controlled dimming

  1. Flash _normal_IR build and enable Rules.
  2. Wire TSOP4838 with 4.7 µF cap to D3.
  3. Add rule that maps captured IR codes to PWM commands; test with /control?cmd=PWM,12,512.
Generated by the language model.
ADVERTISEMENT