Why is this rule not working?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Why is this rule not working?

#1 Post by micropet » 05 Mar 2018, 18:30

I want the Neopixels to be bright during the day and darker in the evening.
They should show me the CO2 value.

The following rule does not work:

Code: Select all

on MH-Z19#PPM do
	if [MH-Z19#PPM]<=700
		if %systime% > 08:00:00 and %systime% < 20:00:00 
			NeoPixelAll,0,80,0,0  // gruen tagsueber
		else
			NeoPixelAll,0,8,0,0   // gruen abends
		endif
	endif

	if [MH-Z19#PPM]>=700 and [MH-Z19#PPM]<=1200
		if %systime% > 08:00:00 and %systime% < 20:00:00 	
			NeoPixelAll,60,60,0,0 // gelb tagsueber
		else 
			NeoPixelAll,8,8,0,0 
		endif
	endif		

	if [MH-Z19#PPM]>=1200
		if %systime% > 08:00:00 and %systime% < 20:00:00 	
			NeoPixelAll,80,0,0,0 // rot tagsueber
		else 
			NeoPixelAll,8,0,0,0 
		endif 
	endif		
endon	
This works:

Code: Select all

On MH-Z19#PPM<700 do
    NeoPixelAll,0,80,0,0  // gruen
endon
	 
On MH-Z19#PPM>700 do
	if [MH-Z19#PPM]<1200
		NeoPixelAll,50,50,0,0 // gelb
	else 
		NeoPixelAll,80,0,0,0 // rot
	endif 
endon	
Can someone help me why the first Rule is not working?

moebius
Normal user
Posts: 35
Joined: 22 May 2017, 19:36

Re: Why is this rule not working?

#2 Post by moebius » 05 Mar 2018, 18:49

Last edited by moebius on 05 Mar 2018, 19:54, edited 1 time in total.

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: Why is this rule not working?

#3 Post by micropet » 05 Mar 2018, 19:07

OK. I thought that had changed in the meantime.

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

Re: Why is this rule not working?

#4 Post by grovkillen » 05 Mar 2018, 19:31

No, not allowed.
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
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: Why is this rule not working?

#5 Post by micropet » 05 Mar 2018, 19:52

Good, thank you both. Then I rebuild the rule.

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: Why is this rule not working?

#6 Post by micropet » 05 Mar 2018, 20:07

That seems to work:

Code: Select all

// ----- 
on MH-Z19#PPM do
	if [MH-Z19#PPM]<=700
		event gruen
	endif
	if [MH-Z19#PPM]>=700 and [MH-Z19#PPM]<=1200
		event gelb
	endif
	if [MH-Z19#PPM]>=1200
		event rot
	endif	
endon

on gruen do	
	if %systime% > 08:00:00 and %systime% < 20:00:00 
		NeoPixelAll,0,80,0,0  // gruen tagsueber
	else
		NeoPixelAll,0,8,0,0   // gruen abends
	endif
endon

on gelb do
	if %systime% > 08:00:00 and %systime% < 20:00:00 	
		NeoPixelAll,60,60,0,0 // gelb tagsueber
	else 
		NeoPixelAll,8,8,0,0 
	endif
endon

on rot do
	if %systime% > 08:00:00 and %systime% < 20:00:00 	
		NeoPixelAll,80,0,0,0 // rot tagsueber
	else 
		NeoPixelAll,8,0,0,0 
	endif 
endon	
// ----------

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests