Dim up / down LED by a rule ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Dim up / down LED by a rule ?

#1 Post by kr0815 » 14 Aug 2016, 21:25

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

anarro
Normal user
Posts: 14
Joined: 01 Aug 2016, 08:32

Re: Dim up / down LED by a rule ?

#2 Post by anarro » 16 Aug 2016, 10:08

Hi,
I think thats you can do it, can you read this document before?

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

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: Dim up / down LED by a rule ?

#3 Post by kr0815 » 17 Aug 2016, 08:22

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 ?

hamster
Normal user
Posts: 62
Joined: 27 Sep 2015, 21:01
Location: UK

Re: Dim up / down LED by a rule ?

#4 Post by hamster » 17 Aug 2016, 22:26

dimmer.jpg
dimmer.jpg (200.52 KiB) Viewed 6196 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

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests