Help with rule

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
martiniman
Normal user
Posts: 13
Joined: 10 Jan 2017, 11:07

Help with rule

#1 Post by martiniman » 23 Apr 2017, 23:24

Hi.
I need simple rule in ESPEasy:

Code: Select all

if lux>1000 and lux<2000 then publish dim 50
if lux>2000 and lux<3000 then publish dim 60
if lux>3000 and lux<4000 then publish dim 70
Please help with code

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

Re: Help with rule

#2 Post by toffel969 » 24 Apr 2017, 09:46

martiniman wrote: 23 Apr 2017, 23:24 Hi.
I need simple rule in ESPEasy:

Code: Select all

if lux>1000 and lux<2000 then publish dim 50
if lux>2000 and lux<3000 then publish dim 60
if lux>3000 and lux<4000 then publish dim 70
Please help with code
Not sure about the mqtt part (I don't use it),but rules are

Code: Select all

On Light#Lux>1000 do 	// if light levels are above 1000 trigger this event 
if [Light#Lux]<2000		// if light levels are above 1000 and below 2000 
publish dim 50			// publish 50
endif
Endon 

On Light#Lux>2000 do 	// if light levels are above 2000 trigger this event 
if [Light#Lux]<3000		// if light levels are above 2000 and below 3000 
publish dim 60			// publish 60
endif
Endon 


On Light#Lux>3000 do 	// if light levels are above 3000 trigger this event 
if [Light#Lux]<4000		// if light levels are above 3000 and below 4000 
publish dim 70			// publish 70
endif
Endon 

Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests