WS2812b, rules and temperature/humidity range

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
bogas
Normal user
Posts: 21
Joined: 20 Jan 2018, 11:22

WS2812b, rules and temperature/humidity range

#1 Post by bogas » 21 Jan 2018, 19:15

Hey.
And this is my second problem, which I can not deal with :)
Is the following rule correct?
Currently, the orange LED is on and the humidity is around 35%.
In the device I chose neopixel basic.
Regards

Code: Select all

On HTU#Humid do 
if [HTU#Humid] > 40
neopixel,1,0,0,50
else
neopixel,1,50,50,50
endif
endon 

On HTU#Humid do 
if [HTU#Humid] > 45
neopixel,1,0,50,50
else
neopixel,1,0,0,50
endif
endon 

On HTU#Humid do 
if [HTU#Humid] > 50
neopixel,1,0,50,0
else
neopixel,1,0,50,50
endif
endon 

On HTU#Humid do 
if [HTU#Humid] > 55
neopixel,1,50,50,0
else
neopixel,1,0,50,0
endif
endon 

On HTU#Humid do 
if [HTU#Humid] > 60
neopixel,1,50,0,0
else
neopixel,1,50,50,0
endif
endon 

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden

Re: WS2812b, rules and temperature/humidity range

#2 Post by grovkillen » 21 Jan 2018, 21:19

This is what I do with three imported (mqtt import) RH values. If some of it is over a certain level change the neopixel:

Code: Select all

On System#Boot do
TimerSet,1,10
EndOn

On Rules#Timer=1 do
TaskValueSet,1,1,0

If [import#rh1] < 30
TaskValueSet,1,1,1
EndIf

If [import#rh2] < 30
TaskValueSet,1,1,1
EndIf

If [import#rh3] < 30
TaskValueSet,1,1,1
EndIf

If [Evaluate#RH]=1
  NeoPixel,1,0,25,0 //red 
Else
  NeoPixel,1,25,0,0 //green
EndIf
TimerSet,1,10
EndOn
So I use a dummy device to store values. And at the beginning of each run I set the value to zero and then evaluate it.

I hope I can inspire you to fix your rule.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: WS2812b, rules and temperature/humidity range

#3 Post by toffel969 » 22 Jan 2018, 19:46

Using the same event multiple times is not recommended.

viewtopic.php?f=6&t=2913&p=15179&hilit= ... ing#p15179

This way, you should be able to create rules that fulfil intended function
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

bogas
Normal user
Posts: 21
Joined: 20 Jan 2018, 11:22

Re: WS2812b, rules and temperature/humidity range

#4 Post by bogas » 28 Jan 2018, 11:23

Guys,
can You help with these colors?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: WS2812b, rules and temperature/humidity range

#5 Post by toffel969 » 29 Jan 2018, 05:47

bogas wrote: 28 Jan 2018, 11:23 Guys,
can You help with these colors?
We are man, both grovkillen and my posts are containing the information and principles to fix the problem. what exactly do you expect? That we write your rules? Then (and that be sad enough) you gonna have to provide screenshots of the devices and some logs...
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Who is online

Users browsing this forum: Anthropic Claude Bot [bot] and 10 guests