giorgino wrote: ↑18 May 2023, 07:46
Code: Select all
config,task,DimmiWaterLevel,SetLevel,180
On [waterflow#TOTALE_dal_reset] Do
Let,1,180-[waterflow#TOTALE_dal_reset] //quando sente un aggiornamento di [waterflow#TOTAL_dal_reset] lo scrive in var1
Endon
There are a few problems in your code:
- A 'loose' statement, not in an event handler, is never executed, so the config,task... can be removed, as you can set the initial value in the Task itself, and on restart or whatever event you want the last stored value, not reset it to some default.
- An event should
not have square brackets around the name, as then the rules processor will replace that by the value of the variable, a correct way to write that handler could be:
Code: Select all
On waterflow#TOTALE_dal_reset Do
Let,1,180-%eventvalue1% //quando sente un aggiornamento di [waterflow#TOTAL_dal_reset] lo scrive in var1 (using the argument provided with the event)
Config,task,DimmiWaterLevel,SetLevel,[var#1] // Store new level in the level task, that is configured to store it automatically
Endon