Wifi Candle - illuminate with ESPEasy (WS2812)

Moderators: BertB, rtenklooster, Voyager, Stuntteam, Martinus

Message
Author
User avatar
moelski
Normal user
Posts: 124
Joined: 31 Aug 2016, 06:33
Location: Germany - NRW
Contact:

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#11 Post by moelski » 23 Oct 2016, 20:05

Hi @all,

I just placed the source code on github in the Playground. Hope it gets merged, soon 8-)

@timsson:
The code is for fastled - I´m using Adafruit Neopixels.
Anyway. The Fire simulation seems to be convertable. I will check that ;)
regards
Dominik

TomasB
Normal user
Posts: 3
Joined: 25 Oct 2016, 23:16

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#12 Post by TomasB » 26 Oct 2016, 00:39

Hi @moelski

Thank you for terrific work. I got it up in a very short time and it works very well.

There is one thing in the github version that I had to add to make it compile and run and this was to define the variable "timer25ms" using:

Code: Select all

unsigned long timer25ms;
This is placed next to where the "timer100ms" is defined. Was this a bad addition?

For my Wifi candles I aim to use a single strong RGB LED in the place of the flame, as "traditional" electronic candles. I have verified your code using the APA106 LEDs which use protocol similar to WS2012B, bought here: http://www.ebay.co.uk/itm/APA106-F5-F8- ... 4RraqCbhyw

These work very well with your implementation with one exception; The order of the red and green values. Thus I had to go through your entire code and flip the order for every "setPixelColor" instance in the code. There are probably nicer ways to implement this so that one can change the order in a variable. I will think about this and come with a suggestion later.

I have also ordered some WS2811 "compatible" RGBW strips (SK6812) that I will try to implement using your code. This may require one additional value (white) to be sent in the "setPixelColor" string and that will definitely require some significant further modifications.

Thanks' again for all the great work @moelski!

Btje
Normal user
Posts: 10
Joined: 23 Oct 2016, 14:13

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#13 Post by Btje » 26 Oct 2016, 09:52

Would it be much work to extend it to 4*8 leds?

I saw this module:

http://www.ebay.de/itm/WS2812-5050-RGB- ... SwgQ9VwYc9

Maybe you could make the amount of leds configurable?

Is the code available jet?

vobo70
Normal user
Posts: 8
Joined: 10 Oct 2016, 09:53

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#14 Post by vobo70 » 26 Oct 2016, 10:23

does anyone know is there a way to handle single rgb led (eg. WS2818) by EASYEsp?
I would like to set few colours:
red for heating
blue for airconditioning
...
regards,
Maciek

Btje
Normal user
Posts: 10
Joined: 23 Oct 2016, 14:13

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#15 Post by Btje » 26 Oct 2016, 11:35

Something else. for integration into domotic'z now the color and brightness are transferred i think but also the type like "police" would be greate.

TomasB
Normal user
Posts: 3
Joined: 25 Oct 2016, 23:16

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#16 Post by TomasB » 26 Oct 2016, 14:35

@vobo70

This is exactly what I have achieved with the APA106 leds. These work great at 3.3V even though they are rated for 5V.

See my reply above.

vobo70
Normal user
Posts: 8
Joined: 10 Oct 2016, 09:53

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#17 Post by vobo70 » 26 Oct 2016, 15:05

@ThomasB

Thanks,
I will try it asap I buy those APA106 leds.

Martinus
Normal user
Posts: 970
Joined: 16 Apr 2015, 17:21

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#18 Post by Martinus » 26 Oct 2016, 16:45

vobo70 wrote:does anyone know is there a way to handle single rgb led (eg. WS2818) by EASYEsp?
I would like to set few colours:
red for heating
blue for airconditioning
...
regards,
Maciek
I uploaded my basic test plugin for neopixel in the playground:
https://github.com/ESP8266nu/ESPEasyPlu ... oPixel.ino
Use rules commands to control single WS2812 leds into any color:
neoPixel <led nr>,<red>,<green>,<blue>

Just a demo rules set for a single LED:

Code: Select all

on System#Boot do
  timerSet 1,10
endon

on Rules#Timer=1 do
  neopixel,1,50,0,0 // red
  delay 100
  neopixel,1,0,50,0 // green
  delay 100
  neopixel,1,0,0,50 // blue
  delay 100
  neopixel,1,25,25,25 // white
  timerSet 1,5
endon

timsson
Normal user
Posts: 76
Joined: 25 Mar 2016, 22:00

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#19 Post by timsson » 26 Oct 2016, 20:23

Hello,
thank you very much, great work moelski!!!
I tested it, is works stabil!
Martinus your plugin is also fine - 123 rules and voala "strandtest" :D :D :D
https://youtu.be/Sir6EZxYMpc
candle1.JPG
candle1.JPG (40.04 KiB) Viewed 3275 times
candle2.jpg
candle2.jpg (32.78 KiB) Viewed 3275 times
candle3.JPG
candle3.JPG (157.71 KiB) Viewed 3239 times
Thanks
Last edited by timsson on 30 Oct 2016, 18:48, edited 1 time in total.

User avatar
moelski
Normal user
Posts: 124
Joined: 31 Aug 2016, 06:33
Location: Germany - NRW
Contact:

Re: Wifi Candle - illuminate with ESPEasy (WS2812)

#20 Post by moelski » 26 Oct 2016, 20:49

Hi !
There is one thing in the github version that I had to add to make it compile and run and this was to define the variable "timer25ms" using:
I will correct that on github. Thx for the hint
This may require one additional value (white) to be sent
Why did you need an additional value?
Would it be much work to extend it to 4*8 leds?
Not so much but you have to test the simulation with the enhanced (or reduced) set of LEDs.
Maybe you could make the amount of leds configurable?
For sure. But at the moment I´m implement the candle into my FHEM setup. So no time for code changes.
Is the code available jet?
Yes. On Github:
https://github.com/ESP8266nu/ESPEasyPlu ... Candle.ino
for integration into domotic'z now the color and brightness are transferred i think but also the type like "police" would be greate.
Type is implemented in the Github code :ugeek:

@timsson:
Thx for that video and the flowers 8-)
regards
Dominik

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests