arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.2k stars 4.81k forks source link

RGB Scheme Brightness Control #8058

Closed Thefueltank closed 4 years ago

Thefueltank commented 4 years ago

PROBLEM DESCRIPTION

I Have built a ESP8266 WRGBW smart light.. It has a PIR motion Sensor, and also a LDR.

The template is set to {"NAME":"FloodLight","GPIO":[255,255,255,255,46,47,255,255,50,49,9,48,255],"FLAG":1,"BASE":18}

I have the 5 LEDs on PINS

White LED on PWM1i on pin 4 Red LED on PWM2i on Pin 5 Green LED on PWM3i on pin 15 Blue LED on PWM4i on pin 13 White LED on PWM5i on pin 12

PIR to GPIO 14 ADC0 to LDR

I have managed to work out everything & working fine with Tasmota apart from one issue.

The Light acts as a floodlight when dark. Once darkness falls, it sets the RGB to scheme4 & fades as it should through all RGB colours, once movement is detected with the PIR, it turns the RGB scheme off, turns on the White LED for 60 seconds & if movement has stopped, the White LEDs turn off & the RGB Scheme4 Continues.

I set the Brightness of all LEDs with the Faders The white works good as predicted with the sliders at the correct set brightness, but i can't adjust the Brightness of the RGB LEDs, They come on at full brightness, even if sliders are set to 10% when the Scheme is used?

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [x] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:

Rules output here:

Rule1 on analog#a0<=800 do backlog Rule2 0; Rule3 1 endon on analog#a0>805 do backlog Rule3 0; Rule2 1; power1 1; power2 1; power3 1 endon


Rule2 on switch1#state do backlog power1 0; power2 0; power3 0; power4 1; power5 1; RuleTimer1 60 endon on Rules#Timer=1 do backlog power1 1; power2 1; power3 1; power4 0; power5 0 endon

Rule3 on analog#a0<800 do backlog power1 0; power2 0; power3 0; power4 0; power5 0 endon

- [ ] Provide the output of this command: `Status 0`:

STATUS 0 output here:

- [ ] Provide the output of the Console log output when you experience your issue; if applicable:
  _(Please use_ `weblog 4` _for more debug information)_

Console output here:



### TO REPRODUCE
_Steps to reproduce the behavior:

If i don't use the fade scheme, the level of brightness can be controlled with the sliders and works ok but i dont get the fading scheme4 what i need

### EXPECTED BEHAVIOUR
_A clear and concise description of what you expected to happen._
When the RGB Scheme is used, it does not set maximum LED brightness to the Slider brightness, All RGB fade to max brightness only?

### SCREENSHOTS
_If applicable, add screenshots to help explain your problem._
Im flashing the device with a raspberry Pi & using:

Program Version | 8.1.0(tasmota)
-- | --
2019-12-25T12:33:25
2_6_1/2.2.2-dev(38a443e)

### ADDITIONAL CONTEXT
I have found similar issues while spending days going through code to see if i can rectify this
I need the Scheme to fade to the maximum the slider is set to rather than just full hammer brightness.

Once the ESP has been programmed, i set the scheme4 on, then set the rules, once the motion detection time has expired, it goes back to Scheme 4& works well apart from the RGB scheme brightness?

**(Please, remember to close the issue when the problem has been addressed)**
ascillato commented 4 years ago

Hi,

There were several changes from 8.1.0 to 8.2.0.3 ( more than 600 ).

Please, update and try again. This issue may be already solved. Thanks.

s-hadinger commented 4 years ago

You seem to have set wrong GPIOs. The pwm order is RGBCW, not WRGBW

Thefueltank commented 4 years ago

I will try the updated 8.2.0.3 over the weekend & try to see if works ascillato ... Thank you

s-hadinger, Yes i understand this and changed in option37 SetOption68 1 #use SetOption68 1 to control each PWM individually with sliders in webUI SetOption37 114, WWRGB, LEDs work fine on the right colours

Hopefully i will get chance to update and go over & check changes & let you know how i get on over the weekend.. Many Thanks

s-hadinger commented 4 years ago

Scheme 4 and SetOption68 1 both enabled is not supported. The behavior is undefined.

Thefueltank commented 4 years ago

Hi, I updated to version 8.2.0, no change in slider/scheme brightness change..

I also corrected slider to pin configuration ..

It still doesn't make any change in scheme brightness but will still do the job as planned.

can i add my own upython to create my own UI & still use the Tasmota AP

Many thanks for your help & quick responses Dean

ascillato2 commented 4 years ago

Ok, Controlling the maximum brightness of SCHEME 4 effect is not implemented. So this issue changes to a feature request. If you want to code it, please provide a PR. Thanks.

Thefueltank commented 4 years ago

How difficult will it be to implement? I'm still learning & nowhere near as advanced as you guys!

s-hadinger commented 4 years ago

Let me take a look

Thefueltank commented 4 years ago

Thank you