Mistake with the rules?

Moderators: Voyager, BertB, rtenklooster, Stuntteam, Martinus, grovkillen, TD-er

Post Reply
Message
Author
Friedrich Nietzsche
Normal user
Posts: 3
Joined: 12 Feb 2018, 19:22

Mistake with the rules?

#1 Post by Friedrich Nietzsche » 12 Feb 2018, 19:45

Hello guys,

after I bought my Google Home enabled light switches I noticed, that they send their stuff through a chinese cloud. This bothered me a lot, and so, after some googling I found this neat little software named Easyesp. After trying it out on a NodeMCU, I've decided, that this is the way to go. So far I like it very much. I made some progress, but now I got some problems, assuming it has something to do with the rules.

I am using some "Kesen" dual switches, namely KS-601, which are eqipped with an ESP 8285 (I plan to add them to the wiki). So far I've figured out, that the relays are sitting on pin 5 and 12, while the buttons are using pin 0 and 9. The wifi status led is sitting on pin 13.

I've created two tasks, touch0 and touch1, where I've assigned the according pins as input (see screenshots). My ruleset is looking like this

Code: Select all

 on touch0#switch do
  if [touch0#switch]=1
   gpio,12,1
  else
   gpio,12,0
  endif
 endon

 on touch1#switch do
  if [touch1#switch]=1
   gpio,5,1
  else
   gpio,5,0
  endif
 endon  
Although it seems pretty stright forward to me, I have the problem, that both switches switch also the other relay, where they are not assigned to. Most of the time it does not happen with the same trigger event but with the next one. So if touch 1 turns on relay 1, the next touch will turn relay 1 off, but relay 2 on. Similar happens, when I instead press the second touch button. It'd be awesome, if someone has an idea, whats going wrong here. Thanks!
Attachments
touch1.png
touch1.png (63.28 KiB) Viewed 824 times
touch0.png
touch0.png (64.08 KiB) Viewed 824 times

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Mistake with the rules?

#2 Post by grovkillen » 12 Feb 2018, 20:11

Try to add a number to the value names just to be sure no weird stuff is going on. (as a first test)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

kimot
Normal user
Posts: 66
Joined: 12 Oct 2017, 20:46

Re: Mistake with the rules?

#3 Post by kimot » 12 Feb 2018, 22:20

And what about "Internal PullUp" ?

Similar device here:
https://www.letscontrolit.com/wiki/inde ... noff_Touch

Domosapiens
Normal user
Posts: 126
Joined: 06 Nov 2016, 13:45

Re: Mistake with the rules?

#4 Post by Domosapiens » 12 Feb 2018, 22:45

Most of the time
points towards an unstable situation ....
the buttons are using pin 0 and 9
do they have an external pull-up resistor (around 100KOhm)?
If not, enable the Internal PullUp for GPIO-0 and GPIO-9 in the Switch input Tasks
18+ ESP units for production and test. Ranging from production control of heating equipment, floor sensing, floor thermostat to a "fun box" for my grandson. Mainly using Wemos D1.

Friedrich Nietzsche
Normal user
Posts: 3
Joined: 12 Feb 2018, 19:22

Re: Mistake with the rules?

#5 Post by Friedrich Nietzsche » 25 Feb 2018, 14:10

Hello guys, thanks for the replies, sorry for the delay, I had a busy week.

I've tried renaming variables and using the pullup resistors. Unfortunately this didn't help. I removed now the rule for the second push button. The strange behavior continues nevertheless: No matter which button I press, the pin specified in the rule to be switched reacts to pressing both buttons.

Friedrich Nietzsche
Normal user
Posts: 3
Joined: 12 Feb 2018, 19:22

Re: Mistake with the rules?

#6 Post by Friedrich Nietzsche » 25 Feb 2018, 14:40

Ok, problem seems to be solved. In my desperation I used a razor to scratch the area between the pins were I have soldered my wires to. Turns out I did a semi-optimal soldering job and there was a invisible conducting connection between two pins. Please don't laugh an thanks for the help :lol:
Last edited by Friedrich Nietzsche on 25 Feb 2018, 16:54, edited 1 time in total.

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Mistake with the rules?

#7 Post by grovkillen » 25 Feb 2018, 15:04

Happens to all of us, but please remember to start with inspecting the soldering first.... :(
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests