I created a dummy value that should reflect the status of a GPIO pin. And I want that done from internally on the ESPeasy.
This GPIO13 pin controls a (Keyes) relais and that is triggered externally from pimatic and that works fine.
I "could" set the dummy value from pimatic, but I want the EspEasy to be more "self supporting" and read it itself.
So I created a rules set:
Code: Select all
On System#Boot do //When the ESP boots, do
timerSet,1,10 //Set Timer 1 for the next event in 10 seconds
endon
On Rules#Timer=1 do //When Timer1 expires, do
TaskValueSet 2,4,"status,gpio,13"
timerSet,1,20 //Set Timer 1 for the next event in 20 seconds
endon
I do not know how to use an event in this.
In above "Rules#Timer=1" loop I tried also something like:
Code: Select all
if [cmd=status,gpio,13]=1
TaskValueSet 2,4,1
else
TaskValueSet 2,4,1
endif
That doesn't work either (and is actually a clumsy way to do it, but if it is the only way, so be it).