Page 1 of 1

Dim up / down LED by a rule ?

Posted: 14 Aug 2016, 21:25
by kr0815
Maybe someone has a good idea here ?

I want to install some LED Stripes that
- are controlled by a PIR
- fade up / down
- i could manually switch them on by a http command
- i could manually inhibit them to switch on

the PIR on / off should be directly in ESPEasy, not by a external server

I guess this could be done by one / some pretty long rules, anybody did this before ?
Please submit also parts of this routine, maybe i could puzzle them together myself

Re: Dim up / down LED by a rule ?

Posted: 16 Aug 2016, 10:08
by anarro
Hi,
I think thats you can do it, can you read this document before?

http://www.esp8266.nu/index.php/Tutorial_Rules

Re: Dim up / down LED by a rule ?

Posted: 17 Aug 2016, 08:22
by kr0815
I saw the rules explanation, even have some ESP with rules running

But, is there a command to dim up / down ?
Or do i have to do it manually with a counter and a formula ?

Re: Dim up / down LED by a rule ?

Posted: 17 Aug 2016, 22:26
by hamster
dimmer.jpg
dimmer.jpg (200.52 KiB) Viewed 6257 times
I use the following lua script in domoticz to dim led lights

Code: Select all

commandArray = {}
-- Check for wifidimmer changed
DomDevice = 'wifidimmer'
for i, v in pairs(devicechanged) do
   if (i == DomDevice) then
      if (v == 'Off') then DomValue = 0
         commandArray['OpenURL']='http://192.168.0.44/control?cmd=PWM,0,0,1024'
         print("test")
      else
         DomValue = otherdevices_svalues[DomDevice]
         CalcValue = DomValue*33
         print(CalcValue)
         url= 'http://192.168.0.44/control?cmd=PWM,0,' .. CalcValue ,'1024'
         print (url);
         --commandArray['SendNotification']="test"
         commandArray['OpenURL']= url
      end
   end
end
The board was courtesy of this guy http://blog.quindorian.org/2016/08/esp8 ... mment-4761 where as the firmware on my dimmers is 'espeasy' also increased the memory chip to 4Mb to allow OTA upgrades