i create a task for port78 for example and named and create a rule that send out a mqtt message when the push button is pressed:
Code: Select all
on System#Boot do
monitor,pcf,76
endon
// rules related to tasks
on pcf_73_camera_dx#State=0 do
Publish cmnd/tasmota_156/power12,'2' // tasmota toggle pcf1 relay9
Publish cmnd/dimmer/power1,'2' // tasmota toggle luce dimmer camera
endon
on pcf_74_scrivania#State=0 do
Publish cmnd/tasmota_led_scrivania/power1,'2'
Publish cmnd/tasmota_156/power2,'2' // tasmota toggle pcf0 relay2
endon
//RULES without task, using monitor
on pcf#76=0 do
Publish cmnd/tasmota_156/power11,'2' // tasmota toggle pcf0 relay2
endon
1) if instead of using task i use only monitor, i see that randomly the mqtt messages are sended if i not press the touch pushbutton.
2) it seams solved (no mqtt messages sendout randomy) if i not use monitor and if i use only tasks to assing pcf ports
here the log:
Code: Select all
41025: PCF : Port=73 State=1 Output value=1
41036: EVENT: pcf_73_camera_dx#State=1
41206: PCF : Port=73 is offline (EVENT= -1)
41213: EVENT: pcf_73_camera_dx#State=-1
42568: PCF : Port=73 State=1 Output value=1
42574: PCF : Port=79 State=1 Output value=1
42584: EVENT: pcf_73_camera_dx#State=1
42752: PCF : Port=73 is offline (EVENT= -1)
42763: EVENT: pcf79#State=1
42928: PCF : Port=79 is offline (EVENT= -1)
42938: EVENT: pcf_73_camera_dx#State=-1
43152: EVENT: pcf79#State=-1
45864: PCF : Port=73 State=1 Output value=1
45874: PCF : Port=79 State=1 Output value=1
45882: EVENT: pcf_73_camera_dx#State=1
46047: PCF : Port=73 is offline (EVENT= -1)
46057: PCF : Port=79 is offline (EVENT= -1)
46066: EVENT: pcf79#State=1
46230: EVENT: pcf_73_camera_dx#State=-1
46402: EVENT: pcf79#State=-1
46759: PCF : Port=73 State=1 Output value=1
46770: EVENT: pcf_73_camera_dx#State=1
46940: PCF : Port=73 is offline (EVENT= -1)
46946: EVENT: pcf_73_camera_dx#State=-1
it seams that the radom mqtt messages are send out because espasy trigger the rules because for monitor it receive a -1 value
same thing (event with -1value) happen also for tasks, but in this case event -1 not trigger the rules, so mqtt messages in this case are not send out.
what i receive monitor value as -1 or event value -1 is none is touching the ttp223?
how to avoid this?
thanks!