Ghost switch ??

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Nemocaledonie
New user
Posts: 9
Joined: 11 Apr 2019, 02:18

Ghost switch ??

#1 Post by Nemocaledonie » 18 Aug 2020, 01:51

Good morning all,
There you go: I'm trying to do automatic watering with ESPEASY.
The assembly consists of 2 relays mounted so as to reverse the polarity to open or close a solenoid valve.
It works well, except that ... from time to time I have a valve opening without any action. I give you the Rules that I use.
I looked everywhere, using other switches: same. without switch: same. And the whole thing is random. Change the Wemo :same (it's a Wemos D1 mini Pro)
If anyone had a clue, she would be welcome.
Thanks.
Xavier

// Partie automatique
on Clock#Time=All,**:28 do //Mode auto a chaque lever %sunrise% (%sunset% is also available)
if [Etats#Etat_Manuel]=0 and [Bouton#Etat]=1
TaskValueSet 11,2,1
gpio,12,0
gpio,13,1
timerSet,4,1
else
timerSet,4,0
timerSet,5,0
timerSer,6,0
endif
endon

// Partie Manuelle
on Bouton#Etat=0 do // Mode manuel
if [Bouton#Etat]=0 and [Etats#Etat_Auto]=0
TaskValueSet 11,1,1
gpio,12,0
gpio,13,1
timerSet,1,1
else
TaskValueSet 11,1,0
endif
endon

//Timers Auto et manuel
on Rules#timer=1 do // Mode manuel Timer1 (ouverture vanne)
gpio,13,0
timerSet,1,0
timerSet,2,5 // Temps arrosage en secondes
endon

on Rules#timer=2 do // Mode manuel Timer2 (arrosage)
gpio,13,0
gpio,12,1
timerSet,2,0
timerSet,3,1
endon

on Rules#timer=3 do // Mode manuel Timer3 (fermeture vanne)
gpio,12,0
TaskValueSet 11,1,0
TaskValueSet 12,1,1
timerSet,3,0
endon

on Rules#timer=4 do // Mode auto Timer4 (ouverture vanne)
gpio,13,0
timerSet,4,0
timerSet,5,5
endon

on Rules#timer=5 do // Mode auto Timer5 (Arrosage)
gpio,13,0
gpio,12,1
timerSet,5,0
timerSet,6,1
endon

on Rules#timer=6 do // Mode auto Timer6 (fermeture vanne)
gpio,12,0
TaskValueSet 11,2,0
timerSet,6,0
endon
Attachments
Capture d’écran 2020-08-18 à 10.45.37.png
Capture d’écran 2020-08-18 à 10.45.37.png (141.06 KiB) Viewed 8273 times
Capture d’écran 2020-08-18 à 10.45.11.png
Capture d’écran 2020-08-18 à 10.45.11.png (121.75 KiB) Viewed 8273 times

epost
Normal user
Posts: 33
Joined: 09 Feb 2018, 20:04

Re: Ghost switch ??

#2 Post by epost » 18 Aug 2020, 08:28

timerSer,6,0

This is a typo?

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Ghost switch ??

#3 Post by TD-er » 18 Aug 2020, 08:40

Also please check if the ESP may have crashed and rebooted when the valve opens unintended.
If the unit reboots, then some pins may toggle a few times at boot.
See: https://espeasy.readthedocs.io/en/lates ... on-esp8266 and especially the links mentioned there.

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

Re: Ghost switch ??

#4 Post by Ath » 18 Aug 2020, 09:49

And you should really use a pull-up resistor (10k or 4k7 would be fine) on the button input gpio, the internal pull-up of the ESP is too weak to keep it firmly high if the button isn't pressed, so any induction across the wires may fake-push the button.
/Ton (PayPal.me)

Nemocaledonie
New user
Posts: 9
Joined: 11 Apr 2019, 02:18

Re: Ghost switch ??

#5 Post by Nemocaledonie » 18 Aug 2020, 12:38

@ epost : Sorry for the bad typo, bad copy / paste.
@Ath : Good idea for the resistance in external pull-up, I will do that. I thought the internal resistance was enough.
#TD-er : Thanks for the link ( I lost it :) ) ; I tried with different Wemo D1 mini Pro (V1.0.0), and always had the same result. The weird thing is, nothing happened until I used the "Rules".

Anyway, I'm going to try @Ath's method and put an additional 10K or 4.7K resistor (I have both). I'll let you know.

Thanks a lot. Have a good day.

Xavier

mrwee
Normal user
Posts: 225
Joined: 31 Aug 2016, 12:52

Re: Ghost switch ??

#6 Post by mrwee » 18 Aug 2020, 19:58

Ath wrote: 18 Aug 2020, 09:49 And you should really use a pull-up resistor (10k or 4k7 would be fine) on the button input gpio, the internal pull-up of the ESP is too weak to keep it firmly high if the button isn't pressed, so any induction across the wires may fake-push the button.
Thanks for that hint. I'm also experiencing a "nervous" D1 mini Pro which toggles an input after it's own mind :D . Have always used internal pull-up, but this time it's with a ~1m cable and a push-button.

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Ghost switch ??

#7 Post by TD-er » 18 Aug 2020, 23:43

Ah, you're experimenting with a very nice antenna mounted as GPIO random generator input :)

Nemocaledonie
New user
Posts: 9
Joined: 11 Apr 2019, 02:18

Re: Ghost switch ??

#8 Post by Nemocaledonie » 19 Aug 2020, 01:04

Problem solved: it was a small resistance problem :/
Thank you so much.
The only thing that I changed since yesterday apart from adding a resistor is that I use the D8 (GPIO 15) with a pull-down and adding a resistor of 4K7 (of course :)) because I noticed that the TTP223 mounted in pull-up (A closed) does not work permanently (it goes off and you just have to disconnect the ESP for it to restart). I did not find on the internet if it was normal so a little bit of soldering iron and hop in GPIO15. :)

Have a good day.

mrwee
Normal user
Posts: 225
Joined: 31 Aug 2016, 12:52

Re: Ghost switch ??

#9 Post by mrwee » 19 Aug 2020, 08:40

TD-er wrote: 18 Aug 2020, 23:43 Ah, you're experimenting with a very nice antenna mounted as GPIO random generator input :)
LOL

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 15 guests