Page 1 of 1

Rules and Global Sync

Posted: 28 Aug 2016, 14:22
by Johnhi30
Hi,
Can someone please point out what I'm missing when it comes to understanding rules, I'm using global Sync to receive a DHT temperature reading from another ESP Easy Device and can see the value arriving on this device running the rule in the log i.e EVENT: DHT#Temperature=21.50

All units are running R120

so why when i use a rule like

on DHT#Temperature do
if [DHT#Temperature] < 22.00 gpio,0,0
endif
endon

which i hoped would set GPIO 0 to be 0 when the temperature is less than 22.00 degs ? There is an LED attached to GPIO 0 which when low should light the Led, but there's no in state.

Is it simply me not getting the Syntax correct ?

Thanks in advance

Re: Rules and Global Sync

Posted: 28 Aug 2016, 17:55
by Martinus
Johnhi30 wrote:Hi,
Can someone please point out what I'm missing when it comes to understanding rules, I'm using global Sync to receive a DHT temperature reading from another ESP Easy Device and can see the value arriving on this device running the rule in the log i.e EVENT: DHT#Temperature=21.50

All units are running R120

so why when i use a rule like

on DHT#Temperature do
if [DHT#Temperature] < 22.00 gpio,0,0
endif
endon

which i hoped would set GPIO 0 to be 0 when the temperature is less than 22.00 degs ? There is an LED attached to GPIO 0 which when low should light the Led, but there's no in state.

Is it simply me not getting the Syntax correct ?

Thanks in advance
The gpio command should be on a separate line. It should work like this:

Code: Select all

on DHT#Temperature do
  if [DHT#Temperature]<22.00
    gpio,0,0
  endif
endon

Re: Rules and Global Sync

Posted: 29 Aug 2016, 00:24
by Johnhi30
Thanks Martinus, that was indeed the issue, i can see from some of my testing that i had structured the Syntax correctly like that but it still hadn"t worked as expected, strange but that's the way life with technolgy is sometimes. Appreciate the quick assistance.