Page 1 of 1

Mistake with the rules?

Posted: 12 Feb 2018, 19:45
by Friedrich Nietzsche
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!

Re: Mistake with the rules?

Posted: 12 Feb 2018, 20:11
by grovkillen
Try to add a number to the value names just to be sure no weird stuff is going on. (as a first test)

Re: Mistake with the rules?

Posted: 12 Feb 2018, 22:20
by kimot
And what about "Internal PullUp" ?

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

Re: Mistake with the rules?

Posted: 12 Feb 2018, 22:45
by Domosapiens
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

Re: Mistake with the rules?

Posted: 25 Feb 2018, 14:10
by Friedrich Nietzsche
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.

Re: Mistake with the rules?

Posted: 25 Feb 2018, 14:40
by Friedrich Nietzsche
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:

Re: Mistake with the rules?

Posted: 25 Feb 2018, 15:04
by grovkillen
Happens to all of us, but please remember to start with inspecting the soldering first.... :(