a-lost-shadow / gosund-sw2

ESP Home Integration for Gosund SW2 Dimmer
GNU General Public License v2.0
12 stars 9 forks source link

Adjust brightness level before turning it on? (By hand) #1

Open jschwalbe opened 4 years ago

jschwalbe commented 4 years ago

Great code!! Thanks for making my switch work 👍

Is there a way to allow the user to adjust the brightness by hand before clicking it on?

Also - Are you planning on submitting this to the overall esphome project?

jschwalbe commented 4 years ago

I see a comment in the code:

    // Touch sensor only works when turned on

If that answers my question, please feel free to close this issue. :)

a-lost-shadow commented 4 years ago

I unfortunately never found a way to get the touch sensor working while turned off.

From the way it was behaving, I suspect inside the switch you have two components/MCUs. The esp8266 handling anything that needs wifi, and a separate component handling the touch sensor and dimmer output. The two of these communicate via UART. When turned on, the esp8266 will receive one or more messages for every touch. As soon as it's turned off, the esp8266 stops receiving any messages. I never played around with the gosund firmware to see if there was a way to have the brightness adjusted while off. If it can be done in their firmware, we'll need to somehow setup to sniff the serial communications to determine the command for toggling modes.

As for esphome integration. I got started on it, but ran into some trouble with the YAML processing part. I then put it on the back burner due to some ergo issues arising from working at home. Since it sounds like there's interest, I'll see if I can pick it back up.