New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Yagusmart 1, 2 ad 3 gang switches #2488
Conversation
https://www.amazon.co.uk/gp/product/B086MV5MC8 These don't come with an esp8266 anymore, but can be trivially converted as the new chip is pin compatible. Note, GPIO15 needs to be connected to GND on 1 and 2 gang switches in order to enable the ESP to boot.
Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
Thanks! |
I have another thing that has come up in hacking these switches: They have relays in them that click even if all you wnt is to use it as a controller for, say. a smart bulb. I would suggest that, under switches, there be a checkbox that would tell espurna to not actually toggle a relay gpio, but only pretend, so that on a button action, a relay/x/set message is sent without an actual relay being energised. That would allow an easy choice between having a smart switch as a pure control device, or an actual switch. I could envision what can be done in the switch module to facilitate that, but I have no idea how to surface something like that in the web UI. However, it seems to be a vaild use case, at least for openhab. Do you have any pointers on how to do that? |
The way Xose originally implemented this is by introducing DUMMY switches and a global PROVIDER build flag so we could have RFBRIDGE toggle virtual relays on RF code arrival, and also send some RF codes when relay toggles. espurna/code/espurna/relay.cpp Line 463 in 0344260
espurna/code/espurna/relay.cpp Lines 408 to 421 in 0344260
espurna/code/espurna/relay.cpp Lines 582 to 596 in 0344260
current setting is a simple RelayProvider enum <-> integer cast e.g.
will no longer do anything with the associated GPIO edit espurna/code/espurna/relay.cpp Lines 194 to 205 in 0344260
|
But how to surface that in the UI? Sure, a telnet command is a good start, it means the groundwork is in place, but all the nontechnical users woudln't know about it. |
For the setting, see existing |
https://www.amazon.co.uk/gp/product/B086MV5MC8
These don't come with an esp8266 anymore, but can be trivially converted
as the new chip is pin compatible. Note, GPIO15 needs to be connected to
GND on 1 and 2 gang switches in order to enable the ESP to boot.
Older versions and some US models may still ship with ESP8266.
Caution, do NOT solder a serial port while the board is connected to the mains baseboard, it will blow your fuse and your USB! If you need to flash with a programmer, use a bench power supply on the logic board only!