EVENT: pcf_73_camera_dx#State=-1

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

EVENT: pcf_73_camera_dx#State=-1

#1 Post by megamarco83 » 24 Mar 2021, 01:57

hi, i'm using PCF8574 where i connect touch sensor ttp223 used as puch button active low.
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
but i see a something strange:
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!
Last edited by megamarco83 on 24 Mar 2021, 02:02, edited 1 time in total.

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: EVENT: pcf_73_camera_dx#State=-1

#2 Post by megamarco83 » 24 Mar 2021, 02:01

UPDATE:
itry to avoud usage of tasks and use only monitor:

Code: Select all

on System#Boot do
monitor,pcf,76
monitor,pcf,73
monitor,pcf,74
endon

on pcf#73=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=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

here the log:

Code: Select all

33194: WD : Uptime 1 ConnectFailures 0 FreeMem 18408 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
62644: EVENT: Clock#Time=Wed,01:57
63189: WD : Uptime 1 ConnectFailures 0 FreeMem 18560 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
88038: PCF : Port=74 is offline (EVENT= -1)
88048: EVENT: PCF#74=-1
88208: EVENT: pcf_74_scrivania#State=-1
88380: PCF : Port=74 State=1 Output value=1
88385: EVENT: PCF#74=1
88544: EVENT: pcf_74_scrivania#State=1
93188: WD : Uptime 2 ConnectFailures 0 FreeMem 18560 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
122641: EVENT: Clock#Time=Wed,01:58
123195: WD : Uptime 2 ConnectFailures 0 FreeMem 18544 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP I
why i still have event /state = -1 ?

User avatar
Ath
Normal user
Posts: 3480
Joined: 10 Jun 2018, 12:06
Location: NL

Re: EVENT: pcf_73_camera_dx#State=-1

#3 Post by Ath » 24 Mar 2021, 17:07

If you set up a non-connected port for monitoring, does that also generate these 'State=-1' events?
/Ton (PayPal.me)

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: EVENT: pcf_73_camera_dx#State=-1

#4 Post by megamarco83 » 25 Mar 2021, 19:47

Ath wrote: 24 Mar 2021, 17:07 If you set up a non-connected port for monitoring, does that also generate these 'State=-1' events?
hi, no, it is generated only with monitor, with a task this not happened.

User avatar
Ath
Normal user
Posts: 3480
Joined: 10 Jun 2018, 12:06
Location: NL

Re: EVENT: pcf_73_camera_dx#State=-1

#5 Post by Ath » 25 Mar 2021, 21:17

megamarco83 wrote: 25 Mar 2021, 19:47
Ath wrote: 24 Mar 2021, 17:07 If you set up a non-connected port for monitoring, does that also generate these 'State=-1' events?
hi, no, it is generated only with monitor, with a task this not happened.
That wasn't the question, I'd like to find out if, when activating the monitor command for a PCF input that has nothing connected, also generates these 'false triggers' you have experienced with a touch-button attached.

A major difference between the monitor command and a task, is that for a task you can configure a de-bounce time (or the Use Safe Button option), minimizing the chance of a false trigger.
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 19 guests