Page 1 of 1

Rules and #ALL

Posted: 30 Jan 2025, 22:49
by betux
Hi,

I have a little problem with #all and rules

when i set this it doesn't work because %eventvalue1% has no value.
i think %eventvalue1% will be the name of the value apparently not.

How i can call a name from a group of value ?

on GROUPE1#ALL do

let,temp1,%eventvalue1%
let,temp2,%eventvalue2%
let,temp3,%eventvalue3%

LogEntry,"Valeur Temp1: %temp1%"
LogEntry,"Passage LED"
if temp1 > 27
LogEntry, "LED ON"
gpio,15,1
SendToSerial "page0.t6.txt=\"TEMPERATURE CRITIQUE\""
NEXTION,'page0.t0.txt= "TEMPERATURE CRITIQUE"'
else
LogEntry,"LED OFF"
LogEntry,"Valeur Temp1: %temp1%"
gpio,15,0
SendToSerial "page0.t6.txt=\"Normal\""
NEXTION,'page0.t0.txt= "TEMPERATURE NORMALE"'
endif
endon

Thanks.

Re: Rules and #ALL

Posted: 30 Jan 2025, 22:56
by TD-er
This will not work: "let,temp1,%eventvalue1%"
You need to use a numerical index instead of 'temp1'.

So more something like this:

Code: Select all

on GROUPE1#ALL do
  let,1,%eventvalue1%
  let,2,%eventvalue2%
  let,3,%eventvalue3%
  
  LogEntry,"Valeur Temp1: [var#1] Temp2: [var#2]  Temp3: [var#3]"
endon

Re: Rules and #ALL

Posted: 31 Jan 2025, 03:46
by ThomasB
Furthermore, the proper syntax for this:

Code: Select all

if temp1 > 27
Will be:

Code: Select all

if %v1% > 27
More details:
viewtopic.php?t=6288