HI, I need help with the ESP Config for my Panamalar Plugs. I used the config template from here. But that did not work after translating it to the GPIO Values. Also GPIO config from here did not work. But after using the default sample from here at the page bottom most of the plug worked. I could switch the relay on and off, the LED worked, ok the second was to much. So I removed the other LED, renamed it and that was ok.
But I tried to add an automation to make the physical button work to switch the relay on/off by hand. But I can not get it working, tried every open GPIO but nothing worked. Maybe my automation is wrong?
Sorry but your explanations are very confusing If you have found the good GPIO for the LED and the relay then it’s only an automation issue after ! Your logic for button is wrong, you should not use toggle like that ! I advise you to check cookbooks supplied on esphome as some of then are exactly your case
Makes a simple one instead of using all these substitutions at first to check how it reacts When you say relay and button were working, do you mean you had status correctly updated in HA when changing their state ?
Side note: toggle for two circuits like you did won’t work well as if one of the switch is not in expected state you’ll get the two relays in opposite state
Oki but you go against what you said previously about GPIO config being sure and only problem was logic !! So please first check your GPIO is fully accurate then start on automation ! If you try to do everything together you’ll spend triple time to debug it !
Also use regular name instead of using substitution everywhere, it’ll make it a lot easier to debug at begin !
That is the problem I can not check. The info from the linked websites about this plug is both not correct. So I do not know if I really have the correct GPIO for the button. I am looking for someone with this Plug who can help me with the GPIO for the button. If you check the config in my first post you can see that the GPIO config is different then in the links where this button is posted. But everything work expect the button.
Logger is your best friend debugging.
If you have a known working device, see how logging shows what you already know.
Anyway set logger level to debug, verbose or very_verbose, then when you press the button you should see some log about something happening, otherwise pin number is not correct.
Well then do some testing. Set up esphome to expose every GPIO as a button. Then observe which one reacts to the button press. Or do what @glmnet suggested and turn up your logging.
You are brave to say that online docs are incorrect when they are repeated in two places. Of course I do not discount the possibilty that the error might have carried through from one to the other.
Another possibility is that you do not actually have the same device, or that they have changed the device in a new release, but not told anyone (which is the same thing).