Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4991 lines
161 KiB

7 years ago
6 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
7 years ago
7 years ago
7 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // Required:
  6. //
  7. // MANUFACTURER: Name of the manufacturer of the board ("string")
  8. // DEVICE: Name of the device ("string")
  9. //
  10. // For example, some configuration options for BUTTON, RELAY and LED modules.
  11. // See general.h, defaults.h and types.h for all of the available flags.
  12. //
  13. // BUTTON[1-8]_CONFIG: Configuration mask (note that BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  14. // - BUTTON_PUSHBUTTON: button event is fired when released
  15. // - BUTTON_SWITCH: button event is fired when pressed or released
  16. // - BUTTON_DEFAULT_HIGH: there is a pull up in place, HIGH is default state
  17. // - BUTTON_DEFAULT_LOW: there is a pull down in place, LOW is default state
  18. // - BUTTON_DEFAULT_BOOT: use state that we read on firmware boot
  19. // - BUTTON_SET_PULLUP: set pullup by software
  20. // - BUTTON_SET_PULLDOWN: set pulldown by software (esp8266: only GPIO16)
  21. // BUTTON[1-8]_... actions: Check types.h for BUTTONx_ACTION_...
  22. // BUTTON[1-8]_PIN: GPIO for the n-th button (1-based, up to 8 buttons)
  23. // BUTTON[1-8]_PROVIDER: Check types.h for the BUTTON_PROVIDER_...
  24. // BUTTON[1-8]_RELAY: Relay number that will be bound to the n-th button (when ACTION is set to ON, OFF or TOGGLE; 1-based)
  25. //
  26. // RELAY[1-8]_PIN: GPIO for the n-th relay (1-based, up to 8 relays)
  27. // RELAY[1-8]_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  28. //
  29. // LED[1-8]_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  30. // LED[1-8]_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  31. // LED[1-8]_MODE: Check types.h for LED_MODE_...
  32. // LED[1-8]_RELAY: Linked relay (1-based)
  33. //
  34. // Besides, other hardware specific information should be stated here
  35. #pragma once
  36. // -----------------------------------------------------------------------------
  37. // Custom hardware
  38. // -----------------------------------------------------------------------------
  39. #if defined(MANUFACTURER) and defined(DEVICE)
  40. // user has defined custom hardware, no need to check anything else
  41. // -----------------------------------------------------------------------------
  42. // ESPurna Core
  43. // -----------------------------------------------------------------------------
  44. #elif defined(ESPURNA_CORE)
  45. // This is a special device targeted to generate a light-weight binary image
  46. // meant to be able to do two-step-updates:
  47. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  48. // Info
  49. #define MANUFACTURER "ESPURNA"
  50. #define DEVICE "CORE"
  51. // Disable non-core modules
  52. #define ALEXA_SUPPORT 0
  53. #define API_SUPPORT 0
  54. #define BROKER_SUPPORT 0
  55. #define DEBUG_SERIAL_SUPPORT 0
  56. #define DEBUG_TELNET_SUPPORT 0
  57. #define DEBUG_WEB_SUPPORT 0
  58. #define DOMOTICZ_SUPPORT 0
  59. #define HOMEASSISTANT_SUPPORT 0
  60. #define I2C_SUPPORT 0
  61. #define MQTT_SUPPORT 0
  62. #define NTP_SUPPORT 0
  63. #define RPN_RULES_SUPPORT 0
  64. #define SCHEDULER_SUPPORT 0
  65. #define SENSOR_SUPPORT 0
  66. #define THINGSPEAK_SUPPORT 0
  67. #define WEB_SUPPORT 0
  68. #define TELNET_AUTHENTICATION 0
  69. #define TELNET_STA 1
  70. // Extra light-weight image
  71. //#define BUTTON_SUPPORT 0 // don't need / have buttons
  72. //#define LED_SUPPORT 0 // don't need wifi indicator
  73. //#define RELAY_SUPPORT 0 // don't need to preserve pin state between resets
  74. //#define OTA_ARDUINOOTA_SUPPORT 0 // when only using `ota` command
  75. //#define MDNS_SERVER_SUPPORT 0 //
  76. //#define TELNET_SUPPORT 0 // when only using espota.py
  77. //#define TERMINAL_SUPPORT 0 //
  78. #elif defined(ESPURNA_CORE_WEBUI)
  79. // This is a special device with no specific hardware
  80. // with the basics to easily upgrade it to a device-specific image
  81. // Info
  82. #define MANUFACTURER "ESPURNA"
  83. #define DEVICE "CORE_WEBUI"
  84. // Disable non-core modules
  85. #define ALEXA_SUPPORT 0
  86. #define API_SUPPORT 0
  87. #define BROKER_SUPPORT 0
  88. #define DOMOTICZ_SUPPORT 0
  89. #define DEBUG_SERIAL_SUPPORT 0
  90. //#define DEBUG_TELNET_SUPPORT 0
  91. //#define DEBUG_WEB_SUPPORT 0
  92. #define HOMEASSISTANT_SUPPORT 0
  93. #define I2C_SUPPORT 0
  94. #define MQTT_SUPPORT 0
  95. #define NTP_SUPPORT 0
  96. #define SCHEDULER_SUPPORT 0
  97. #define SENSOR_SUPPORT 0
  98. #define THINGSPEAK_SUPPORT 0
  99. //#define WEB_SUPPORT 0
  100. #define WEB_FORCE_PASS_CHANGE 0
  101. #define TELNET_AUTHENTICATION 0
  102. #define TELNET_STA 1
  103. // Extra light-weight image
  104. #define BUTTON_SUPPORT 0
  105. #define LED_SUPPORT 0
  106. //#define MDNS_SERVER_SUPPORT 0
  107. //#define TELNET_SUPPORT 0
  108. //#define TERMINAL_SUPPORT 0
  109. // -----------------------------------------------------------------------------
  110. // Development boards
  111. // -----------------------------------------------------------------------------
  112. #elif defined(NODEMCU_LOLIN)
  113. // Info
  114. #define MANUFACTURER "NODEMCU"
  115. #define DEVICE "LOLIN"
  116. // Buttons
  117. #define BUTTON1_PIN 0
  118. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  119. #define BUTTON1_RELAY 1
  120. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  121. #define RELAY1_PIN 12
  122. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  123. // Light
  124. #define LED1_PIN 2
  125. #define LED1_PIN_INVERSE 1
  126. #elif defined(NODEMCU_BASIC)
  127. // Info
  128. // Generic NodeMCU Board without any buttons or relays connected.
  129. #define MANUFACTURER "NODEMCU"
  130. #define DEVICE "BASIC"
  131. #elif defined(WEMOS_D1_MINI)
  132. // Info
  133. #define MANUFACTURER "WEMOS"
  134. #define DEVICE "D1_MINI"
  135. // Buttons
  136. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  137. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  138. // it's the same as using a Wemos one button shield
  139. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  140. #define BUTTON1_RELAY 1
  141. // LEDs
  142. #define LED1_PIN 2
  143. #define LED1_PIN_INVERSE 1
  144. #define I2C_SDA_PIN 4 // D2
  145. #define I2C_SCL_PIN 5 // D1
  146. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  147. // Info
  148. #define MANUFACTURER "WEMOS"
  149. #define DEVICE "D1_MINI_RELAYSHIELD"
  150. // Buttons
  151. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  152. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  153. // it's the same as using a Wemos one button shield
  154. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  155. #define BUTTON1_RELAY 1
  156. // Relays
  157. #define RELAY1_PIN 5
  158. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  159. // LED
  160. #define LED1_PIN 2
  161. #define LED1_PIN_INVERSE 1
  162. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  163. // so I2C must be remapped to other pins
  164. #define I2C_SDA_PIN 12 // D6
  165. #define I2C_SCL_PIN 14 // D5
  166. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  167. // Info
  168. #define MANUFACTURER "WEMOS"
  169. #define DEVICE "D1_TARPUNA_SHIELD"
  170. // Relays
  171. #define RELAY1_PIN 5
  172. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  173. #define DHT_SUPPORT 1
  174. #define DHT_PIN 12
  175. // -----------------------------------------------------------------------------
  176. // ESPurna
  177. // -----------------------------------------------------------------------------
  178. #elif defined(TINKERMAN_ESPURNA_H06)
  179. // Info
  180. #define MANUFACTURER "TINKERMAN"
  181. #define DEVICE "ESPURNA_H06"
  182. // Buttons
  183. #define BUTTON1_PIN 4
  184. #define BUTTON1_RELAY 1
  185. // Normal pushbutton
  186. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  187. // Relays
  188. #define RELAY1_PIN 12
  189. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  190. // LEDs
  191. #define LED1_PIN 2
  192. #define LED1_PIN_INVERSE 1
  193. // HLW8012
  194. #ifndef HLW8012_SUPPORT
  195. #define HLW8012_SUPPORT 1
  196. #endif
  197. #define HLW8012_SEL_PIN 2
  198. #define HLW8012_CF1_PIN 13
  199. #define HLW8012_CF_PIN 14
  200. #elif defined(TINKERMAN_ESPURNA_H08)
  201. // Info
  202. #define MANUFACTURER "TINKERMAN"
  203. #define DEVICE "ESPURNA_H08"
  204. // Buttons
  205. #define BUTTON1_PIN 4
  206. #define BUTTON1_RELAY 1
  207. // Normal pushbutton
  208. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  209. // Relays
  210. #define RELAY1_PIN 12
  211. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  212. // LEDs
  213. #define LED1_PIN 2
  214. #define LED1_PIN_INVERSE 0
  215. // HLW8012
  216. #ifndef HLW8012_SUPPORT
  217. #define HLW8012_SUPPORT 1
  218. #endif
  219. #define HLW8012_SEL_PIN 5
  220. #define HLW8012_CF1_PIN 13
  221. #define HLW8012_CF_PIN 14
  222. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  223. // Info
  224. #define MANUFACTURER "TINKERMAN"
  225. #define DEVICE "ESPURNA_SWITCH"
  226. // Buttons
  227. #define BUTTON1_PIN 4
  228. #define BUTTON1_RELAY 1
  229. // Touch button
  230. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON
  231. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  232. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  233. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  234. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  235. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  236. // LEDs
  237. #define LED1_PIN 2
  238. #define LED1_PIN_INVERSE 0
  239. // Relays
  240. #define RELAY1_PIN 12
  241. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  242. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  243. #elif defined(TINKERMAN_RFM69GW)
  244. // Info
  245. #define MANUFACTURER "TINKERMAN"
  246. #define DEVICE "RFM69GW"
  247. // Buttons
  248. #define BUTTON1_PIN 0
  249. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  250. // RFM69GW
  251. #define RFM69_SUPPORT 1
  252. // Disable non-core modules
  253. #define ALEXA_SUPPORT 0
  254. #define DOMOTICZ_SUPPORT 0
  255. #define HOMEASSISTANT_SUPPORT 0
  256. #define I2C_SUPPORT 0
  257. #define SCHEDULER_SUPPORT 0
  258. #define SENSOR_SUPPORT 0
  259. #define THINGSPEAK_SUPPORT 0
  260. // -----------------------------------------------------------------------------
  261. // Itead Studio boards
  262. // -----------------------------------------------------------------------------
  263. #elif defined(ITEAD_SONOFF_BASIC)
  264. // Info
  265. #define MANUFACTURER "ITEAD"
  266. #define DEVICE "SONOFF_BASIC"
  267. // Buttons
  268. #define BUTTON1_PIN 0
  269. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  270. #define BUTTON1_RELAY 1
  271. #define BUTTON2_PIN 14
  272. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  273. #define BUTTON2_RELAY 1
  274. // Relays
  275. #define RELAY1_PIN 12
  276. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  277. // LEDs
  278. #define LED1_PIN 13
  279. #define LED1_PIN_INVERSE 1
  280. #elif defined(ITEAD_SONOFF_RF)
  281. // Info
  282. #define MANUFACTURER "ITEAD"
  283. #define DEVICE "SONOFF_RF"
  284. // Buttons
  285. #define BUTTON1_PIN 0
  286. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  287. #define BUTTON1_RELAY 1
  288. #define BUTTON2_PIN 14
  289. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  290. #define BUTTON2_RELAY 1
  291. // Relays
  292. #define RELAY1_PIN 12
  293. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  294. // LEDs
  295. #define LED1_PIN 13
  296. #define LED1_PIN_INVERSE 1
  297. #elif defined(ITEAD_SONOFF_MINI)
  298. // Info
  299. #define MANUFACTURER "ITEAD"
  300. #define DEVICE "SONOFF_MINI"
  301. // Buttons
  302. #define BUTTON1_PIN 0
  303. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  304. #define BUTTON1_RELAY 1
  305. #define BUTTON2_PIN 4
  306. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_BOOT
  307. #define BUTTON2_RELAY 1
  308. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  309. #define BUTTON2_RELEASE BUTTON_ACTION_TOGGLE
  310. // Relays
  311. #define RELAY1_PIN 12
  312. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  313. // LEDs
  314. #define LED1_PIN 13
  315. #define LED1_PIN_INVERSE 1
  316. #elif defined(ITEAD_SONOFF_TH)
  317. // Info
  318. #define MANUFACTURER "ITEAD"
  319. #define DEVICE "SONOFF_TH"
  320. // Buttons
  321. #define BUTTON1_PIN 0
  322. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  323. #define BUTTON1_RELAY 1
  324. // Relays
  325. #define RELAY1_PIN 12
  326. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  327. // LEDs
  328. #define LED1_PIN 13
  329. #define LED1_PIN_INVERSE 1
  330. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  331. #ifndef DALLAS_SUPPORT
  332. #define DALLAS_SUPPORT 1
  333. #endif
  334. #define DALLAS_PIN 14
  335. #ifndef DHT_SUPPORT
  336. #define DHT_SUPPORT 1
  337. #endif
  338. #define DHT_PIN 14
  339. #define DHT_TYPE DHT_CHIP_SI7021
  340. //#define I2C_SDA_PIN 4
  341. //#define I2C_SCL_PIN 14
  342. #elif defined(ITEAD_SONOFF_SV)
  343. // Info
  344. #define MANUFACTURER "ITEAD"
  345. #define DEVICE "SONOFF_SV"
  346. // Buttons
  347. #define BUTTON1_PIN 0
  348. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  349. #define BUTTON1_RELAY 1
  350. // Relays
  351. #define RELAY1_PIN 12
  352. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  353. // LEDs
  354. #define LED1_PIN 13
  355. #define LED1_PIN_INVERSE 1
  356. #elif defined(ITEAD_SLAMPHER)
  357. // Info
  358. #define MANUFACTURER "ITEAD"
  359. #define DEVICE "SLAMPHER"
  360. // Buttons
  361. #define BUTTON1_PIN 0
  362. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  363. #define BUTTON1_RELAY 1
  364. // Relays
  365. #define RELAY1_PIN 12
  366. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  367. // LEDs
  368. #define LED1_PIN 13
  369. #define LED1_PIN_INVERSE 1
  370. #elif defined(ITEAD_S20)
  371. // Info
  372. #define MANUFACTURER "ITEAD"
  373. #define DEVICE "S20"
  374. // Buttons
  375. #define BUTTON1_PIN 0
  376. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  377. #define BUTTON1_RELAY 1
  378. // Relays
  379. #define RELAY1_PIN 12
  380. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  381. // LEDs
  382. #define LED1_PIN 13
  383. #define LED1_PIN_INVERSE 1
  384. #elif defined(ITEAD_SONOFF_TOUCH)
  385. // Info
  386. #define MANUFACTURER "ITEAD"
  387. #define DEVICE "SONOFF_TOUCH"
  388. // Buttons
  389. #define BUTTON1_PIN 0
  390. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  391. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  392. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  393. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  394. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  395. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  396. #define BUTTON1_RELAY 1
  397. // Relays
  398. #define RELAY1_PIN 12
  399. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  400. // LEDs
  401. #define LED1_PIN 13
  402. #define LED1_PIN_INVERSE 1
  403. #elif defined(ITEAD_SONOFF_POW)
  404. // Info
  405. #define MANUFACTURER "ITEAD"
  406. #define DEVICE "SONOFF_POW"
  407. // Buttons
  408. #define BUTTON1_PIN 0
  409. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  410. #define BUTTON1_RELAY 1
  411. // Relays
  412. #define RELAY1_PIN 12
  413. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  414. // LEDs
  415. #define LED1_PIN 15
  416. #define LED1_PIN_INVERSE 0
  417. // HLW8012
  418. #ifndef HLW8012_SUPPORT
  419. #define HLW8012_SUPPORT 1
  420. #endif
  421. #define HLW8012_SEL_PIN 5
  422. #define HLW8012_CF1_PIN 13
  423. #define HLW8012_CF_PIN 14
  424. #elif defined(ITEAD_SONOFF_POW_R2)
  425. // Info
  426. #define MANUFACTURER "ITEAD"
  427. #define DEVICE "SONOFF_POW_R2"
  428. // Buttons
  429. #define BUTTON1_PIN 0
  430. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  431. #define BUTTON1_RELAY 1
  432. // Relays
  433. #define RELAY1_PIN 12
  434. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  435. // LEDs
  436. #define LED1_PIN 13
  437. #define LED1_PIN_INVERSE 1
  438. // Disable UART noise
  439. #define DEBUG_SERIAL_SUPPORT 0
  440. // CSE7766
  441. #ifndef CSE7766_SUPPORT
  442. #define CSE7766_SUPPORT 1
  443. #endif
  444. #define CSE7766_RX_PIN 3
  445. #elif defined(ITEAD_SONOFF_DUAL)
  446. // Info
  447. #define MANUFACTURER "ITEAD"
  448. #define DEVICE "SONOFF_DUAL"
  449. #define SERIAL_BAUDRATE 19230
  450. // LEDs
  451. #define LED1_PIN 13
  452. #define LED1_PIN_INVERSE 1
  453. // Relays
  454. #define RELAY_PROVIDER_DUAL_SUPPORT 1
  455. #define RELAY1_PROVIDER RELAY_PROVIDER_DUAL
  456. #define RELAY2_PROVIDER RELAY_PROVIDER_DUAL
  457. // No need to include generic GPIO support
  458. // "Buttons" are attached to a secondary MCU and RELAY_PROVIDER_DUAL handles that
  459. #define BUTTON_PROVIDER_GPIO_SUPPORT 0
  460. // Conflicts with relay operation
  461. #define DEBUG_SERIAL_SUPPORT 0
  462. #elif defined(ITEAD_SONOFF_DUAL_R2)
  463. #define MANUFACTURER "ITEAD"
  464. #define DEVICE "SONOFF_DUAL_R2"
  465. // Buttons
  466. #define BUTTON1_PIN 0 // Button 0 on header
  467. #define BUTTON2_PIN 9 // Button 1 on header
  468. #define BUTTON3_PIN 10 // Physical button
  469. #define BUTTON1_RELAY 1
  470. #define BUTTON2_RELAY 2
  471. #define BUTTON3_RELAY 1
  472. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  473. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  474. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  475. // Relays
  476. #define RELAY1_PIN 12
  477. #define RELAY2_PIN 5
  478. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  479. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  480. // LEDs
  481. #define LED1_PIN 13
  482. #define LED1_PIN_INVERSE 1
  483. #elif defined(ITEAD_SONOFF_4CH)
  484. // Info
  485. #define MANUFACTURER "ITEAD"
  486. #define DEVICE "SONOFF_4CH"
  487. // Buttons
  488. #define BUTTON1_PIN 0
  489. #define BUTTON2_PIN 9
  490. #define BUTTON3_PIN 10
  491. #define BUTTON4_PIN 14
  492. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  493. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  494. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  495. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  496. #define BUTTON1_RELAY 1
  497. #define BUTTON2_RELAY 2
  498. #define BUTTON3_RELAY 3
  499. #define BUTTON4_RELAY 4
  500. // Relays
  501. #define RELAY1_PIN 12
  502. #define RELAY2_PIN 5
  503. #define RELAY3_PIN 4
  504. #define RELAY4_PIN 15
  505. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  506. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  507. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  508. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  509. // LEDs
  510. #define LED1_PIN 13
  511. #define LED1_PIN_INVERSE 1
  512. #elif defined(ITEAD_SONOFF_4CH_PRO)
  513. // Info
  514. #define MANUFACTURER "ITEAD"
  515. #define DEVICE "SONOFF_4CH_PRO"
  516. // Buttons
  517. #define BUTTON1_PIN 0
  518. #define BUTTON2_PIN 9
  519. #define BUTTON3_PIN 10
  520. #define BUTTON4_PIN 14
  521. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  522. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  523. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  524. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  525. #define BUTTON1_RELAY 1
  526. #define BUTTON2_RELAY 2
  527. #define BUTTON3_RELAY 3
  528. #define BUTTON4_RELAY 4
  529. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  530. // buttons and relays, but it also forwards button presses to the ESP8285.
  531. // This allows ESPurna to handle button presses -almost- the same way
  532. // as with other devices except:
  533. // * Double click seems to break/disable the button on the STM32 side
  534. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  535. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  536. // and you click on another relay button, the STM32 sends a "press"
  537. // event for the button of the first relay (to turn it OFF) but it
  538. // does not send a "release" event. It's like it's holding the
  539. // button down since you can see it is still LOW.
  540. // Whatever reason the result is that it may actually perform a
  541. // long click or long-long click.
  542. // The configuration below make the button toggle the relay on press events
  543. // and disables any possibly harmful combination with S6 set to 0.
  544. // If you are sure you will only use S6 to 1 you can comment the
  545. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  546. // reset mode and factory reset functionalities, or link other actions like
  547. // AP mode in the commented line below.
  548. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  549. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  550. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  551. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  552. //#define BUTTON1_LNGCLICK BUTTON_ACTION_AP
  553. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  554. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  555. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  556. #define BUTTON3_PRESS BUTTON_ACTION_TOGGLE
  557. #define BUTTON3_CLICK BUTTON_ACTION_NONE
  558. #define BUTTON4_PRESS BUTTON_ACTION_TOGGLE
  559. #define BUTTON4_CLICK BUTTON_ACTION_NONE
  560. // Relays
  561. #define RELAY1_PIN 12
  562. #define RELAY2_PIN 5
  563. #define RELAY3_PIN 4
  564. #define RELAY4_PIN 15
  565. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  566. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  567. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  568. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  569. // LEDs
  570. #define LED1_PIN 13
  571. #define LED1_PIN_INVERSE 1
  572. #elif defined(ITEAD_1CH_INCHING)
  573. // The inching functionality is managed by a misterious IC in the board.
  574. // You cannot control the inching button and functionality from the ESP8266
  575. // Besides, enabling the inching functionality using the hardware button
  576. // will result in the relay switching on and off continuously.
  577. // Fortunately the unkown IC keeps memory of the hardware inching status
  578. // so you can just disable it and forget. The inching LED must be lit.
  579. // You can still use the pulse options from the web interface
  580. // without problem.
  581. // Info
  582. #define MANUFACTURER "ITEAD"
  583. #define DEVICE "1CH_INCHING"
  584. // Buttons
  585. #define BUTTON1_PIN 0
  586. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  587. #define BUTTON1_RELAY 1
  588. // Relays
  589. #define RELAY1_PIN 12
  590. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  591. // LEDs
  592. #define LED1_PIN 13
  593. #define LED1_PIN_INVERSE 1
  594. #elif defined(ITEAD_MOTOR)
  595. // Info
  596. #define MANUFACTURER "ITEAD"
  597. #define DEVICE "MOTOR"
  598. // Buttons
  599. #define BUTTON1_PIN 0
  600. #define BUTTON1_RELAY 1
  601. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  602. // Relays
  603. #define RELAY1_PIN 12
  604. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  605. // LEDs
  606. #define LED1_PIN 13
  607. #define LED1_PIN_INVERSE 1
  608. #elif defined(ITEAD_BNSZ01)
  609. // Info
  610. #define MANUFACTURER "ITEAD"
  611. #define DEVICE "BNSZ01"
  612. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  613. // LEDs
  614. #define LED1_PIN 13
  615. #define LED1_PIN_INVERSE 1
  616. // Light
  617. #define LIGHT_CH1_PIN 12
  618. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  619. // Info
  620. #define MANUFACTURER "ITEAD"
  621. #define DEVICE "SONOFF_RFBRIDGE"
  622. // Number of virtual switches
  623. #ifndef DUMMY_RELAY_COUNT
  624. #define DUMMY_RELAY_COUNT 8
  625. #endif
  626. // Buttons
  627. #define BUTTON1_PIN 0
  628. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  629. // LEDs
  630. #define LED1_PIN 13
  631. #define LED1_PIN_INVERSE 1
  632. #define RFB_SUPPORT 1
  633. // When using un-modified harware, ESPurna communicates with the secondary
  634. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  635. // the port and remove UART noise on serial line
  636. #ifndef RFB_PROVIDER
  637. #define RFB_PROVIDER RFB_PROVIDER_EFM8BB1
  638. #endif
  639. #ifndef DEBUG_SERIAL_SUPPORT
  640. #define DEBUG_SERIAL_SUPPORT 0
  641. #endif
  642. #define SERIAL_BAUDRATE 19200
  643. // Only used when RFB_PROVIDER is RCSWITCH
  644. #define RFB_RX_PIN 4
  645. #define RFB_TX_PIN 5
  646. #elif defined(ITEAD_SONOFF_B1)
  647. // Info
  648. #define MANUFACTURER "ITEAD"
  649. #define DEVICE "SONOFF_B1"
  650. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  651. // Light
  652. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  653. #define MY92XX_CHIPS 2
  654. #define MY92XX_DI_PIN 12
  655. #define MY92XX_DCKI_PIN 14
  656. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  657. #define MY92XX_CHANNELS 5
  658. #define MY92XX_CH1 4
  659. #define MY92XX_CH2 3
  660. #define MY92XX_CH3 5
  661. #define MY92XX_CH4 0
  662. #define MY92XX_CH5 1
  663. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  664. #elif defined(ITEAD_SONOFF_LED)
  665. // Info
  666. #define MANUFACTURER "ITEAD"
  667. #define DEVICE "SONOFF_LED"
  668. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  669. // LEDs
  670. #define LED1_PIN 13
  671. #define LED1_PIN_INVERSE 1
  672. // Light
  673. #define LIGHT_CH1_PIN 12 // Cold white
  674. #define LIGHT_CH2_PIN 14 // Warm white
  675. #elif defined(ITEAD_SONOFF_T1_1CH)
  676. // Info
  677. #define MANUFACTURER "ITEAD"
  678. #define DEVICE "SONOFF_T1_1CH"
  679. // Buttons
  680. #define BUTTON1_PIN 0
  681. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  682. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  683. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  684. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  685. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  686. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  687. #define BUTTON1_RELAY 1
  688. // Relays
  689. #define RELAY1_PIN 12
  690. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  691. // LEDs
  692. #define LED1_PIN 13
  693. #define LED1_PIN_INVERSE 1
  694. #elif defined(ITEAD_SONOFF_T1_2CH)
  695. // Info
  696. #define MANUFACTURER "ITEAD"
  697. #define DEVICE "SONOFF_T1_2CH"
  698. // Buttons
  699. #define BUTTON1_PIN 0
  700. #define BUTTON2_PIN 9
  701. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  702. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  703. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  704. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  705. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  706. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  707. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  708. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  709. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  710. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  711. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  712. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  713. #define BUTTON1_RELAY 1
  714. #define BUTTON2_RELAY 2
  715. // Relays
  716. #define RELAY1_PIN 12
  717. #define RELAY2_PIN 5
  718. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  719. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  720. // LEDs
  721. #define LED1_PIN 13
  722. #define LED1_PIN_INVERSE 1
  723. #elif defined(ITEAD_SONOFF_T1_3CH)
  724. // Info
  725. #define MANUFACTURER "ITEAD"
  726. #define DEVICE "SONOFF_T1_3CH"
  727. // Buttons
  728. #define BUTTON1_PIN 0
  729. #define BUTTON2_PIN 9
  730. #define BUTTON3_PIN 10
  731. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  732. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  733. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  734. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  735. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  736. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  737. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  738. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  739. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  740. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  741. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  742. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  743. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  744. #define BUTTON3_PRESS BUTTON_ACTION_TOGGLE
  745. #define BUTTON3_CLICK BUTTON_ACTION_NONE
  746. #define BUTTON3_DBLCLICK BUTTON_ACTION_NONE
  747. #define BUTTON3_LNGCLICK BUTTON_ACTION_NONE
  748. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_RESET
  749. #define BUTTON1_RELAY 1
  750. #define BUTTON2_RELAY 2
  751. #define BUTTON3_RELAY 3
  752. // Relays
  753. #define RELAY1_PIN 12
  754. #define RELAY2_PIN 5
  755. #define RELAY3_PIN 4
  756. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  757. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  758. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  759. // LEDs
  760. #define LED1_PIN 13
  761. #define LED1_PIN_INVERSE 1
  762. #elif defined(ITEAD_SONOFF_S31)
  763. // Info
  764. #define MANUFACTURER "ITEAD"
  765. #define DEVICE "SONOFF_S31"
  766. // Buttons
  767. #define BUTTON1_PIN 0
  768. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  769. #define BUTTON1_RELAY 1
  770. // Relays
  771. #define RELAY1_PIN 12
  772. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  773. // LEDs
  774. #define LED1_PIN 13
  775. #define LED1_PIN_INVERSE 1
  776. // Disable UART noise
  777. #define DEBUG_SERIAL_SUPPORT 0
  778. // CSE7766
  779. #define CSE7766_SUPPORT 1
  780. #define CSE7766_RX_PIN 3
  781. #elif defined(ITEAD_SONOFF_S31_LITE)
  782. // Info
  783. #define MANUFACTURER "ITEAD"
  784. #define DEVICE "SONOFF_S31_LITE"
  785. // Buttons
  786. #define BUTTON1_PIN 0
  787. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  788. #define BUTTON1_RELAY 1
  789. // Relays
  790. #define RELAY1_PIN 12
  791. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  792. // LEDs
  793. #define LED1_PIN 13
  794. #define LED1_PIN_INVERSE 1
  795. #elif defined(ITEAD_SONOFF_IFAN02)
  796. // Info
  797. #define MANUFACTURER "ITEAD"
  798. #define DEVICE "SONOFF_IFAN02"
  799. // Base module
  800. #define IFAN_SUPPORT 1
  801. // These buttons are triggered by the remote
  802. // Fan module adds a custom button handler and a special relay controlling the speed
  803. #define BUTTON1_PIN 0
  804. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  805. #define BUTTON2_PIN 9
  806. #define BUTTON2_CLICK BUTTON_ACTION_FAN_LOW
  807. #define BUTTON3_PIN 10
  808. #define BUTTON3_CLICK BUTTON_ACTION_FAN_MEDIUM
  809. #define BUTTON4_PIN 14
  810. #define BUTTON4_CLICK BUTTON_ACTION_FAN_HIGH
  811. // LEDs
  812. #define LED1_PIN 13
  813. #define LED1_PIN_INVERSE 1
  814. // -----------------------------------------------------------------------------
  815. // ORVIBO
  816. // -----------------------------------------------------------------------------
  817. #elif defined(ORVIBO_B25)
  818. // Info
  819. #define MANUFACTURER "ORVIBO"
  820. #define DEVICE "B25"
  821. // Buttons
  822. #define BUTTON1_PIN 14
  823. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  824. #define BUTTON1_RELAY 1
  825. // Relays
  826. #define RELAY1_PIN 5
  827. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  828. // LEDs
  829. #define LED1_PIN 12 // 4 blue led
  830. #define LED1_PIN_INVERSE 1
  831. #define LED2_PIN 4 // 12 red led
  832. #define LED2_PIN_INVERSE 1
  833. // -----------------------------------------------------------------------------
  834. // YJZK
  835. // -----------------------------------------------------------------------------
  836. #elif defined(YJZK_SWITCH_1CH)
  837. // Info
  838. #define MANUFACTURER "YJZK"
  839. #define DEVICE "SWITCH_1CH"
  840. // Buttons
  841. #define BUTTON1_PIN 0
  842. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  843. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  844. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  845. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  846. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  847. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  848. #define BUTTON1_RELAY 1
  849. // Relays
  850. #define RELAY1_PIN 12
  851. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  852. // LEDs
  853. #define LED1_PIN 13
  854. #define LED1_PIN_INVERSE 0
  855. #elif defined(YJZK_SWITCH_2CH)
  856. // Info
  857. #define MANUFACTURER "YJZK"
  858. #define DEVICE "SWITCH_2CH"
  859. // Buttons
  860. #define BUTTON1_PIN 0
  861. #define BUTTON2_PIN 9
  862. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  863. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  864. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  865. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  866. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  867. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  868. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  869. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  870. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  871. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  872. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  873. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  874. #define BUTTON1_RELAY 1
  875. #define BUTTON2_RELAY 2
  876. // Relays
  877. #define RELAY1_PIN 12
  878. #define RELAY2_PIN 5
  879. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  880. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  881. // LEDs
  882. #define LED1_PIN 13
  883. #define LED1_PIN_INVERSE 0
  884. // YJZK 3CH switch
  885. // Also Lixin Touch Wifi 3M
  886. #elif defined(YJZK_SWITCH_3CH)
  887. // Info
  888. #define MANUFACTURER "YJZK"
  889. #define DEVICE "SWITCH_3CH"
  890. // Buttons
  891. #define BUTTON1_PIN 0
  892. #define BUTTON2_PIN 9
  893. #define BUTTON3_PIN 10
  894. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  895. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  896. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  897. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  898. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  899. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  900. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  901. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  902. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  903. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  904. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  905. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  906. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  907. #define BUTTON3_PRESS BUTTON_ACTION_TOGGLE
  908. #define BUTTON3_CLICK BUTTON_ACTION_NONE
  909. #define BUTTON3_DBLCLICK BUTTON_ACTION_NONE
  910. #define BUTTON3_LNGCLICK BUTTON_ACTION_NONE
  911. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_RESET
  912. #define BUTTON1_RELAY 1
  913. #define BUTTON2_RELAY 2
  914. #define BUTTON3_RELAY 3
  915. // Relays
  916. #define RELAY1_PIN 12
  917. #define RELAY2_PIN 5
  918. #define RELAY3_PIN 4
  919. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  920. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  921. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  922. // LEDs
  923. #define LED1_PIN 13
  924. #define LED1_PIN_INVERSE 0
  925. // -----------------------------------------------------------------------------
  926. // Electrodragon boards
  927. // -----------------------------------------------------------------------------
  928. #elif defined(ELECTRODRAGON_WIFI_IOT)
  929. // Info
  930. #define MANUFACTURER "ELECTRODRAGON"
  931. #define DEVICE "WIFI_IOT"
  932. // Buttons
  933. #define BUTTON1_PIN 0
  934. #define BUTTON2_PIN 2
  935. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  936. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  937. #define BUTTON1_RELAY 1
  938. #define BUTTON2_RELAY 2
  939. // Relays
  940. #define RELAY1_PIN 12
  941. #define RELAY2_PIN 13
  942. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  943. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  944. // LEDs
  945. #define LED1_PIN 16
  946. #define LED1_PIN_INVERSE 0
  947. // -----------------------------------------------------------------------------
  948. // WorkChoice ecoPlug
  949. // -----------------------------------------------------------------------------
  950. #elif defined(WORKCHOICE_ECOPLUG)
  951. // Info
  952. #define MANUFACTURER "WORKCHOICE"
  953. #define DEVICE "ECOPLUG"
  954. // Buttons
  955. #define BUTTON1_PIN 13
  956. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  957. #define BUTTON1_RELAY 1
  958. // Relays
  959. #define RELAY1_PIN 15
  960. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  961. // LEDs
  962. #define LED1_PIN 2
  963. #define LED1_PIN_INVERSE 0
  964. // -----------------------------------------------------------------------------
  965. // AI Thinker
  966. // -----------------------------------------------------------------------------
  967. #elif defined(AITHINKER_AI_LIGHT)
  968. // Info
  969. #define MANUFACTURER "AITHINKER"
  970. #define DEVICE "AI_LIGHT"
  971. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  972. // Light
  973. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  974. #define MY92XX_CHIPS 1
  975. #define MY92XX_DI_PIN 13
  976. #define MY92XX_DCKI_PIN 15
  977. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  978. #define MY92XX_CHANNELS 4
  979. // -----------------------------------------------------------------------------
  980. // Lyasi LED
  981. // -----------------------------------------------------------------------------
  982. #elif defined(LYASI_LIGHT)
  983. // Info
  984. #define MANUFACTURER "LYASI"
  985. #define DEVICE "RGB_LED"
  986. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  987. // Light
  988. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  989. #define MY92XX_CHIPS 1
  990. #define MY92XX_DI_PIN 4
  991. #define MY92XX_DCKI_PIN 5
  992. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  993. #define MY92XX_CHANNELS 4
  994. // -----------------------------------------------------------------------------
  995. // LED Controller
  996. // -----------------------------------------------------------------------------
  997. #elif defined(MAGICHOME_LED_CONTROLLER)
  998. // Info
  999. #define MANUFACTURER "MAGICHOME"
  1000. #define DEVICE "LED_CONTROLLER"
  1001. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1002. // LEDs
  1003. #define LED1_PIN 2
  1004. #define LED1_PIN_INVERSE 1
  1005. // Light
  1006. #define LIGHT_CH1_PIN 14 // RED
  1007. #define LIGHT_CH2_PIN 5 // GREEN
  1008. #define LIGHT_CH3_PIN 12 // BLUE
  1009. #define LIGHT_CH4_PIN 13 // WHITE
  1010. // IR
  1011. #define IR_SUPPORT 1
  1012. #define IR_RX_PIN 4
  1013. #define IR_BUTTON_SET 1
  1014. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  1015. // Info
  1016. #define MANUFACTURER "MAGICHOME"
  1017. #define DEVICE "LED_CONTROLLER_20"
  1018. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1019. // LEDs
  1020. #define LED1_PIN 2
  1021. #define LED1_PIN_INVERSE 1
  1022. // Light
  1023. #define LIGHT_CH1_PIN 5 // RED
  1024. #define LIGHT_CH2_PIN 12 // GREEN
  1025. #define LIGHT_CH3_PIN 13 // BLUE
  1026. #define LIGHT_CH4_PIN 15 // WHITE
  1027. // IR
  1028. #define IR_SUPPORT 1
  1029. #define IR_RX_PIN 4
  1030. #define IR_BUTTON_SET 1
  1031. #elif defined(MAGICHOME_ZJ_WFMN_A_11)
  1032. // Info
  1033. #define MANUFACTURER "MAGICHOME"
  1034. #define DEVICE "ZJ_WFMN_A_11"
  1035. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1036. // LEDs
  1037. #define LED1_PIN 2
  1038. #define LED1_PIN_INVERSE 1
  1039. #define LED2_PIN 15
  1040. #define LED2_PIN_INVERSE 1
  1041. // Light
  1042. #define LIGHT_CH1_PIN 12 // RED
  1043. #define LIGHT_CH2_PIN 5 // GREEN
  1044. #define LIGHT_CH3_PIN 13 // BLUE
  1045. #define LIGHT_CH4_PIN 14 // WHITE
  1046. // IR
  1047. #define IR_SUPPORT 1
  1048. #define IR_RX_PIN 4
  1049. #define IR_BUTTON_SET 1
  1050. #elif defined(MAGICHOME_ZJ_WFMN_B_11)
  1051. // Info
  1052. #define MANUFACTURER "MAGICHOME"
  1053. #define DEVICE "ZJ_WFMN_B_11"
  1054. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1055. // LEDs
  1056. #define LED1_PIN 2
  1057. #define LED1_PIN_INVERSE 1
  1058. #define LED2_PIN 15
  1059. #define LED2_PIN_INVERSE 1
  1060. // Light
  1061. #define LIGHT_CH1_PIN 14 // RED
  1062. #define LIGHT_CH2_PIN 5 // GREEN
  1063. #define LIGHT_CH3_PIN 12 // BLUE
  1064. #define LIGHT_CH4_PIN 13 // WHITE
  1065. // RF
  1066. #define RFB_SUPPORT 1
  1067. #define RFB_PROVIDER RFB_PROVIDER_RCSWITCH
  1068. #define RFB_RX_PIN 4
  1069. #elif defined(MAGICHOME_ZJ_WFMN_C_11)
  1070. // Info
  1071. #define MANUFACTURER "MAGICHOME"
  1072. #define DEVICE "ZJ_WFMN_C_11"
  1073. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1074. // Buttons
  1075. #define BUTTON1_PIN 0
  1076. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1077. #define BUTTON1_RELAY 1
  1078. // LEDs
  1079. #define LED1_PIN 2
  1080. #define LED1_PIN_INVERSE 1
  1081. // Light
  1082. #define LIGHT_CH1_PIN 12 // WHITE
  1083. #elif defined(MAGICHOME_ZJ_ESPM_5CH_B_13)
  1084. // Info
  1085. #define MANUFACTURER "MAGICHOME"
  1086. #define DEVICE "ZJ_ESPM_5CH_B_13"
  1087. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1088. // Buttons
  1089. #define BUTTON1_PIN 0
  1090. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1091. #define BUTTON1_RELAY 1
  1092. // LEDs
  1093. #define LED1_PIN 2
  1094. #define LED1_PIN_INVERSE 1
  1095. // Light
  1096. #define LIGHT_CH1_PIN 14 // RED
  1097. #define LIGHT_CH2_PIN 12 // GREEN
  1098. #define LIGHT_CH3_PIN 13 // BLUE
  1099. #define LIGHT_CH4_PIN 5 // COLD WHITE
  1100. #define LIGHT_CH5_PIN 15 // WARM WHITE
  1101. #elif defined(MAGICHOME_ZJ_LB_RGBWW_L)
  1102. // Info
  1103. #define MANUFACTURER "MAGICHOME"
  1104. #define DEVICE "ZJ_LB_RGBWW_L"
  1105. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1106. // Light
  1107. #define LIGHT_CH1_PIN 5 // RED
  1108. #define LIGHT_CH2_PIN 4 // GREEN
  1109. #define LIGHT_CH3_PIN 14 // BLUE
  1110. #define LIGHT_CH4_PIN 12 // COLD WHITE
  1111. #define LIGHT_CH5_PIN 13 // WARM WHITE
  1112. // -----------------------------------------------------------------------------
  1113. // HUACANXING H801 & H802
  1114. // -----------------------------------------------------------------------------
  1115. #elif defined(HUACANXING_H801)
  1116. // Info
  1117. #define MANUFACTURER "HUACANXING"
  1118. #define DEVICE "H801"
  1119. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1120. #define DEBUG_PORT Serial1
  1121. #define SERIAL_RX_ENABLED 1
  1122. // LEDs
  1123. #define LED1_PIN 5
  1124. #define LED1_PIN_INVERSE 1
  1125. // Light
  1126. #define LIGHT_CH1_PIN 15 // RED
  1127. #define LIGHT_CH2_PIN 13 // GREEN
  1128. #define LIGHT_CH3_PIN 12 // BLUE
  1129. #define LIGHT_CH4_PIN 14 // WHITE1
  1130. #define LIGHT_CH5_PIN 4 // WHITE2
  1131. #elif defined(HUACANXING_H802)
  1132. // Info
  1133. #define MANUFACTURER "HUACANXING"
  1134. #define DEVICE "H802"
  1135. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1136. #define DEBUG_PORT Serial1
  1137. #define SERIAL_RX_ENABLED 1
  1138. // Light
  1139. #define LIGHT_CH1_PIN 12 // RED
  1140. #define LIGHT_CH2_PIN 14 // GREEN
  1141. #define LIGHT_CH3_PIN 13 // BLUE
  1142. #define LIGHT_CH4_PIN 15 // WHITE
  1143. // -----------------------------------------------------------------------------
  1144. // HUGOAI AWP02L-N
  1145. // Pin equivalence extracted from https://templates.blakadder.com/hugoai_awp02l-n.html
  1146. //
  1147. // It follows almost same structure as AOYCOCR X5P with only 1 LED on GPIO02
  1148. //
  1149. // -----------------------------------------------------------------------------
  1150. #elif defined(HUGOAI_AWP02L_N)
  1151. #define MANUFACTURER "HUGOAI"
  1152. #define DEVICE "AWP02L_N"
  1153. // Buttons
  1154. #define BUTTON1_PIN 13
  1155. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1156. #define BUTTON1_RELAY 1
  1157. // the defaults are reasonable, but you can change them as desired
  1158. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  1159. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  1160. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  1161. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  1162. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  1163. // Relays
  1164. #define RELAY1_PIN 15
  1165. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1166. // LEDs
  1167. // LED1 (blue) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  1168. // so that the LED lights the button when 'off' so it can be found easily.
  1169. #define LED1_PIN 2
  1170. #define LED1_PIN_INVERSE 1
  1171. #define LED1_MODE LED_MODE_FOLLOW
  1172. #define LED1_RELAY 1
  1173. // -----------------------------------------------------------------------------
  1174. // Jan Goedeke Wifi Relay
  1175. // https://github.com/JanGoe/esp8266-wifi-relay
  1176. // -----------------------------------------------------------------------------
  1177. #elif defined(JANGOE_WIFI_RELAY_NC)
  1178. // Info
  1179. #define MANUFACTURER "JANGOE"
  1180. #define DEVICE "WIFI_RELAY_NC"
  1181. // Buttons
  1182. #define BUTTON1_PIN 12
  1183. #define BUTTON2_PIN 13
  1184. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1185. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1186. #define BUTTON1_RELAY 1
  1187. #define BUTTON2_RELAY 2
  1188. // Relays
  1189. #define RELAY1_PIN 2
  1190. #define RELAY2_PIN 14
  1191. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1192. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1193. #elif defined(JANGOE_WIFI_RELAY_NO)
  1194. // Info
  1195. #define MANUFACTURER "JANGOE"
  1196. #define DEVICE "WIFI_RELAY_NO"
  1197. // Buttons
  1198. #define BUTTON1_PIN 12
  1199. #define BUTTON2_PIN 13
  1200. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1201. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1202. #define BUTTON1_RELAY 1
  1203. #define BUTTON2_RELAY 2
  1204. // Relays
  1205. #define RELAY1_PIN 2
  1206. #define RELAY2_PIN 14
  1207. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1208. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1209. // -----------------------------------------------------------------------------
  1210. // Jorge García Wifi+Relays Board Kit
  1211. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1212. // https://github.com/jorgegarciadev/wifikit
  1213. // -----------------------------------------------------------------------------
  1214. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1215. // Info
  1216. #define MANUFACTURER "JORGEGARCIA"
  1217. #define DEVICE "WIFI_RELAYS"
  1218. // Relays
  1219. #define RELAY1_PIN 0
  1220. #define RELAY2_PIN 2
  1221. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1222. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1223. // -----------------------------------------------------------------------------
  1224. // WiFi MQTT Relay / Thermostat
  1225. // -----------------------------------------------------------------------------
  1226. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1227. // Info
  1228. #define MANUFACTURER "OPENENERGYMONITOR"
  1229. #define DEVICE "MQTT_RELAY"
  1230. // Buttons
  1231. #define BUTTON1_PIN 0
  1232. #define BUTTON1_RELAY 1
  1233. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1234. // Relays
  1235. #define RELAY1_PIN 12
  1236. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1237. // LEDs
  1238. #define LED1_PIN 16
  1239. #define LED1_PIN_INVERSE 0
  1240. // -----------------------------------------------------------------------------
  1241. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1242. // https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50050-Indoor-Wi-Fi-Outlet-Wireless-Switch-Programmable-Timer-%2F263112281551
  1243. // https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50055-Indoor-Wi-Fi-Wall-Tap-Monitor-Energy-Usage-Wireless-Smart-Switch-%2F263020837777
  1244. // -----------------------------------------------------------------------------
  1245. #elif defined(WION_50055)
  1246. // Currently untested, does not support energy monitoring
  1247. // Info
  1248. #define MANUFACTURER "WION"
  1249. #define DEVICE "50055"
  1250. // Buttons
  1251. #define BUTTON1_PIN 13
  1252. #define BUTTON1_RELAY 1
  1253. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1254. // Relays
  1255. #define RELAY1_PIN 15
  1256. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1257. // LEDs
  1258. #define LED1_PIN 2
  1259. #define LED1_PIN_INVERSE 0
  1260. // -----------------------------------------------------------------------------
  1261. // EX-Store Wifi Relay v3.1
  1262. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1263. // -----------------------------------------------------------------------------
  1264. #elif defined(EXS_WIFI_RELAY_V31)
  1265. // Untested
  1266. // Info
  1267. #define MANUFACTURER "EXS"
  1268. #define DEVICE "WIFI_RELAY_V31"
  1269. // Buttons
  1270. #define BUTTON1_PIN 0
  1271. #define BUTTON1_RELAY 1
  1272. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1273. // Relays
  1274. #define RELAY1_PIN 13
  1275. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1276. #define RELAY1_RESET_PIN 12
  1277. // -----------------------------------------------------------------------------
  1278. // EX-Store Wifi Relay v5.0
  1279. // -----------------------------------------------------------------------------
  1280. #elif defined(EXS_WIFI_RELAY_V50)
  1281. // Info
  1282. #define MANUFACTURER "EXS"
  1283. #define DEVICE "WIFI_RELAY_V50"
  1284. // Buttons
  1285. #define BUTTON1_PIN 5
  1286. #define BUTTON1_RELAY 1
  1287. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT | BUTTON_SET_PULLUP
  1288. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  1289. #define BUTTON1_RELEASE BUTTON_ACTION_TOGGLE
  1290. #define BUTTON2_PIN 4
  1291. #define BUTTON2_RELAY 2
  1292. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT | BUTTON_SET_PULLUP
  1293. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  1294. #define BUTTON2_RELEASE BUTTON_ACTION_TOGGLE
  1295. // Relays
  1296. #define RELAY1_PIN 14
  1297. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1298. #define RELAY1_RESET_PIN 16
  1299. #define RELAY2_PIN 13
  1300. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1301. #define RELAY2_RESET_PIN 12
  1302. // LEDs
  1303. #define LED1_PIN 15
  1304. #define LED1_PIN_INVERSE 0
  1305. // -----------------------------------------------------------------------------
  1306. // V9261F
  1307. // -----------------------------------------------------------------------------
  1308. #elif defined(GENERIC_V9261F)
  1309. // Info
  1310. #define MANUFACTURER "GENERIC"
  1311. #define DEVICE "V9261F"
  1312. #define ALEXA_SUPPORT 0
  1313. // V9261F
  1314. #define V9261F_SUPPORT 1
  1315. #define V9261F_PIN 2
  1316. #define V9261F_PIN_INVERSE 1
  1317. // -----------------------------------------------------------------------------
  1318. // ECH1560
  1319. // -----------------------------------------------------------------------------
  1320. #elif defined(GENERIC_ECH1560)
  1321. // Info
  1322. #define MANUFACTURER "GENERIC"
  1323. #define DEVICE "ECH1560"
  1324. #define ALEXA_SUPPORT 0
  1325. // ECH1560
  1326. #define ECH1560_SUPPORT 1
  1327. #define ECH1560_CLK_PIN 4
  1328. #define ECH1560_MISO_PIN 5
  1329. #define ECH1560_INVERTED 0
  1330. // -----------------------------------------------------------------------------
  1331. // PZEM004T
  1332. // -----------------------------------------------------------------------------
  1333. #elif defined(GENERIC_PZEM004T)
  1334. // Info
  1335. #define MANUFACTURER "GENERIC"
  1336. #define DEVICE "PZEM004T"
  1337. #define PZEM004T_SUPPORT 1
  1338. #define ALEXA_SUPPORT 0
  1339. #define DEBUG_SERIAL_SUPPORT 0
  1340. // -----------------------------------------------------------------------------
  1341. // ESP-01 generic esp8266 board with 512 kB flash
  1342. // -----------------------------------------------------------------------------
  1343. #elif defined(GENERIC_ESP01_512KB)
  1344. // Info
  1345. #define MANUFACTURER "GENERIC"
  1346. #define DEVICE "ESP01_512KB"
  1347. // Relays
  1348. #define RELAY1_PIN 2
  1349. #ifndef RELAY1_TYPE
  1350. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1351. #endif
  1352. // No need for OTA
  1353. #define OTA_WEB_SUPPORT 0
  1354. #define OTA_ARDUINOOTA_SUPPORT 0
  1355. #define OTA_CLIENT OTA_CLIENT_NONE
  1356. // Web UI blob & MDNS are pretty large
  1357. #define WEB_EMBEDDED 0
  1358. #define MDNS_SERVER_SUPPORT 0
  1359. // -----------------------------------------------------------------------------
  1360. // ESPLive
  1361. // https://github.com/ManCaveMade/ESP-Live
  1362. // -----------------------------------------------------------------------------
  1363. #elif defined(MANCAVEMADE_ESPLIVE)
  1364. // Info
  1365. #define MANUFACTURER "MANCAVEMADE"
  1366. #define DEVICE "ESPLIVE"
  1367. // Buttons
  1368. #define BUTTON1_PIN 4
  1369. #define BUTTON2_PIN 5
  1370. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1371. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1372. #define BUTTON1_RELAY 1
  1373. #define BUTTON2_RELAY 2
  1374. // Relays
  1375. #define RELAY1_PIN 12
  1376. #define RELAY2_PIN 13
  1377. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1378. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1379. // DS18B20
  1380. #ifndef DALLAS_SUPPORT
  1381. #define DALLAS_SUPPORT 1
  1382. #endif
  1383. #define DALLAS_PIN 2
  1384. #define DALLAS_UPDATE_INTERVAL 5000
  1385. #define TEMPERATURE_MIN_CHANGE 1.0
  1386. // -----------------------------------------------------------------------------
  1387. // QuinLED
  1388. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1389. // -----------------------------------------------------------------------------
  1390. #elif defined(INTERMITTECH_QUINLED)
  1391. // Info
  1392. #define MANUFACTURER "INTERMITTECH"
  1393. #define DEVICE "QUINLED"
  1394. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1395. // LEDs
  1396. #define LED1_PIN 5
  1397. #define LED1_PIN_INVERSE 1
  1398. // Light
  1399. #define LIGHT_CH1_PIN 0
  1400. #define LIGHT_CH2_PIN 2
  1401. // -----------------------------------------------------------------------------
  1402. // Arilux AL-LC06
  1403. // -----------------------------------------------------------------------------
  1404. #elif defined(ARILUX_AL_LC01)
  1405. // Info
  1406. #define MANUFACTURER "ARILUX"
  1407. #define DEVICE "AL_LC01"
  1408. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1409. // Light
  1410. #define LIGHT_CH1_PIN 5 // RED
  1411. #define LIGHT_CH2_PIN 12 // GREEN
  1412. #define LIGHT_CH3_PIN 13 // BLUE
  1413. #elif defined(ARILUX_AL_LC02)
  1414. // Info
  1415. #define MANUFACTURER "ARILUX"
  1416. #define DEVICE "AL_LC02"
  1417. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1418. // Light
  1419. #define LIGHT_CH1_PIN 12 // RED
  1420. #define LIGHT_CH2_PIN 5 // GREEN
  1421. #define LIGHT_CH3_PIN 13 // BLUE
  1422. #define LIGHT_CH4_PIN 15 // WHITE1
  1423. #elif defined(ARILUX_AL_LC02_V14)
  1424. // Info
  1425. #define MANUFACTURER "ARILUX"
  1426. #define DEVICE "AL_LC02_V14"
  1427. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1428. // Light
  1429. #define LIGHT_CH1_PIN 14 // RED
  1430. #define LIGHT_CH2_PIN 5 // GREEN
  1431. #define LIGHT_CH3_PIN 12 // BLUE
  1432. #define LIGHT_CH4_PIN 13 // WHITE1
  1433. #elif defined(ARILUX_AL_LC06)
  1434. // Info
  1435. #define MANUFACTURER "ARILUX"
  1436. #define DEVICE "AL_LC06"
  1437. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1438. // Buttons
  1439. #define BUTTON1_PIN 0
  1440. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1441. #define BUTTON1_RELAY 1
  1442. // Light
  1443. #define LIGHT_CH1_PIN 14 // RED
  1444. #define LIGHT_CH2_PIN 12 // GREEN
  1445. #define LIGHT_CH3_PIN 13 // BLUE
  1446. #define LIGHT_CH4_PIN 15 // WHITE1
  1447. #define LIGHT_CH5_PIN 5 // WHITE2
  1448. #elif defined(ARILUX_AL_LC11)
  1449. // Info
  1450. #define MANUFACTURER "ARILUX"
  1451. #define DEVICE "AL_LC11"
  1452. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1453. // Light
  1454. #define LIGHT_CH1_PIN 5 // RED
  1455. #define LIGHT_CH2_PIN 4 // GREEN
  1456. #define LIGHT_CH3_PIN 14 // BLUE
  1457. #define LIGHT_CH4_PIN 13 // WHITE1
  1458. #define LIGHT_CH5_PIN 12 // WHITE1
  1459. #elif defined(ARILUX_E27)
  1460. // Info
  1461. #define MANUFACTURER "ARILUX"
  1462. #define DEVICE "E27"
  1463. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1464. // Light
  1465. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1466. #define MY92XX_CHIPS 1
  1467. #define MY92XX_DI_PIN 13
  1468. #define MY92XX_DCKI_PIN 15
  1469. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1470. #define MY92XX_CHANNELS 4
  1471. // -----------------------------------------------------------------------------
  1472. // XENON SM-PW701U
  1473. // -----------------------------------------------------------------------------
  1474. #elif defined(XENON_SM_PW702U)
  1475. // Info
  1476. #define MANUFACTURER "XENON"
  1477. #define DEVICE "SM_PW702U"
  1478. // Buttons
  1479. #define BUTTON1_PIN 13
  1480. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1481. #define BUTTON1_RELAY 1
  1482. // Relays
  1483. #define RELAY1_PIN 12
  1484. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1485. // LEDs
  1486. #define LED1_PIN 4
  1487. #define LED1_PIN_INVERSE 1
  1488. // -----------------------------------------------------------------------------
  1489. // ISELECTOR SM-PW702
  1490. // -----------------------------------------------------------------------------
  1491. #elif defined(ISELECTOR_SM_PW702)
  1492. // Info
  1493. #define MANUFACTURER "ISELECTOR"
  1494. #define DEVICE "SM_PW702"
  1495. // Buttons
  1496. #define BUTTON1_PIN 13
  1497. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1498. #define BUTTON1_RELAY 1
  1499. // Relays
  1500. #define RELAY1_PIN 12
  1501. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1502. // LEDs
  1503. #define LED1_PIN 4 //BLUE
  1504. #define LED1_PIN_INVERSE 0
  1505. #define LED2_PIN 5 //RED
  1506. #define LED2_PIN_INVERSE 1
  1507. // -----------------------------------------------------------------------------
  1508. // AUTHOMETION LYT8266
  1509. // https://authometion.com/shop/en/home/13-lyt8266.html
  1510. // -----------------------------------------------------------------------------
  1511. #elif defined(AUTHOMETION_LYT8266)
  1512. // Info
  1513. #define MANUFACTURER "AUTHOMETION"
  1514. #define DEVICE "LYT8266"
  1515. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1516. // Light
  1517. #define LIGHT_CH1_PIN 13 // RED
  1518. #define LIGHT_CH2_PIN 12 // GREEN
  1519. #define LIGHT_CH3_PIN 14 // BLUE
  1520. #define LIGHT_CH4_PIN 2 // WHITE
  1521. #define LIGHT_ENABLE_PIN 15
  1522. #elif defined(GIZWITS_WITTY_CLOUD)
  1523. // Info
  1524. #define MANUFACTURER "GIZWITS"
  1525. #define DEVICE "WITTY_CLOUD"
  1526. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1527. // Buttons
  1528. #define BUTTON1_PIN 4
  1529. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1530. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  1531. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  1532. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1533. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1534. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  1535. #define ANALOG_SUPPORT 1
  1536. // LEDs
  1537. #define LED1_PIN 2 // BLUE build-in
  1538. #define LED1_PIN_INVERSE 1
  1539. // Light
  1540. #define LIGHT_CH1_PIN 15 // RED
  1541. #define LIGHT_CH2_PIN 12 // GREEN
  1542. #define LIGHT_CH3_PIN 13 // BLUE
  1543. // -----------------------------------------------------------------------------
  1544. // KMC 70011
  1545. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1546. // -----------------------------------------------------------------------------
  1547. #elif defined(KMC_70011)
  1548. // Info
  1549. #define MANUFACTURER "KMC"
  1550. #define DEVICE "70011"
  1551. // Buttons
  1552. #define BUTTON1_PIN 0
  1553. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1554. #define BUTTON1_RELAY 1
  1555. // Relays
  1556. #define RELAY1_PIN 14
  1557. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1558. // LEDs
  1559. #define LED1_PIN 13
  1560. #define LED1_PIN_INVERSE 1
  1561. // HLW8012
  1562. #ifndef HLW8012_SUPPORT
  1563. #define HLW8012_SUPPORT 1
  1564. #endif
  1565. #define HLW8012_SEL_PIN 12
  1566. #define HLW8012_CF1_PIN 5
  1567. #define HLW8012_CF_PIN 4
  1568. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1569. // -----------------------------------------------------------------------------
  1570. // Euromate (?) Wifi Stecker Schuko
  1571. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1572. // Thanks to @Geitde
  1573. // -----------------------------------------------------------------------------
  1574. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1575. // Info
  1576. #define MANUFACTURER "EUROMATE"
  1577. #define DEVICE "WIFI_STECKER_SCHUKO"
  1578. // Buttons
  1579. #define BUTTON1_PIN 14
  1580. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1581. #define BUTTON1_RELAY 1
  1582. // The relay in the device is not a bistable (latched) relay.
  1583. // The device is reported to have a flip-flop circuit to drive the relay
  1584. // So @Geitde hack is still the only possible
  1585. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1586. #define RELAY1_PIN 5
  1587. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1588. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1589. #define LED2_PIN_INVERSE 0
  1590. // LEDs
  1591. #define LED1_PIN 4
  1592. #define LED1_PIN_INVERSE 0
  1593. // -----------------------------------------------------------------------------
  1594. // Euromate (?) Wifi Stecker Schuko Version 2
  1595. // This configuration is for the second generation of devices sold by OBI.
  1596. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1597. // -----------------------------------------------------------------------------
  1598. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1599. // Info
  1600. #define MANUFACTURER "EUROMATE"
  1601. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1602. // Buttons
  1603. #define BUTTON1_PIN 5
  1604. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1605. #define BUTTON1_RELAY 1
  1606. // Relays
  1607. #define RELAY1_PIN 4
  1608. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1609. // Green
  1610. #define LED1_PIN 12
  1611. #define LED1_MODE LED_MODE_WIFI
  1612. #define LED1_PIN_INVERSE 0
  1613. // Red
  1614. #define LED2_PIN 13
  1615. #define LED2_MODE LED_MODE_RELAY
  1616. #define LED2_PIN_INVERSE 0
  1617. // -----------------------------------------------------------------------------
  1618. // Generic 8CH
  1619. // -----------------------------------------------------------------------------
  1620. #elif defined(GENERIC_8CH)
  1621. // Info
  1622. #define MANUFACTURER "GENERIC"
  1623. #define DEVICE "8CH"
  1624. // Relays
  1625. #define RELAY1_PIN 0
  1626. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1627. #define RELAY2_PIN 2
  1628. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1629. #define RELAY3_PIN 4
  1630. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1631. #define RELAY4_PIN 5
  1632. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1633. #define RELAY5_PIN 12
  1634. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1635. #define RELAY6_PIN 13
  1636. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1637. #define RELAY7_PIN 14
  1638. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1639. #define RELAY8_PIN 15
  1640. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1641. // -----------------------------------------------------------------------------
  1642. // STM RELAY
  1643. // -----------------------------------------------------------------------------
  1644. #elif defined(STM_RELAY)
  1645. // Info
  1646. #define MANUFACTURER "STM_RELAY"
  1647. #define DEVICE "2CH"
  1648. // Relays
  1649. #define RELAY_PROVIDER_STM_SUPPORT 1
  1650. #define RELAY1_PROVIDER RELAY_PROVIDER_STM
  1651. #define RELAY2_PROVIDER RELAY_PROVIDER_STM
  1652. // Make sure we space out serial writes when relays are in sync. ref:
  1653. // - https://github.com/xoseperez/espurna/issues/1130
  1654. // - https://github.com/xoseperez/espurna/issues/1519
  1655. // - https://github.com/xoseperez/espurna/pull/1520
  1656. #define RELAY_DELAY_INTERLOCK 100
  1657. // Remove UART noise on serial line
  1658. // (or use `#define DEBUG_PORT Serial1` instead)
  1659. #define DEBUG_SERIAL_SUPPORT 0
  1660. // -----------------------------------------------------------------------------
  1661. // Tonbux Powerstrip02
  1662. // -----------------------------------------------------------------------------
  1663. #elif defined(TONBUX_POWERSTRIP02)
  1664. // Info
  1665. #define MANUFACTURER "TONBUX"
  1666. #define DEVICE "POWERSTRIP02"
  1667. // Buttons
  1668. #define BUTTON1_PIN 5
  1669. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1670. #define BUTTON1_RELAY 0
  1671. // Relays
  1672. #define RELAY1_PIN 4
  1673. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1674. #define RELAY2_PIN 13
  1675. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1676. #define RELAY3_PIN 12
  1677. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1678. #define RELAY4_PIN 14
  1679. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1680. // Not a relay. USB ports on/off
  1681. #define RELAY5_PIN 16
  1682. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1683. // LEDs
  1684. #define LED1_PIN 0 // 1 blue led
  1685. #define LED1_PIN_INVERSE 1
  1686. #define LED2_PIN 3 // 3 red leds
  1687. #define LED2_PIN_INVERSE 1
  1688. // -----------------------------------------------------------------------------
  1689. // Lingan SWA1
  1690. // -----------------------------------------------------------------------------
  1691. #elif defined(LINGAN_SWA1)
  1692. // Info
  1693. #define MANUFACTURER "LINGAN"
  1694. #define DEVICE "SWA1"
  1695. // Buttons
  1696. #define BUTTON1_PIN 13
  1697. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1698. #define BUTTON1_RELAY 1
  1699. // Relays
  1700. #define RELAY1_PIN 5
  1701. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1702. // LEDs
  1703. #define LED1_PIN 4
  1704. #define LED1_PIN_INVERSE 1
  1705. // -----------------------------------------------------------------------------
  1706. // HEYGO HY02
  1707. // -----------------------------------------------------------------------------
  1708. #elif defined(HEYGO_HY02)
  1709. // Info
  1710. #define MANUFACTURER "HEYGO"
  1711. #define DEVICE "HY02"
  1712. // Buttons
  1713. #define BUTTON1_PIN 13
  1714. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1715. #define BUTTON1_RELAY 1
  1716. // Relays
  1717. #define RELAY1_PIN 12
  1718. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1719. // LEDs
  1720. #define LED1_PIN 4
  1721. #define LED1_PIN_INVERSE 0
  1722. // -----------------------------------------------------------------------------
  1723. // Maxcio W-US002S
  1724. // -----------------------------------------------------------------------------
  1725. #elif defined(MAXCIO_WUS002S)
  1726. // Info
  1727. #define MANUFACTURER "MAXCIO"
  1728. #define DEVICE "WUS002S"
  1729. // Buttons
  1730. #define BUTTON1_PIN 2
  1731. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1732. #define BUTTON1_RELAY 1
  1733. // Relays
  1734. #define RELAY1_PIN 13
  1735. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1736. // LEDs
  1737. #define LED1_PIN 3
  1738. #define LED1_PIN_INVERSE 0
  1739. // HLW8012
  1740. #ifndef HLW8012_SUPPORT
  1741. #define HLW8012_SUPPORT 1
  1742. #endif
  1743. #define HLW8012_SEL_PIN 12
  1744. #define HLW8012_CF1_PIN 5
  1745. #define HLW8012_CF_PIN 4
  1746. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1747. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1748. // LED1 on RX pin
  1749. #define DEBUG_SERIAL_SUPPORT 1
  1750. // -----------------------------------------------------------------------------
  1751. // Maxcio W-DE004
  1752. // -----------------------------------------------------------------------------
  1753. #elif defined(MAXCIO_WDE004)
  1754. // Info
  1755. #define MANUFACTURER "MAXCIO"
  1756. #define DEVICE "WDE004"
  1757. // Buttons
  1758. #define BUTTON1_PIN 1
  1759. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1760. #define BUTTON1_RELAY 1
  1761. // Relays
  1762. #define RELAY1_PIN 14
  1763. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1764. // LEDs
  1765. #define LED1_PIN 13
  1766. #define LED1_PIN_INVERSE 1
  1767. // -----------------------------------------------------------------------------
  1768. // Maxcio W-UK007S
  1769. // Like this: https://www.amazon.co.uk/Maxcio-Monitoring-Function-Compatible-Required/dp/B07BWFB55Q/ref=pd_rhf_se_p_img_2?_encoding=UTF8&psc=1&refRID=4H63A43SKHV8WV54XH19
  1770. // -----------------------------------------------------------------------------
  1771. #elif defined(MAXCIO_WUK007S)
  1772. // Info
  1773. #define MANUFACTURER "MAXCIO"
  1774. #define DEVICE "WUK007S"
  1775. // Buttons
  1776. #define BUTTON1_PIN 13
  1777. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1778. #define BUTTON1_RELAY 1
  1779. // Relays
  1780. #define RELAY1_PIN 15
  1781. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1782. // LEDs
  1783. #define LED1_PIN 0
  1784. #define LED1_PIN_INVERSE 0
  1785. #define LED1_RELAY 1
  1786. #define LED1_MODE LED_MODE_RELAY_WIFI
  1787. // HJL01 / BL0937
  1788. #ifndef HLW8012_SUPPORT
  1789. #define HLW8012_SUPPORT 1
  1790. #endif
  1791. #define HLW8012_SEL_PIN 12
  1792. #define HLW8012_CF1_PIN 14
  1793. #define HLW8012_CF_PIN 5
  1794. #define HLW8012_SEL_CURRENT LOW
  1795. #define HLW8012_CURRENT_RATIO 24380
  1796. #define HLW8012_VOLTAGE_RATIO 32048
  1797. #define HLW8012_POWER_RATIO 3509285
  1798. #define HLW8012_INTERRUPT_ON FALLING
  1799. // -----------------------------------------------------------------------------
  1800. // Oukitel P1 Smart Plug
  1801. // https://www.amazon.com/Docooler-OUKITEL-Control-Wireless-Adaptor/dp/B07J3BYFJX/ref=sr_1_fkmrnull_2?keywords=oukitel+p1+smart+switch&qid=1550424399&s=gateway&sr=8-2-fkmrnull
  1802. // -----------------------------------------------------------------------------
  1803. #elif defined(OUKITEL_P1)
  1804. // Info
  1805. #define MANUFACTURER "Oukitel"
  1806. #define DEVICE "P1"
  1807. // Buttons
  1808. #define BUTTON1_PIN 13
  1809. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1810. #define BUTTON1_RELAY 1
  1811. // Relays
  1812. // Right
  1813. #define RELAY1_PIN 12
  1814. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1815. // Left
  1816. #define RELAY2_PIN 15
  1817. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1818. // LEDs
  1819. #define LED1_PIN 0 // blue
  1820. #define LED1_PIN_INVERSE 1
  1821. #define LED1_MODE LED_MODE_WIFI
  1822. // -----------------------------------------------------------------------------
  1823. // YiDian XS-SSA05
  1824. // -----------------------------------------------------------------------------
  1825. #elif defined(YIDIAN_XSSSA05)
  1826. // Info
  1827. #define MANUFACTURER "YIDIAN"
  1828. #define DEVICE "XSSSA05"
  1829. // Buttons
  1830. #define BUTTON1_PIN 13
  1831. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1832. #define BUTTON1_RELAY 1
  1833. // Relays
  1834. #define RELAY1_PIN 12
  1835. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1836. // LEDs
  1837. #define LED1_PIN 0 // red
  1838. #define LED1_PIN_INVERSE 1
  1839. #define LED1_MODE LED_MODE_WIFI
  1840. #define LED2_PIN 15 // blue
  1841. #define LED2_PIN_INVERSE 1
  1842. #define LED2_MODE LED_MODE_RELAY
  1843. // HLW8012
  1844. #ifndef HLW8012_SUPPORT
  1845. #define HLW8012_SUPPORT 1
  1846. #endif
  1847. #define HLW8012_SEL_PIN 3
  1848. #define HLW8012_CF1_PIN 14
  1849. #define HLW8012_CF_PIN 5
  1850. #define HLW8012_SEL_CURRENT LOW
  1851. #define HLW8012_CURRENT_RATIO 25740
  1852. #define HLW8012_VOLTAGE_RATIO 313400
  1853. #define HLW8012_POWER_RATIO 3414290
  1854. #define HLW8012_INTERRUPT_ON FALLING
  1855. // -----------------------------------------------------------------------------
  1856. // TONBUX XS-SSA01
  1857. // -----------------------------------------------------------------------------
  1858. #elif defined(TONBUX_XSSSA01)
  1859. // Info
  1860. #define MANUFACTURER "TONBUX"
  1861. #define DEVICE "XSSSA01"
  1862. // Buttons
  1863. #define BUTTON1_PIN 4
  1864. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1865. #define BUTTON1_RELAY 1
  1866. // Relays
  1867. #define RELAY1_PIN 14
  1868. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1869. // LEDs
  1870. #define LED1_PIN 13
  1871. #define LED1_PIN_INVERSE 0
  1872. // -----------------------------------------------------------------------------
  1873. // TONBUX XS-SSA06
  1874. // -----------------------------------------------------------------------------
  1875. #elif defined(TONBUX_XSSSA06)
  1876. // Info
  1877. #define MANUFACTURER "TONBUX"
  1878. #define DEVICE "XSSSA06"
  1879. // Buttons
  1880. #define BUTTON1_PIN 13
  1881. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1882. #define BUTTON1_RELAY 1
  1883. // Relays
  1884. #define RELAY1_PIN 15
  1885. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1886. // LEDs
  1887. #define LED1_PIN 0 // R - 8 rgb led ring
  1888. #define LED1_PIN_INVERSE 0
  1889. #define LED2_PIN 5 // G
  1890. #define LED2_PIN_INVERSE 0
  1891. #define LED3_PIN 2 // B
  1892. #define LED3_PIN_INVERSE 0
  1893. // -----------------------------------------------------------------------------
  1894. // GREEN ESP8266 RELAY MODULE
  1895. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1896. // -----------------------------------------------------------------------------
  1897. #elif defined(GREEN_ESP8266RELAY)
  1898. // Info
  1899. #define MANUFACTURER "GREEN"
  1900. #define DEVICE "ESP8266RELAY"
  1901. // Buttons
  1902. // Not a button but input via Optocoupler
  1903. #define BUTTON1_PIN 5
  1904. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1905. #define BUTTON1_RELAY 1
  1906. // Relays
  1907. #define RELAY1_PIN 4
  1908. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1909. // LEDs
  1910. #define LED1_PIN 2
  1911. #define LED1_PIN_INVERSE 1
  1912. // -----------------------------------------------------------------------------
  1913. // Henrique Gravina ESPIKE
  1914. // https://github.com/Henriquegravina/Espike
  1915. // -----------------------------------------------------------------------------
  1916. #elif defined(IKE_ESPIKE)
  1917. #define MANUFACTURER "IKE"
  1918. #define DEVICE "ESPIKE"
  1919. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  1920. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1921. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1922. #define BUTTON1_PIN 13
  1923. #define BUTTON1_RELAY 1
  1924. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1925. #define BUTTON2_PIN 12
  1926. #define BUTTON2_RELAY 2
  1927. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1928. #define BUTTON3_PIN 14
  1929. #define BUTTON3_RELAY 3
  1930. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1931. #define RELAY1_PIN 4
  1932. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1933. #define RELAY2_PIN 5
  1934. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1935. #define RELAY3_PIN 16
  1936. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1937. #define LED1_PIN 2
  1938. #define LED1_PIN_INVERSE 1
  1939. // -----------------------------------------------------------------------------
  1940. // SWIFITCH
  1941. // https://github.com/ArnieX/swifitch
  1942. // -----------------------------------------------------------------------------
  1943. #elif defined(ARNIEX_SWIFITCH)
  1944. // Info
  1945. #define MANUFACTURER "ARNIEX"
  1946. #define DEVICE "SWIFITCH"
  1947. // Buttons
  1948. #define BUTTON1_PIN 4 // D2
  1949. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_BOOT
  1950. #define BUTTON1_RELAY 1
  1951. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  1952. #define BUTTON1_RELEASE BUTTON_ACTION_TOGGLE
  1953. // Relays
  1954. #define RELAY1_PIN 5 // D1
  1955. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1956. // LEDs
  1957. #define LED1_PIN 12 // D6
  1958. #define LED1_PIN_INVERSE 1
  1959. // -----------------------------------------------------------------------------
  1960. // ESP-01S RELAY v4.0
  1961. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1962. // -----------------------------------------------------------------------------
  1963. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1964. // Info
  1965. #define MANUFACTURER "GENERIC"
  1966. #define DEVICE "ESP01S_RELAY_40"
  1967. // Relays
  1968. #define RELAY1_PIN 0
  1969. #ifndef RELAY1_TYPE
  1970. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1971. #endif
  1972. // LEDs
  1973. #define LED1_PIN 2
  1974. #define LED1_PIN_INVERSE 0
  1975. // -----------------------------------------------------------------------------
  1976. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1977. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1978. // -----------------------------------------------------------------------------
  1979. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1980. // Info
  1981. #define MANUFACTURER "GENERIC"
  1982. #define DEVICE "ESP01S_RGBLED_10"
  1983. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1984. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1985. // Buttons
  1986. //#define BUTTON1_PIN 2
  1987. // Relays
  1988. //#define RELAY1_PIN 2
  1989. // LEDs
  1990. #define LED1_PIN 2
  1991. #define LED1_PIN_INVERSE 0
  1992. // -----------------------------------------------------------------------------
  1993. // ESP-01S DHT11 v1.0
  1994. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1995. // -----------------------------------------------------------------------------
  1996. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1997. // Info
  1998. #define MANUFACTURER "GENERIC"
  1999. #define DEVICE "ESP01S_DHT11_10"
  2000. // DHT11
  2001. #ifndef DHT_SUPPORT
  2002. #define DHT_SUPPORT 1
  2003. #endif
  2004. #define DHT_PIN 2
  2005. #define DHT_TYPE DHT_CHIP_DHT11
  2006. // -----------------------------------------------------------------------------
  2007. // ESP-01S DS18B20 v1.0
  2008. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  2009. // -----------------------------------------------------------------------------
  2010. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  2011. // Info
  2012. #define MANUFACTURER "GENERIC"
  2013. #define DEVICE "ESP01S_DS18B20_10"
  2014. // DB18B20
  2015. #ifndef DALLAS_SUPPORT
  2016. #define DALLAS_SUPPORT 1
  2017. #endif
  2018. #define DALLAS_PIN 2
  2019. // -----------------------------------------------------------------------------
  2020. // ESP-DIN relay board V1
  2021. // https://github.com/pilotak/esp_din
  2022. // -----------------------------------------------------------------------------
  2023. #elif defined(PILOTAK_ESP_DIN_V1)
  2024. // Info
  2025. #define MANUFACTURER "PILOTAK"
  2026. #define DEVICE "ESP_DIN_V1"
  2027. // Buttons
  2028. #define BUTTON1_PIN 0
  2029. #define BUTTON1_RELAY 1
  2030. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2031. // Relays
  2032. #define RELAY1_PIN 4
  2033. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2034. #define RELAY2_PIN 5
  2035. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2036. // LEDs
  2037. #define LED1_PIN 15
  2038. #define LED1_PIN_INVERSE 0
  2039. #define I2C_SDA_PIN 12
  2040. #define I2C_SCL_PIN 13
  2041. #ifndef DALLAS_SUPPORT
  2042. #define DALLAS_SUPPORT 1
  2043. #endif
  2044. #define DALLAS_PIN 2
  2045. #define RFB_SUPPORT 1
  2046. #define RFB_PROVIDER RFB_PROVIDER_RCSWITCH
  2047. #define RFB_RX_PIN 14
  2048. #ifndef DIGITAL_SUPPORT
  2049. #define DIGITAL_SUPPORT 1
  2050. #endif
  2051. #define DIGITAL1_PIN 16
  2052. #define DIGITAL1_PIN_MODE INPUT
  2053. #define DIGITAL1_DEFAULT_STATE 0
  2054. // -----------------------------------------------------------------------------
  2055. // Heltec Touch Relay
  2056. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  2057. // -----------------------------------------------------------------------------
  2058. #elif defined(HELTEC_TOUCHRELAY)
  2059. // Info
  2060. #define MANUFACTURER "HELTEC"
  2061. #define DEVICE "TOUCH_RELAY"
  2062. // Buttons
  2063. #define BUTTON1_PIN 14
  2064. #define BUTTON1_RELAY 1
  2065. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON
  2066. // Relays
  2067. #define RELAY1_PIN 12
  2068. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2069. // -----------------------------------------------------------------------------
  2070. // Zhilde ZLD-44EU-W
  2071. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  2072. // -----------------------------------------------------------------------------
  2073. #elif defined(ZHILDE_44EU_W)
  2074. // Info
  2075. #define MANUFACTURER "ZHILDE"
  2076. #define DEVICE "44EU_W"
  2077. // Based on the reporter, this product uses GPIO1 and 3 for the button
  2078. // and onboard LED, so hardware serial should be disabled...
  2079. #define DEBUG_SERIAL_SUPPORT 0
  2080. // Buttons
  2081. #define BUTTON1_PIN 3
  2082. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2083. // Relays
  2084. #define RELAY1_PIN 5
  2085. #define RELAY2_PIN 4
  2086. #define RELAY3_PIN 12
  2087. #define RELAY4_PIN 13
  2088. #define RELAY5_PIN 14
  2089. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2090. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2091. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2092. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2093. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  2094. // LEDs
  2095. #define LED1_PIN 1
  2096. #define LED1_PIN_INVERSE 1
  2097. // -----------------------------------------------------------------------------
  2098. // Zhilde ZLD-64EU-W
  2099. // -----------------------------------------------------------------------------
  2100. #elif defined(ZHILDE_64EU_W)
  2101. // Info
  2102. #define MANUFACTURER "ZHILDE"
  2103. #define DEVICE "64EU_W"
  2104. // Based on https://templates.blakadder.com/ZLD64-EU-W.html ,
  2105. // This product uses GPIO1 for LED and 3 for the button, so hardware serial should be disabled...
  2106. #define DEBUG_SERIAL_SUPPORT 0
  2107. #define BUTTON1_PIN 3
  2108. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2109. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  2110. #define BUTTON1_RELAY 3
  2111. #define RELAY1_PIN 5
  2112. #define RELAY2_PIN 4
  2113. #define RELAY3_PIN 14
  2114. #define LED1_PIN 1
  2115. #define LED1_PIN_INVERSE 1
  2116. // -----------------------------------------------------------------------------
  2117. // Allnet 4duino ESP8266-UP-Relais
  2118. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  2119. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  2120. // -----------------------------------------------------------------------------
  2121. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  2122. // Info
  2123. #define MANUFACTURER "ALLNET"
  2124. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  2125. // Relays
  2126. #define RELAY1_PIN 14
  2127. #define RELAY1_RESET_PIN 12
  2128. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  2129. // LEDs
  2130. #define LED1_PIN 0
  2131. #define LED1_PIN_INVERSE 1
  2132. // Buttons
  2133. //#define BUTTON1_PIN 0
  2134. //#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2135. // Using pins labelled as SDA & SCL as buttons
  2136. #define BUTTON2_PIN 4
  2137. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON
  2138. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2139. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2140. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2141. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2142. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2143. #define BUTTON3_PIN 5
  2144. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON
  2145. // Using pins labelled as SDA & SCL for I2C
  2146. //#define I2C_SDA_PIN 4
  2147. //#define I2C_SCL_PIN 5
  2148. // -----------------------------------------------------------------------------
  2149. // Luani HVIO
  2150. // https://luani.de/projekte/esp8266-hvio/
  2151. // https://luani.de/blog/esp8266-230v-io-modul/
  2152. // -----------------------------------------------------------------------------
  2153. #elif defined(LUANI_HVIO)
  2154. // Info
  2155. #define MANUFACTURER "LUANI"
  2156. #define DEVICE "HVIO"
  2157. // Buttons
  2158. #define BUTTON1_PIN 12
  2159. #define BUTTON1_RELAY 1
  2160. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT //Hardware Pullup
  2161. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2162. #define BUTTON1_RELEASE BUTTON_ACTION_TOGGLE
  2163. #define BUTTON2_PIN 13
  2164. #define BUTTON2_RELAY 2
  2165. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT //Hardware Pullup
  2166. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2167. #define BUTTON2_RELEASE BUTTON_ACTION_TOGGLE
  2168. // Relays
  2169. #define RELAY1_PIN 4
  2170. #define RELAY2_PIN 5
  2171. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2172. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2173. // LEDs
  2174. #define LED1_PIN 15
  2175. #define LED1_PIN_INVERSE 0
  2176. // -----------------------------------------------------------------------------
  2177. // Tonbux 50-100M Smart Mosquito Killer USB
  2178. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2179. // -----------------------------------------------------------------------------
  2180. #elif defined(TONBUX_MOSQUITO_KILLER)
  2181. // Info
  2182. #define MANUFACTURER "TONBUX"
  2183. #define DEVICE "MOSQUITO_KILLER"
  2184. // Buttons
  2185. #define BUTTON1_PIN 2
  2186. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2187. #define BUTTON1_RELAY 1
  2188. // Relays
  2189. #define RELAY1_PIN 5 // not a relay, fan
  2190. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2191. // LEDs
  2192. #define LED1_PIN 15 // blue led
  2193. #define LED1_PIN_INVERSE 1
  2194. #define LED1_MODE LED_MODE_WIFI
  2195. #define LED2_PIN 14 // red led
  2196. #define LED2_PIN_INVERSE 1
  2197. #define LED2_MODE LED_MODE_RELAY
  2198. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2199. #define LED3_PIN_INVERSE 0
  2200. #define LED3_RELAY 1
  2201. #define LED4_PIN 16 // UV leds (9-10-11)
  2202. #define LED4_PIN_INVERSE 0
  2203. #define LED4_RELAY 1
  2204. // -----------------------------------------------------------------------------
  2205. // Avatto NAS-WR01W Wifi Smart Power Plug
  2206. // https://www.aliexpress.com/item/33011753732.html
  2207. // https://todo...
  2208. // -----------------------------------------------------------------------------
  2209. #elif defined(AVATTO_NAS_WR01W)
  2210. // Info
  2211. #define MANUFACTURER "AVATTO"
  2212. #define DEVICE "NAS_WR01W"
  2213. // Buttons
  2214. #define BUTTON1_PIN 0
  2215. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2216. #define BUTTON1_RELAY 1
  2217. // Relays
  2218. #define RELAY1_PIN 14
  2219. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2220. // LEDs
  2221. #define LED1_PIN 13
  2222. #define LED1_PIN_INVERSE 1
  2223. // HJL01 / BL0937
  2224. #ifndef HLW8012_SUPPORT
  2225. #define HLW8012_SUPPORT 1
  2226. #endif
  2227. #define HLW8012_SEL_PIN 12
  2228. #define HLW8012_CF1_PIN 5
  2229. #define HLW8012_CF_PIN 4
  2230. #define HLW8012_SEL_CURRENT LOW
  2231. #define HLW8012_CURRENT_RATIO 25740
  2232. #define HLW8012_VOLTAGE_RATIO 313400
  2233. #define HLW8012_POWER_RATIO 3414290
  2234. #define HLW8012_INTERRUPT_ON FALLING
  2235. // -----------------------------------------------------------------------------
  2236. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2237. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2238. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2239. // -----------------------------------------------------------------------------
  2240. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2241. // Info
  2242. #define MANUFACTURER "NEO_COOLCAM"
  2243. #define DEVICE "NAS_WR01W"
  2244. // Buttons
  2245. #define BUTTON1_PIN 13
  2246. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2247. #define BUTTON1_RELAY 1
  2248. // Relays
  2249. #define RELAY1_PIN 12
  2250. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2251. // LEDs
  2252. #define LED1_PIN 4
  2253. #define LED1_PIN_INVERSE 1
  2254. // -----------------------------------------------------------------------------
  2255. // Deltaco SH_P01 Wifi Smart Power Plug
  2256. // -----------------------------------------------------------------------------
  2257. #elif defined(DELTACO_SH_P01)
  2258. // Info
  2259. #define MANUFACTURER "DELTACO"
  2260. #define DEVICE "SH_P01"
  2261. // Buttons
  2262. #define BUTTON1_PIN 13
  2263. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2264. #define BUTTON1_RELAY 1
  2265. // Relays
  2266. #define RELAY1_PIN 12
  2267. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2268. // LEDs
  2269. #define LED1_PIN 5
  2270. #define LED1_PIN_INVERSE 1
  2271. #define LED1_MODE LED_MODE_FINDME
  2272. // ------------------------------------------------------------------------------
  2273. // DELTACO_SH_P03USB Wifi Smart Power Plug
  2274. // -----------------------------------------------------------------------------
  2275. #elif defined(DELTACO_SH_P03USB)
  2276. // Info
  2277. #define MANUFACTURER "DELTACO"
  2278. #define DEVICE "SH_P03USB"
  2279. // Buttons
  2280. #define BUTTON1_PIN 13
  2281. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2282. #define BUTTON1_RELAY 2
  2283. // Relays
  2284. #define RELAY1_PIN 15 // USB power
  2285. #define RELAY2_PIN 12 // power plug 1
  2286. #define RELAY3_PIN 14 // power plug 2
  2287. #define RELAY4_PIN 5 // power plug 3
  2288. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2289. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2290. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2291. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2292. // LEDs
  2293. #define LED1_PIN 0 // power led
  2294. #define LED1_PIN_INVERSE 1
  2295. #define LED1_MODE LED_MODE_FINDME
  2296. // ------------------------------------------------------------------------------
  2297. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2298. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2299. // Also: Estink Wifi Power Strip
  2300. // -----------------------------------------------------------------------------
  2301. #elif defined(FORNORM_ZLD_34EU)
  2302. // Info
  2303. #define MANUFACTURER "FORNORM"
  2304. #define DEVICE "ZLD_34EU"
  2305. // Disable UART noise since this board uses GPIO3
  2306. #define DEBUG_SERIAL_SUPPORT 0
  2307. // Buttons
  2308. #define BUTTON1_PIN 16
  2309. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2310. #define BUTTON1_RELAY 4
  2311. // Relays
  2312. #define RELAY1_PIN 14 // USB power
  2313. #define RELAY2_PIN 13 // power plug 1
  2314. #define RELAY3_PIN 4 // power plug 2
  2315. #define RELAY4_PIN 15 // power plug 3
  2316. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2317. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2318. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2319. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2320. // LEDs
  2321. #define LED1_PIN 0 // power led
  2322. #define LED2_PIN 12 // power plug 1
  2323. #define LED3_PIN 3 // power plug 2
  2324. #define LED4_PIN 5 // power plug 3
  2325. #define LED1_PIN_INVERSE 1
  2326. #define LED2_PIN_INVERSE 1
  2327. #define LED3_PIN_INVERSE 1
  2328. #define LED4_PIN_INVERSE 1
  2329. #define LED1_MODE LED_MODE_FINDME
  2330. #define LED2_MODE LED_MODE_FOLLOW
  2331. #define LED3_MODE LED_MODE_FOLLOW
  2332. #define LED4_MODE LED_MODE_FOLLOW
  2333. #define LED2_RELAY 2
  2334. #define LED3_RELAY 3
  2335. #define LED4_RELAY 4
  2336. // -----------------------------------------------------------------------------
  2337. // Bruno Horta's OnOfre
  2338. // https://www.bhonofre.pt/
  2339. // https://github.com/brunohorta82/BH_OnOfre/
  2340. // -----------------------------------------------------------------------------
  2341. #elif defined(BH_ONOFRE)
  2342. // Info
  2343. #define MANUFACTURER "BH"
  2344. #define DEVICE "ONOFRE"
  2345. // Buttons
  2346. #define BUTTON1_PIN 12
  2347. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2348. #define BUTTON1_RELAY 1
  2349. #define BUTTON2_PIN 13
  2350. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2351. #define BUTTON2_RELAY 2
  2352. // Relays
  2353. #define RELAY1_PIN 4
  2354. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2355. #define RELAY2_PIN 5
  2356. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2357. // -----------------------------------------------------------------------------
  2358. // BlitzWolf SHP2 and SHP6
  2359. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2360. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2361. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2362. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2363. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2364. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2365. // * DIY Tech Smart Home (https://www.amazon.es/gp/product/B07HHKXYS9)
  2366. // -----------------------------------------------------------------------------
  2367. #elif defined(BLITZWOLF_BWSHPX)
  2368. // Info
  2369. #define MANUFACTURER "BLITZWOLF"
  2370. #define DEVICE "BWSHPX"
  2371. // Buttons
  2372. #define BUTTON1_PIN 13
  2373. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2374. #define BUTTON1_RELAY 1
  2375. // Relays
  2376. #define RELAY1_PIN 15
  2377. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2378. // LEDs
  2379. #define LED1_PIN 2
  2380. #define LED1_PIN_INVERSE 1
  2381. #define LED2_PIN 0
  2382. #define LED2_PIN_INVERSE 1
  2383. #define LED2_MODE LED_MODE_FINDME
  2384. #define LED2_RELAY 1
  2385. // HJL01 / BL0937
  2386. #ifndef HLW8012_SUPPORT
  2387. #define HLW8012_SUPPORT 1
  2388. #endif
  2389. #define HLW8012_SEL_PIN 12
  2390. #define HLW8012_CF1_PIN 14
  2391. #define HLW8012_CF_PIN 5
  2392. #define HLW8012_SEL_CURRENT LOW
  2393. #define HLW8012_CURRENT_RATIO 25740
  2394. #define HLW8012_VOLTAGE_RATIO 313400
  2395. #define HLW8012_POWER_RATIO 3414290
  2396. #define HLW8012_INTERRUPT_ON FALLING
  2397. // -----------------------------------------------------------------------------
  2398. // Same as the above but new board version marked V2.3
  2399. // BlitzWolf SHP2 V2.3
  2400. // Gosund SP1 V2.3
  2401. // -----------------------------------------------------------------------------
  2402. #elif defined(BLITZWOLF_BWSHPX_V23)
  2403. // Info
  2404. #define MANUFACTURER "BLITZWOLF"
  2405. #define DEVICE "BWSHPX_V23"
  2406. // Buttons
  2407. #define BUTTON1_PIN 3
  2408. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2409. #define BUTTON1_RELAY 1
  2410. // Relays
  2411. #define RELAY1_PIN 14
  2412. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2413. // LEDs
  2414. #define LED1_PIN 1
  2415. #define LED1_PIN_INVERSE 1
  2416. #define LED2_PIN 13
  2417. #define LED2_PIN_INVERSE 1
  2418. #define LED2_MODE LED_MODE_FINDME
  2419. #define LED2_RELAY 1
  2420. // HJL01 / BL0937
  2421. #ifndef HLW8012_SUPPORT
  2422. #define HLW8012_SUPPORT 1
  2423. #endif
  2424. #define HLW8012_SEL_PIN 12
  2425. #define HLW8012_CF1_PIN 5
  2426. #define HLW8012_CF_PIN 4
  2427. #define HLW8012_SEL_CURRENT LOW
  2428. #define HLW8012_CURRENT_RATIO 25740
  2429. #define HLW8012_VOLTAGE_RATIO 313400
  2430. #define HLW8012_POWER_RATIO 3414290
  2431. #define HLW8012_INTERRUPT_ON FALLING
  2432. // BUTTON1 and LED1 are using Serial pins
  2433. #define DEBUG_SERIAL_SUPPORT 0
  2434. // -----------------------------------------------------------------------------
  2435. // Similar to both devices above but also with switchable USB ports
  2436. // and other sensor (CSE7766).
  2437. // the pin layout is different to the above two versions
  2438. // BlitzWolf SHP5
  2439. // -----------------------------------------------------------------------------
  2440. #elif defined(BLITZWOLF_BWSHP5)
  2441. // Info
  2442. #define MANUFACTURER "BLITZWOLF"
  2443. #define DEVICE "BWSHP5"
  2444. // Buttons
  2445. #define BUTTON1_PIN 16
  2446. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2447. #define BUTTON1_RELAY 1
  2448. // Relays
  2449. // Power plug
  2450. #define RELAY1_PIN 14
  2451. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2452. // USB
  2453. #define RELAY2_PIN 5
  2454. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2455. // LEDs
  2456. #define LED1_PIN 2
  2457. #define LED1_PIN_INVERSE 1
  2458. #define LED2_PIN 0
  2459. #define LED2_PIN_INVERSE 1
  2460. #define LED2_MODE LED_MODE_FINDME
  2461. #define LED2_RELAY 1
  2462. // Disable UART noise
  2463. #define DEBUG_SERIAL_SUPPORT 0
  2464. // CSE7766
  2465. #ifndef CSE7766_SUPPORT
  2466. #define CSE7766_SUPPORT 1
  2467. #endif
  2468. #define CSE7766_RX_PIN 3
  2469. // -----------------------------------------------------------------------------
  2470. // Teckin SP21
  2471. // -----------------------------------------------------------------------------
  2472. #elif defined(TECKIN_SP21)
  2473. // Info
  2474. #define MANUFACTURER "TECKIN"
  2475. #define DEVICE "SP21"
  2476. // Buttons
  2477. #define BUTTON1_PIN 13
  2478. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2479. #define BUTTON1_RELAY 1
  2480. // Relays
  2481. #define RELAY1_PIN 15
  2482. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2483. // LEDs
  2484. #define LED1_PIN 2
  2485. #define LED1_PIN_INVERSE 1
  2486. // -----------------------------------------------------------------------------
  2487. // Teckin SP22 v1.4 - v1.6
  2488. // -----------------------------------------------------------------------------
  2489. #elif defined(TECKIN_SP22_V14)
  2490. // Info
  2491. #define MANUFACTURER "TECKIN"
  2492. #define DEVICE "SP22_V14"
  2493. // Buttons
  2494. #define BUTTON1_PIN 1
  2495. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2496. #define BUTTON1_RELAY 1
  2497. // Relays
  2498. #define RELAY1_PIN 14
  2499. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2500. // LEDs
  2501. #define LED1_PIN 3
  2502. #define LED1_PIN_INVERSE 1
  2503. #define LED2_PIN 13
  2504. #define LED2_PIN_INVERSE 1
  2505. #define LED2_MODE LED_MODE_FINDME
  2506. #define LED2_RELAY 1
  2507. // HJL01 / BL0937
  2508. #ifndef HLW8012_SUPPORT
  2509. #define HLW8012_SUPPORT 1
  2510. #endif
  2511. #define HLW8012_SEL_PIN 12
  2512. #define HLW8012_CF1_PIN 5
  2513. #define HLW8012_CF_PIN 4
  2514. #define HLW8012_SEL_CURRENT LOW
  2515. #define HLW8012_CURRENT_RATIO 20730
  2516. #define HLW8012_VOLTAGE_RATIO 264935
  2517. #define HLW8012_POWER_RATIO 2533110
  2518. #define HLW8012_INTERRUPT_ON FALLING
  2519. // BUTTON1 and LED1 are using Serial pins
  2520. #define DEBUG_SERIAL_SUPPORT 0
  2521. // -----------------------------------------------------------------------------
  2522. // Teckin SP22 v1.4 - v1.6
  2523. //
  2524. // NB Notes suggest that energy monitoring is removed from later versions
  2525. // -----------------------------------------------------------------------------
  2526. #elif defined(TECKIN_SP23_V13)
  2527. // Info .. NB Newer versions apparently lack energy monitor
  2528. // The board revision is not indicated externally
  2529. #define MANUFACTURER "TECKIN"
  2530. #define DEVICE "SP23_V13"
  2531. // Buttons
  2532. #define BUTTON1_PIN 13
  2533. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2534. #define BUTTON1_RELAY 1
  2535. // Relays
  2536. #define RELAY1_PIN 15
  2537. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2538. // LEDs
  2539. #define LED1_PIN 4
  2540. #define LED1_PIN_INVERSE 1
  2541. #define LED2_PIN 2
  2542. #define LED2_PIN_INVERSE 0
  2543. #define LED2_MODE LED_MODE_FINDME
  2544. #define LED2_RELAY 1
  2545. // HJL01 / BL0937
  2546. #ifndef HLW8012_SUPPORT
  2547. #define HLW8012_SUPPORT 1
  2548. #endif
  2549. #define HLW8012_SEL_PIN 12
  2550. #define HLW8012_CF1_PIN 14
  2551. #define HLW8012_CF_PIN 5
  2552. #define HLW8012_SEL_CURRENT LOW
  2553. #define HLW8012_CURRENT_RATIO 23324
  2554. #define HLW8012_VOLTAGE_RATIO 324305
  2555. #define HLW8012_POWER_RATIO 3580841
  2556. #define HLW8012_INTERRUPT_ON FALLING
  2557. // -----------------------------------------------------------------------------
  2558. // The Gosund WP3 is based on ESP8285, so 1 MB internal flash (DOUT required)
  2559. // The module has no-connect: TX, RX, RST, AD, GPIO5, (and GPIO0,
  2560. // GPIO2 via test points on the back of the module)
  2561. // and these are wired to devices:
  2562. // GPIO4: /BTN
  2563. // GPIO12: /LED red
  2564. // GPIO13: /LED blue
  2565. // GPIO14: RELAY
  2566. // -----------------------------------------------------------------------------
  2567. #elif defined(GOSUND_WP3)
  2568. // Info
  2569. #define MANUFACTURER "GOSUND"
  2570. #define DEVICE "WP3"
  2571. // Buttons
  2572. #define BUTTON1_PIN 4
  2573. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2574. #define BUTTON1_RELAY 1
  2575. // the defaults are reasonable, but you can change them as desired
  2576. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2577. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2578. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2579. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2580. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2581. // Relays
  2582. #define RELAY1_PIN 14
  2583. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2584. // LEDs
  2585. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2586. // so that the LED lights the button when 'off' so it can be found easily.
  2587. #define LED1_PIN 12
  2588. #define LED1_PIN_INVERSE 1
  2589. #define LED1_MODE LED_MODE_FOLLOW
  2590. #define LED1_RELAY 1
  2591. // LED2 (blue) indicates wifi activity
  2592. #define LED2_PIN 13
  2593. #define LED2_PIN_INVERSE 1
  2594. #define LED2_MODE LED_MODE_WIFI
  2595. // -----------------------------------------------------------------------------
  2596. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2597. // Also model number KS-602S
  2598. // -----------------------------------------------------------------------------
  2599. #elif defined(GOSUND_WS1)
  2600. // Info
  2601. #define MANUFACTURER "GOSUND"
  2602. #define DEVICE "WS1"
  2603. // Buttons
  2604. #define BUTTON1_PIN 0
  2605. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2606. #define BUTTON1_RELAY 1
  2607. // Relays
  2608. #define RELAY1_PIN 14
  2609. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2610. // LEDs
  2611. #define LED1_PIN 1
  2612. #define LED1_PIN_INVERSE 1
  2613. // LED1 is using TX pin
  2614. #define DEBUG_SERIAL_SUPPORT 0
  2615. // ----------------------------------------------------------------------------------------
  2616. // Power socket 16A similar to BLITZWOLF_BWSHPX but button pin differs
  2617. // IMPORTANT, This template is for hardware version SP111_A_Wifi_Ver1.1 (as printed on the PCB)
  2618. // hhttps://www.amazon.de/-/en/Smallest-Consumption-Measuring-Function-Compatible/dp/B07PSMF47W
  2619. // ----------------------------------------------------------------------------------------
  2620. #elif defined(GOSUND_SP111)
  2621. // Info
  2622. #define MANUFACTURER "GOSUND"
  2623. #define DEVICE "SP111"
  2624. // Buttons
  2625. #define BUTTON1_PIN 13
  2626. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2627. #define BUTTON1_RELAY 1
  2628. // Relays
  2629. #define RELAY1_PIN 15
  2630. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2631. // LEDs
  2632. #define LED1_PIN 2
  2633. #define LED1_PIN_INVERSE 1
  2634. #define LED2_PIN 0
  2635. #define LED2_PIN_INVERSE 1
  2636. #define LED2_MODE LED_MODE_FINDME
  2637. #define LED2_RELAY 1
  2638. // HJL01 / BL0937
  2639. #ifndef HLW8012_SUPPORT
  2640. #define HLW8012_SUPPORT 1
  2641. #endif
  2642. #define HLW8012_SEL_PIN 12
  2643. #define HLW8012_CF1_PIN 4
  2644. #define HLW8012_CF_PIN 5
  2645. #define HLW8012_SEL_CURRENT LOW
  2646. #define HLW8012_CURRENT_RATIO 25740
  2647. #define HLW8012_VOLTAGE_RATIO 313400
  2648. #define HLW8012_POWER_RATIO 3414290
  2649. #define HLW8012_INTERRUPT_ON FALLING
  2650. // ----------------------------------------------------------------------------------------
  2651. // Power strip 15A - 3 Sockets + 3 USB ports
  2652. // This device uses just one digital button (main one). All other three buttons are connected
  2653. // to the ADC pin via resistors with different values. This approach is known under the name of
  2654. // "Resistor Ladder" - https://en.wikipedia.org/wiki/Resistor_ladder
  2655. // https://www.amazon.de/-/en/gp/product/B085XXCPRD
  2656. // ----------------------------------------------------------------------------------------
  2657. #elif defined(GOSUND_P1)
  2658. // Info
  2659. #define MANUFACTURER "GOSUND"
  2660. #define DEVICE "P1"
  2661. //Enable this to view buttons analog level.
  2662. //Or, use adc terminal command
  2663. //#define ANALOG_SUPPORT 1
  2664. // Disable UART noise
  2665. #define DEBUG_SERIAL_SUPPORT 0
  2666. // Buttons
  2667. #define BUTTON_PROVIDER_GPIO_SUPPORT 1
  2668. #define BUTTON_PROVIDER_ANALOG_SUPPORT 1
  2669. #define BUTTON1_PIN 16
  2670. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2671. #define BUTTON1_RELAY 4
  2672. #define BUTTON2_PIN 17
  2673. #define BUTTON2_RELAY 3
  2674. #define BUTTON2_PROVIDER BUTTON_PROVIDER_ANALOG
  2675. #define BUTTON2_ANALOG_LEVEL 220
  2676. #define BUTTON3_PIN 17
  2677. #define BUTTON3_RELAY 2
  2678. #define BUTTON3_PROVIDER BUTTON_PROVIDER_ANALOG
  2679. #define BUTTON3_ANALOG_LEVEL 470
  2680. #define BUTTON4_PIN 17
  2681. #define BUTTON4_RELAY 1
  2682. #define BUTTON4_PROVIDER BUTTON_PROVIDER_ANALOG
  2683. #define BUTTON4_ANALOG_LEVEL 730
  2684. // Relays
  2685. #define RELAY1_PIN 14
  2686. #define RELAY2_PIN 12
  2687. #define RELAY3_PIN 13
  2688. #define RELAY4_PIN 5
  2689. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  2690. // LEDs
  2691. #define LED1_PIN 2
  2692. #define LED1_PIN_INVERSE 1
  2693. // CSE7766
  2694. #define CSE7766_SUPPORT 1
  2695. #define CSE7766_RX_PIN 3
  2696. // ----------------------------------------------------------------------------------------
  2697. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2698. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2699. // ----------------------------------------------------------------------------------------
  2700. #elif defined(HOMECUBE_16A)
  2701. // Info
  2702. #define MANUFACTURER "HOMECUBE"
  2703. #define DEVICE "16A"
  2704. // Buttons
  2705. #define BUTTON1_PIN 13
  2706. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2707. #define BUTTON1_RELAY 1
  2708. // Relays
  2709. #define RELAY1_PIN 15
  2710. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2711. // LEDs
  2712. //LED Pin 4 - ESP8266 onboard LED
  2713. //Red LED: 0
  2714. //Green LED: 12
  2715. //Blue LED: 2
  2716. // Blue
  2717. #define LED1_PIN 2
  2718. #define LED1_PIN_INVERSE 0
  2719. // Green
  2720. #define LED2_PIN 12
  2721. #define LED2_PIN_INVERSE 1
  2722. #define LED2_MODE LED_MODE_RELAY
  2723. // Red
  2724. #define LED3_PIN 0
  2725. #define LED3_PIN_INVERSE 0
  2726. #define LED3_MODE LED_MODE_OFF
  2727. // HJL01 / BL0937
  2728. #ifndef HLW8012_SUPPORT
  2729. #define HLW8012_SUPPORT 1
  2730. #endif
  2731. #define HLW8012_SEL_PIN 16
  2732. #define HLW8012_CF1_PIN 14
  2733. #define HLW8012_CF_PIN 5
  2734. #define HLW8012_SEL_CURRENT LOW
  2735. #define HLW8012_CURRENT_RATIO 25740
  2736. #define HLW8012_VOLTAGE_RATIO 313400
  2737. #define HLW8012_POWER_RATIO 3414290
  2738. #define HLW8012_INTERRUPT_ON FALLING
  2739. // -----------------------------------------------------------------------------
  2740. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2741. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2742. // -----------------------------------------------------------------------------
  2743. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2744. // Info
  2745. #define MANUFACTURER "VANZAVANZU"
  2746. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2747. // Buttons
  2748. #define BUTTON1_PIN 13
  2749. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2750. #define BUTTON1_RELAY 1
  2751. // Relays
  2752. #define RELAY1_PIN 15
  2753. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2754. // LEDs
  2755. #define LED1_PIN 2
  2756. #define LED1_PIN_INVERSE 1
  2757. #define LED2_PIN 0
  2758. #define LED2_PIN_INVERSE 1
  2759. #define LED2_MODE LED_MODE_FINDME
  2760. #define LED2_RELAY 1
  2761. // Disable UART noise
  2762. #define DEBUG_SERIAL_SUPPORT 0
  2763. // HJL01 / BL0937
  2764. #ifndef HLW8012_SUPPORT
  2765. #define HLW8012_SUPPORT 1
  2766. #endif
  2767. #define HLW8012_SEL_PIN 3
  2768. #define HLW8012_CF1_PIN 14
  2769. #define HLW8012_CF_PIN 5
  2770. #define HLW8012_SEL_CURRENT LOW
  2771. #define HLW8012_CURRENT_RATIO 25740
  2772. #define HLW8012_VOLTAGE_RATIO 313400
  2773. #define HLW8012_POWER_RATIO 3414290
  2774. #define HLW8012_INTERRUPT_ON FALLING
  2775. // -----------------------------------------------------------------------------
  2776. #elif defined(GENERIC_AG_L4)
  2777. // Info
  2778. #define MANUFACTURER "GENERIC"
  2779. #define DEVICE "AG_L4"
  2780. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2781. // button 1: "power" button
  2782. #define BUTTON1_PIN 4
  2783. #define BUTTON1_RELAY 1
  2784. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2785. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2786. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2787. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2788. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2789. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2790. // button 2: "wifi" button
  2791. #define BUTTON2_PIN 2
  2792. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2793. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2794. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2795. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2796. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2797. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2798. // LEDs
  2799. #define LED1_PIN 5 // red status led
  2800. #define LED1_PIN_INVERSE 0
  2801. #define LED2_PIN 16 // master light power
  2802. #define LED2_PIN_INVERSE 1
  2803. #define LED2_MODE LED_MODE_RELAY
  2804. // Light
  2805. #define LIGHT_CH1_PIN 14 // RED
  2806. #define LIGHT_CH2_PIN 13 // GREEN
  2807. #define LIGHT_CH3_PIN 12 // BLUE
  2808. // -----------------------------------------------------------------------------
  2809. #elif defined(GENERIC_AG_L4_V3)
  2810. // Info
  2811. #define MANUFACTURER "GENERIC"
  2812. #define DEVICE "AG_L4_V3"
  2813. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2814. // button 1: "power" button
  2815. #define BUTTON1_PIN 13
  2816. #define BUTTON1_RELAY 1
  2817. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2818. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2819. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2820. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2821. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2822. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2823. // button 2: "wifi" button
  2824. #define BUTTON2_PIN 2
  2825. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2826. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2827. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2828. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2829. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2830. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2831. // LEDs
  2832. #define LED1_PIN 5 // red status led
  2833. #define LED1_PIN_INVERSE 0
  2834. #define LED2_PIN 16 // master light power
  2835. #define LED2_PIN_INVERSE 1
  2836. #define LED2_MODE LED_MODE_RELAY
  2837. // Light
  2838. #define LIGHT_CH1_PIN 4 // RED
  2839. #define LIGHT_CH2_PIN 12 // GREEN
  2840. #define LIGHT_CH3_PIN 14 // BLUE
  2841. // -----------------------------------------------------------------------------
  2842. #elif defined(ALLTERCO_SHELLY1)
  2843. // Info
  2844. #define MANUFACTURER "ALLTERCO"
  2845. #define DEVICE "SHELLY1"
  2846. // Buttons
  2847. #define BUTTON1_PIN 5
  2848. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT
  2849. #define BUTTON1_RELAY 1
  2850. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2851. #define BUTTON1_RELEASE BUTTON_ACTION_TOGGLE
  2852. // Relays
  2853. #define RELAY1_PIN 4
  2854. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2855. #elif defined(ALLTERCO_SHELLY2)
  2856. // Info
  2857. #define MANUFACTURER "ALLTERCO"
  2858. #define DEVICE "SHELLY2"
  2859. // Buttons
  2860. #define BUTTON1_PIN 12
  2861. #define BUTTON1_RELAY 1
  2862. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT
  2863. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2864. #define BUTTON1_RELEASE BUTTON_ACTION_TOGGLE
  2865. #define BUTTON2_PIN 14
  2866. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT
  2867. #define BUTTON2_RELAY 2
  2868. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2869. #define BUTTON2_RELEASE BUTTON_ACTION_TOGGLE
  2870. // Relays
  2871. #define RELAY1_PIN 4
  2872. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2873. #define RELAY2_PIN 5
  2874. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2875. #elif defined(ALLTERCO_SHELLY1PM)
  2876. // Info
  2877. #define MANUFACTURER "ALLTERCO"
  2878. #define DEVICE "SHELLY1PM"
  2879. // Buttons
  2880. #define BUTTON1_PIN 4
  2881. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT
  2882. #define BUTTON1_RELAY 1
  2883. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2884. #define BUTTON1_RELEASE BUTTON_ACTION_TOGGLE
  2885. #define BUTTON2_PIN 2
  2886. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2887. #define BUTTON2_LNGCLICK BUTTON_ACTION_RESET
  2888. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2889. // Relays
  2890. #define RELAY1_PIN 15
  2891. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2892. // Light
  2893. #define LED1_PIN 0
  2894. #define LED1_PIN_INVERSE 1
  2895. // HJL01 / BL0937
  2896. #define HLW8012_SUPPORT 1
  2897. #define HLW8012_SEL_PIN 12
  2898. #define HLW8012_CF1_PIN 13
  2899. #define HLW8012_CF_PIN 5
  2900. #define HLW8012_SEL_CURRENT LOW
  2901. #define HLW8012_CURRENT_RATIO 25740
  2902. #define HLW8012_VOLTAGE_RATIO 313400
  2903. #define HLW8012_POWER_RATIO 3414290
  2904. #define HLW8012_INTERRUPT_ON FALLING
  2905. //Temperature
  2906. #define NTC_SUPPORT 1
  2907. #define SENSOR_SUPPORT 1
  2908. #define NTC_BETA 3350
  2909. #define NTC_R_UP 10000
  2910. #define NTC_R_DOWN 0
  2911. #define NTC_R0 8000
  2912. #elif defined(ALLTERCO_SHELLY25)
  2913. // Info
  2914. #define MANUFACTURER "ALLTERCO"
  2915. #define DEVICE "SHELLY25"
  2916. // Buttons
  2917. #define BUTTON1_PIN 13
  2918. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT
  2919. #define BUTTON1_RELAY 1
  2920. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2921. #define BUTTON1_RELEASE BUTTON_ACTION_TOGGLE
  2922. #define BUTTON2_PIN 5
  2923. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_BOOT
  2924. #define BUTTON2_RELAY 2
  2925. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2926. #define BUTTON2_RELEASE BUTTON_ACTION_TOGGLE
  2927. #define BUTTON3_PIN 2
  2928. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2929. #define BUTTON3_LNGCLICK BUTTON_ACTION_RESET
  2930. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2931. // Relays
  2932. #define RELAY1_PIN 4
  2933. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2934. #define RELAY2_PIN 15
  2935. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2936. // Light
  2937. #define LED1_PIN 0
  2938. #define LED1_PIN_INVERSE 1
  2939. //Temperature
  2940. #define NTC_SUPPORT 1
  2941. #define SENSOR_SUPPORT 1
  2942. #define NTC_BETA 3350
  2943. #define NTC_R_UP 10000
  2944. #define NTC_R_DOWN 0
  2945. #define NTC_R0 8000
  2946. //Current
  2947. #define ADE7953_SUPPORT 1
  2948. #define I2C_SDA_PIN 12
  2949. #define I2C_SCL_PIN 14
  2950. // -----------------------------------------------------------------------------
  2951. // This device has teh same behaviour as the GOSUND WP3, but with different GPIO pin values
  2952. // GPIO equivalents extracted from https://templates.blakadder.com/aoycocr_X5P.html
  2953. #elif defined(AOYCOCR_X5P)
  2954. // Info
  2955. #define MANUFACTURER "AOYCOCR"
  2956. #define DEVICE "X5P"
  2957. // Buttons
  2958. #define BUTTON1_PIN 13
  2959. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2960. #define BUTTON1_RELAY 1
  2961. // the defaults are reasonable, but you can change them as desired
  2962. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2963. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2964. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2965. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2966. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2967. // Relays
  2968. #define RELAY1_PIN 15
  2969. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2970. // LEDs
  2971. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2972. // so that the LED lights the button when 'off' so it can be found easily.
  2973. #define LED1_PIN 0
  2974. #define LED1_PIN_INVERSE 1
  2975. #define LED1_MODE LED_MODE_FOLLOW
  2976. #define LED1_RELAY 1
  2977. // LED2 (blue) indicates wifi activity
  2978. #define LED2_PIN 2
  2979. #define LED2_PIN_INVERSE 1
  2980. #define LED2_MODE LED_MODE_WIFI
  2981. // -----------------------------------------------------------------------------
  2982. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2983. // see https://github.com/xoseperez/espurna/issues/2055
  2984. #elif defined(LOHAS_E27_9W)
  2985. // Info
  2986. #define MANUFACTURER "LOHAS"
  2987. #define DEVICE "E27_9W"
  2988. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2989. // Light
  2990. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2991. #define MY92XX_CHIPS 2
  2992. #define MY92XX_DI_PIN 13
  2993. #define MY92XX_DCKI_PIN 15
  2994. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2995. #define MY92XX_CHANNELS 5
  2996. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2997. // https://www.amazon.com/gp/product/B07T7W7ZMW
  2998. #elif defined(LOHAS_E26_A19)
  2999. // Info
  3000. #define MANUFACTURER "LOHAS"
  3001. #define DEVICE "E26_A19"
  3002. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3003. // Light
  3004. #define LIGHT_CH1_PIN 5 // RED
  3005. #define LIGHT_CH2_PIN 4 // GREEN
  3006. #define LIGHT_CH3_PIN 13 // BLUE
  3007. #define LIGHT_CH4_PIN 14 // WHITE1
  3008. #define LIGHT_CH5_PIN 12 // WHITE1
  3009. // -----------------------------------------------------------------------------
  3010. #elif defined(TECKIN_SB53)
  3011. // Info
  3012. #define MANUFACTURER "TECKIN"
  3013. #define DEVICE "SB53"
  3014. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3015. // Light
  3016. #define LIGHT_CH1_PIN 4 // RED
  3017. #define LIGHT_CH2_PIN 12 // GREEN
  3018. #define LIGHT_CH3_PIN 14 // BLUE
  3019. #define LIGHT_CH4_PIN 13 // WARM WHITE
  3020. #define LIGHT_CH5_PIN 5 // COLD WHITE
  3021. // -----------------------------------------------------------------------------
  3022. #elif defined(XIAOMI_SMART_DESK_LAMP)
  3023. // Info
  3024. #define MANUFACTURER "XIAOMI"
  3025. #define DEVICE "SMART_DESK_LAMP"
  3026. // Buttons
  3027. #define BUTTON1_PIN 2
  3028. #define BUTTON2_PIN 14
  3029. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3030. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3031. // This button doubles as switch here and as encoder mode switch below
  3032. // Clicking it (for less than 500ms) will turn the light on and off
  3033. // Double and Long clicks will not work as these are used to modify the encoder action
  3034. #define BUTTON1_RELAY 1
  3035. #define BUTTON_LNGCLICK_DELAY 500
  3036. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  3037. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  3038. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  3039. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  3040. #define BUTTON2_DBLCLICK BUTTON_ACTION_AP
  3041. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  3042. // Light
  3043. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3044. #define LIGHT_STEP 8
  3045. #define LIGHT_CH1_PIN 5 // warm white
  3046. #define LIGHT_CH2_PIN 4 // cold white
  3047. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  3048. #define LIGHT_COLDWHITE_MIRED 153
  3049. #define LIGHT_WARMWHITE_MIRED 370
  3050. // Encoder
  3051. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  3052. // when the button is not pressed, and the overall brightness when pressed
  3053. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  3054. // when the button is not pressed, and the second channel when pressed
  3055. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  3056. #define ENCODER_SUPPORT 1
  3057. #define ENCODER1_PIN1 12
  3058. #define ENCODER1_PIN2 13
  3059. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  3060. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  3061. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  3062. #define ENCODER1_MODE ENCODER_MODE_RATIO
  3063. #elif defined(PHYX_ESP12_RGB)
  3064. // Info
  3065. #define MANUFACTURER "PHYX"
  3066. #define DEVICE "ESP12_RGB"
  3067. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3068. // Light
  3069. #define LIGHT_CH1_PIN 4 // RED
  3070. #define LIGHT_CH2_PIN 14 // GREEN
  3071. #define LIGHT_CH3_PIN 12 // BLUE
  3072. // -----------------------------------------------------------------------------
  3073. // iWoole LED Table Lamp
  3074. // http://iwoole.com/newst-led-smart-night-light-7w-smart-table-light-rgbw-wifi-app-remote-control-110v-220v-us-eu-plug-smart-lamp-google-home-decore-p00022p1.html
  3075. // -----------------------------------------------------------------------------
  3076. #elif defined(IWOOLE_LED_TABLE_LAMP)
  3077. // Info
  3078. #define MANUFACTURER "IWOOLE"
  3079. #define DEVICE "LED_TABLE_LAMP"
  3080. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3081. // Light
  3082. #define LIGHT_CH1_PIN 12 // RED
  3083. #define LIGHT_CH2_PIN 5 // GREEN
  3084. #define LIGHT_CH3_PIN 14 // BLUE
  3085. #define LIGHT_CH4_PIN 4 // WHITE
  3086. // -----------------------------------------------------------------------------
  3087. // Generic GU10
  3088. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  3089. // -----------------------------------------------------------------------------
  3090. #elif defined(GENERIC_GU10)
  3091. // Info
  3092. #define MANUFACTURER "GENERIC"
  3093. #define DEVICE "GU10"
  3094. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3095. // Light
  3096. #define LIGHT_CH1_PIN 14 // RED
  3097. #define LIGHT_CH2_PIN 12 // GREEN
  3098. #define LIGHT_CH3_PIN 13 // BLUE
  3099. #define LIGHT_CH4_PIN 4 // WHITE
  3100. // -----------------------------------------------------------------------------
  3101. // Generic E14
  3102. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  3103. // -----------------------------------------------------------------------------
  3104. #elif defined(GENERIC_E14)
  3105. // Info
  3106. #define MANUFACTURER "GENERIC"
  3107. #define DEVICE "E14"
  3108. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3109. // Light
  3110. #define LIGHT_CH1_PIN 4 // RED
  3111. #define LIGHT_CH2_PIN 12 // GREEN
  3112. #define LIGHT_CH3_PIN 14 // BLUE
  3113. #define LIGHT_CH4_PIN 5 // WHITE
  3114. // -----------------------------------------------------------------------------
  3115. // Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
  3116. // -----------------------------------------------------------------------------
  3117. #elif defined(DELTACO_SH_LEXXW)
  3118. // Info
  3119. #define MANUFACTURER "DELTACO"
  3120. #define DEVICE "SH_LEXXW"
  3121. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3122. // Light
  3123. #define LIGHT_CH1_PIN 12 // WARM WHITE
  3124. #define LIGHT_CH2_PIN 14 // COLD WHITE
  3125. // -----------------------------------------------------------------------------
  3126. // Deltaco rgbw e27 (SH-LE27RGB)
  3127. // -----------------------------------------------------------------------------
  3128. #elif defined(DELTACO_SH_LEXXRGB)
  3129. // Info
  3130. #define MANUFACTURER "DELTACO"
  3131. #define DEVICE "SH_LEXXRGB"
  3132. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3133. // Light
  3134. #define LIGHT_CH1_PIN 5 // RED
  3135. #define LIGHT_CH2_PIN 4 // GREEN
  3136. #define LIGHT_CH3_PIN 13 // BLUE
  3137. #define LIGHT_CH4_PIN 14 // WARM WHITE
  3138. #define LIGHT_CH5_PIN 12 // COLD WHITE
  3139. // -----------------------------------------------------------------------------
  3140. // Nexete A19
  3141. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  3142. // -----------------------------------------------------------------------------
  3143. #elif defined(NEXETE_A19)
  3144. // Info
  3145. #define MANUFACTURER "NEXETE"
  3146. #define DEVICE "A19"
  3147. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3148. // Light
  3149. #define LIGHT_CH1_PIN 12 // RED
  3150. #define LIGHT_CH2_PIN 15 // GREEN
  3151. #define LIGHT_CH3_PIN 14 // BLUE
  3152. #define LIGHT_CH4_PIN 5 // WHITE
  3153. // -----------------------------------------------------------------------------
  3154. // Lombex Lux Nova 2 Tunable White
  3155. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3156. // -----------------------------------------------------------------------------
  3157. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  3158. // Info
  3159. #define MANUFACTURER "LOMBEX"
  3160. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  3161. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3162. // Light
  3163. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3164. #define MY92XX_CHIPS 1
  3165. #define MY92XX_DI_PIN 4
  3166. #define MY92XX_DCKI_PIN 5
  3167. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3168. #define MY92XX_CHANNELS 2
  3169. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  3170. #define MY92XX_CH1 3
  3171. #define MY92XX_CH2 0
  3172. // -----------------------------------------------------------------------------
  3173. // Lombex Lux Nova 2 White and Color
  3174. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3175. // -----------------------------------------------------------------------------
  3176. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  3177. // Info
  3178. #define MANUFACTURER "LOMBEX"
  3179. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  3180. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3181. // Light
  3182. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3183. #define MY92XX_CHIPS 1
  3184. #define MY92XX_DI_PIN 4
  3185. #define MY92XX_DCKI_PIN 5
  3186. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3187. #define MY92XX_CHANNELS 4
  3188. // RGB on channels 0/1/2, either cool or warm white on channel 3
  3189. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  3190. // -----------------------------------------------------------------------------
  3191. // Bestek Smart Plug with 2 USB ports
  3192. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  3193. // -----------------------------------------------------------------------------
  3194. #elif defined(BESTEK_MRJ1011)
  3195. // Info
  3196. #define MANUFACTURER "BESTEK"
  3197. #define DEVICE "MRJ1011"
  3198. // Buttons
  3199. #define BUTTON1_PIN 13
  3200. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3201. #define BUTTON1_RELAY 1
  3202. // Relay
  3203. #define RELAY1_PIN 12
  3204. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3205. // LED
  3206. #define LED1_PIN 4
  3207. #define LED1_PIN_INVERSE 1
  3208. // -----------------------------------------------------------------------------
  3209. // GBLIFE RGBW SOCKET
  3210. // -----------------------------------------------------------------------------
  3211. #elif defined(GBLIFE_RGBW_SOCKET)
  3212. // Info
  3213. #define MANUFACTURER "GBLIFE"
  3214. #define DEVICE "RGBW_SOCKET"
  3215. // Buttons
  3216. #define BUTTON1_PIN 13
  3217. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3218. #define BUTTON1_RELAY 1
  3219. // Relays
  3220. #define RELAY1_PIN 15
  3221. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3222. // Light RGBW
  3223. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3224. #define LIGHT_CH1_PIN 5 // RED
  3225. #define LIGHT_CH2_PIN 14 // GREEN
  3226. #define LIGHT_CH3_PIN 12 // BLUE
  3227. #define LIGHT_CH4_PIN 4 // WHITE
  3228. // ----------------------------------------------------------------------------------------
  3229. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  3230. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  3231. // Also labeled NETVIP
  3232. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  3233. // ----------------------------------------------------------------------------------------
  3234. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  3235. // Info
  3236. #define MANUFACTURER "SMARTLIFE"
  3237. #define DEVICE "MINI_SMART_SOCKET"
  3238. // Buttons
  3239. #define BUTTON1_PIN 13
  3240. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3241. #define BUTTON1_RELAY 1
  3242. // Relays
  3243. #define RELAY1_PIN 15
  3244. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3245. // LEDs
  3246. //Red LED: 0
  3247. //Green LED: 4
  3248. //Blue LED: 2
  3249. // Light
  3250. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3251. #define LIGHT_CH1_PIN 0 // RED
  3252. #define LIGHT_CH2_PIN 4 // GREEN
  3253. #define LIGHT_CH3_PIN 2 // BLUE
  3254. // HJL01 / BL0937
  3255. #ifndef HLW8012_SUPPORT
  3256. #define HLW8012_SUPPORT 1
  3257. #endif
  3258. #define HLW8012_SEL_PIN 12
  3259. #define HLW8012_CF1_PIN 14
  3260. #define HLW8012_CF_PIN 5
  3261. #define HLW8012_SEL_CURRENT LOW
  3262. #define HLW8012_CURRENT_RATIO 25740
  3263. #define HLW8012_VOLTAGE_RATIO 313400
  3264. #define HLW8012_POWER_RATIO 3414290
  3265. #define HLW8012_INTERRUPT_ON FALLING
  3266. // ----------------------------------------------------------------------------------------
  3267. // Hama WiFi Steckdose (00176533)
  3268. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  3269. // ----------------------------------------------------------------------------------------
  3270. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  3271. // Info
  3272. #define MANUFACTURER "HAMA"
  3273. #define DEVICE "WIFI_STECKDOSE_00176533"
  3274. // Buttons
  3275. #define BUTTON1_PIN 13
  3276. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3277. #define BUTTON1_RELAY 1
  3278. // Relays
  3279. #define RELAY1_PIN 12
  3280. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3281. // LEDs
  3282. #define LED1_PIN 4
  3283. #define LED1_PIN_INVERSE 1
  3284. // -----------------------------------------------------------------------------
  3285. // Oxaoxe NX-SP202
  3286. // Digoo NX-SP202 (not tested)
  3287. // Digoo DG-SP202 (not tested)
  3288. // https://github.com/xoseperez/espurna/issues/1502
  3289. // -----------------------------------------------------------------------------
  3290. #elif defined(DIGOO_NX_SP202)
  3291. // Info
  3292. #define MANUFACTURER "DIGOO"
  3293. #define DEVICE "NX_SP202"
  3294. // Buttons
  3295. #define BUTTON1_PIN 0
  3296. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3297. #define BUTTON1_RELAY 1
  3298. #define BUTTON2_PIN 16
  3299. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3300. #define BUTTON2_RELAY 2
  3301. // Relays
  3302. #define RELAY1_PIN 15
  3303. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3304. #define RELAY2_PIN 14
  3305. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3306. // LEDs
  3307. #define LED1_PIN 13
  3308. #define LED1_PIN_INVERSE 1
  3309. // HJL01 / BL0937
  3310. #ifndef HLW8012_SUPPORT
  3311. #define HLW8012_SUPPORT 1
  3312. #endif
  3313. #define HLW8012_SEL_PIN 12
  3314. #define HLW8012_CF1_PIN 5
  3315. #define HLW8012_CF_PIN 4
  3316. #define HLW8012_SEL_CURRENT LOW
  3317. #define HLW8012_CURRENT_RATIO 23296
  3318. #define HLW8012_VOLTAGE_RATIO 310085
  3319. #define HLW8012_POWER_RATIO 3368471
  3320. #define HLW8012_INTERRUPT_ON FALLING
  3321. // -----------------------------------------------------------------------------
  3322. // Foxel's LightFox dual
  3323. // https://github.com/foxel/esp-dual-rf-switch
  3324. // -----------------------------------------------------------------------------
  3325. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3326. // Info
  3327. #define MANUFACTURER "FOXEL"
  3328. #define DEVICE "LIGHTFOX_DUAL"
  3329. #define SERIAL_BAUDRATE 19200
  3330. // Relays
  3331. #define RELAY_PROVIDER_DUAL_SUPPORT 1
  3332. #define RELAY1_PROVIDER RELAY_PROVIDER_DUAL
  3333. #define RELAY2_PROVIDER RELAY_PROVIDER_DUAL
  3334. // No need to include generic GPIO support
  3335. // "Buttons" are attached to a secondary MCU and RELAY_PROVIDER_DUAL handles that
  3336. #define BUTTON_PROVIDER_GPIO_SUPPORT 0
  3337. // Conflicts with relay operation
  3338. #define DEBUG_SERIAL_SUPPORT 0
  3339. // -----------------------------------------------------------------------------
  3340. // Teckin SP20
  3341. // -----------------------------------------------------------------------------
  3342. #elif defined(TECKIN_SP20)
  3343. // Info
  3344. #define MANUFACTURER "TECKIN"
  3345. #define DEVICE "SP20"
  3346. // Buttons
  3347. #define BUTTON1_PIN 13
  3348. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3349. #define BUTTON1_RELAY 1
  3350. // Relays
  3351. #define RELAY1_PIN 4
  3352. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3353. // LEDs
  3354. #define LED1_PIN 2
  3355. #define LED1_PIN_INVERSE 1
  3356. #define LED2_PIN 0
  3357. #define LED2_PIN_INVERSE 1
  3358. #define LED2_MODE LED_MODE_FINDME
  3359. #define LED2_RELAY 0
  3360. // HJL01 / BL0937
  3361. #ifndef HLW8012_SUPPORT
  3362. #define HLW8012_SUPPORT 1
  3363. #endif
  3364. #define HLW8012_SEL_PIN 12
  3365. #define HLW8012_CF1_PIN 14
  3366. #define HLW8012_CF_PIN 5
  3367. #define HLW8012_SEL_CURRENT LOW
  3368. #define HLW8012_CURRENT_RATIO 25740
  3369. #define HLW8012_VOLTAGE_RATIO 313400
  3370. #define HLW8012_POWER_RATIO 3414290
  3371. #define HLW8012_INTERRUPT_ON FALLING
  3372. // -----------------------------------------------------------------------------
  3373. // Charging Essentials / LITESUN LA-WF3
  3374. // -----------------------------------------------------------------------------
  3375. #elif defined(LITESUN_LA_WF3)
  3376. // Info
  3377. #define MANUFACTURER "LITESUN"
  3378. #define DEVICE "LA_WF3"
  3379. // Buttons
  3380. #define BUTTON1_PIN 13
  3381. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3382. #define BUTTON1_RELAY 1
  3383. // Relays
  3384. #define RELAY1_PIN 12
  3385. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3386. // LEDs
  3387. #define LED1_PIN 4 // 4 blue led
  3388. #define LED1_MODE LED_MODE_WIFI
  3389. #define LED1_PIN_INVERSE 1
  3390. #define LED2_PIN 5 // 5 red led
  3391. #define LED2_MODE LED_MODE_RELAY
  3392. #define LED2_PIN_INVERSE 1
  3393. // -----------------------------------------------------------------------------
  3394. // PSH
  3395. // -----------------------------------------------------------------------------
  3396. #elif defined(PSH_WIFI_PLUG)
  3397. // Info
  3398. #define MANUFACTURER "PSH"
  3399. #define DEVICE "WIFI_PLUG"
  3400. // Relays
  3401. #define RELAY1_PIN 2
  3402. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3403. // LEDs
  3404. #define LED1_PIN 0
  3405. #define LED1_PIN_INVERSE 0
  3406. #elif defined(PSH_RGBW_CONTROLLER)
  3407. // Info
  3408. #define MANUFACTURER "PSH"
  3409. #define DEVICE "RGBW_CONTROLLER"
  3410. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3411. // LEDs
  3412. #define LED1_PIN 13
  3413. #define LED1_PIN_INVERSE 1
  3414. // Light
  3415. #define LIGHT_CH1_PIN 5 // RED
  3416. #define LIGHT_CH2_PIN 4 // GREEN
  3417. #define LIGHT_CH3_PIN 12 // BLUE
  3418. #define LIGHT_CH4_PIN 14 // WHITE1
  3419. #elif defined(PSH_WIFI_SENSOR)
  3420. // Info
  3421. #define MANUFACTURER "PSH"
  3422. #define DEVICE "WIFI_SENSOR"
  3423. // DHT12 Sensor
  3424. #define DHT_SUPPORT 1
  3425. #define DHT_PIN 14
  3426. #define DHT_TYPE DHT_CHIP_DHT12
  3427. // LDR Sensor
  3428. #define LDR_SUPPORT 1
  3429. #define LDR_TYPE LDR_GL5528
  3430. #define LDR_ON_GROUND false
  3431. #define LDR_RESISTOR 10000
  3432. #elif defined(JINVOO_VALVE_SM_AW713)
  3433. // Reflashing from original Tuya firmware
  3434. // to thirdparty firmware like espurna by:
  3435. // https://github.com/ct-Open-Source/tuya-convert
  3436. // Info
  3437. #define MANUFACTURER "JINVOO"
  3438. #define DEVICE "VALVE_SM_AW713"
  3439. // Buttons
  3440. #define BUTTON1_PIN 13
  3441. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3442. #define BUTTON1_RELAY 1
  3443. // Relays
  3444. #define RELAY1_PIN 12
  3445. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3446. // LED
  3447. #define LED1_PIN 5 // 5 red led
  3448. #define LED1_PIN_INVERSE 0
  3449. #define LED1_RELAY 1
  3450. #define LED1_MODE LED_MODE_RELAY
  3451. #define LED2_PIN 4 // 4 blue led
  3452. #define LED2_PIN_INVERSE 0
  3453. #define LED2_RELAY 1
  3454. #define LED2_MODE LED_MODE_FINDME_WIFI
  3455. #elif defined(TUYA_GENERIC_DIMMER)
  3456. #define MANUFACTURER "TUYA"
  3457. #define DEVICE "GENERIC_DIMMER"
  3458. #define TUYA_SUPPORT 1
  3459. #define LIGHT_PROVIDER LIGHT_PROVIDER_CUSTOM
  3460. #define LED1_GPIO 14
  3461. #define TUYA_CH_STATE_DPID 1
  3462. #define TUYA_CH1_DPID 2
  3463. #define DEBUG_SERIAL_SUPPORT 0
  3464. // -----------------------------------------------------------------------------
  3465. // Etekcity ESW01-USA
  3466. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3467. // -----------------------------------------------------------------------------
  3468. #elif defined(ETEKCITY_ESW01_USA)
  3469. // Info
  3470. #define MANUFACTURER "ETEKCITY"
  3471. #define DEVICE "ESW01_USA"
  3472. // Buttons
  3473. #define BUTTON1_PIN 14
  3474. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3475. #define BUTTON1_RELAY 1
  3476. // Relays
  3477. #define RELAY1_PIN 4
  3478. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3479. // LEDs
  3480. // Blue
  3481. #define LED1_PIN 5
  3482. #define LED1_MODE LED_MODE_WIFI
  3483. // Yellow
  3484. #define LED2_PIN 16
  3485. #define LED2_MODE LED_MODE_FOLLOW
  3486. #define LED2_RELAY 1
  3487. // HLW8012
  3488. #ifndef HLW8012_SUPPORT
  3489. #define HLW8012_SUPPORT 1
  3490. #endif
  3491. #define HLW8012_SEL_PIN 15
  3492. #define HLW8012_CF1_PIN 12
  3493. #define HLW8012_CF_PIN 13
  3494. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3495. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3496. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3497. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3498. #define HLW8012_INTERRUPT_ON CHANGE
  3499. // -----------------------------------------------------------------------------
  3500. // FS UAP1
  3501. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3502. #elif defined(FS_UAP1)
  3503. // Info
  3504. #define MANUFACTURER "FS"
  3505. #define DEVICE "UAP1"
  3506. // Inputs
  3507. #define DIGITAL1_PIN 4
  3508. #define DIGITAL2_PIN 5
  3509. // Relays
  3510. #define RELAY1_PIN 12
  3511. #define RELAY2_PIN 13
  3512. #define RELAY3_PIN 14
  3513. #define RELAY4_PIN 15
  3514. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3515. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3516. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3517. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3518. // LEDs
  3519. #define LED1_PIN 2
  3520. // Disable UART noise
  3521. #define DEBUG_SERIAL_SUPPORT 0
  3522. // -----------------------------------------------------------------------------
  3523. // TFLAG NX-SM100 & NX-SM200
  3524. // -----------------------------------------------------------------------------
  3525. #elif defined(TFLAG_NX_SMX00)
  3526. // Info
  3527. #define MANUFACTURER "TFLAG"
  3528. #define DEVICE "NX_SMX00"
  3529. // Buttons
  3530. #define BUTTON1_PIN 13
  3531. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3532. #define BUTTON1_RELAY 1
  3533. // Relays
  3534. #define RELAY1_PIN 12
  3535. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3536. // LEDs
  3537. #define LED1_PIN 0
  3538. #define LED1_PIN_INVERSE 1
  3539. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3540. #define LED1_RELAY 1
  3541. #define LED2_PIN 15
  3542. #define LED2_PIN_INVERSE 1
  3543. #define LED2_MODE LED_MODE_WIFI
  3544. // HJL01 / BL0937
  3545. #ifndef HLW8012_SUPPORT
  3546. #define HLW8012_SUPPORT 1
  3547. #endif
  3548. #define HLW8012_SEL_PIN 16
  3549. #define HLW8012_CF1_PIN 14
  3550. #define HLW8012_CF_PIN 5
  3551. #define HLW8012_SEL_CURRENT LOW
  3552. #define HLW8012_CURRENT_RATIO 632
  3553. #define HLW8012_VOLTAGE_RATIO 313400
  3554. #define HLW8012_POWER_RATIO 3711185
  3555. #define HLW8012_INTERRUPT_ON FALLING
  3556. // -----------------------------------------------------------------------------
  3557. // MUVIT_IO_MIOBULB001
  3558. // -----------------------------------------------------------------------------
  3559. #elif defined(MUVIT_IO_MIOBULB001)
  3560. // Info
  3561. #define MANUFACTURER "MUVIT_IO"
  3562. #define DEVICE "MIOBULB001"
  3563. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3564. // Light
  3565. #define LIGHT_CH1_PIN 14 // RED
  3566. #define LIGHT_CH2_PIN 12 // GREEN
  3567. #define LIGHT_CH3_PIN 13 // BLUE
  3568. #define LIGHT_CH4_PIN 4 // WHITE
  3569. // -----------------------------------------------------------------------------
  3570. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3571. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3572. // Reflashing from original Tuya firmware
  3573. // to thirdparty firmware like espurna by:
  3574. // https://github.com/ct-Open-Source/tuya-convert
  3575. // -----------------------------------------------------------------------------
  3576. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3577. // Info
  3578. #define MANUFACTURER "HYKKER"
  3579. #define DEVICE "SMART_HOME_POWER_PLUG"
  3580. // Buttons
  3581. #define BUTTON1_PIN 0
  3582. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3583. #define BUTTON1_RELAY 1
  3584. // Relays
  3585. #define RELAY1_PIN 14
  3586. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3587. // LED
  3588. // Red
  3589. #define LED1_PIN 13
  3590. #define LED1_MODE LED_MODE_WIFI
  3591. #define LED1_PIN_INVERSE 1
  3592. // Blue connected to relay
  3593. // HLW8012
  3594. #ifndef HLW8012_SUPPORT
  3595. #define HLW8012_SUPPORT 1
  3596. #endif
  3597. #define HLW8012_SEL_PIN 12
  3598. #define HLW8012_CF1_PIN 5
  3599. #define HLW8012_CF_PIN 4
  3600. #define HLW8012_SEL_CURRENT LOW
  3601. #define HLW8012_CURRENT_RATIO 25740
  3602. #define HLW8012_VOLTAGE_RATIO 282060
  3603. #define HLW8012_POWER_RATIO 3414290
  3604. #define HLW8012_INTERRUPT_ON FALLING
  3605. // -----------------------------------------------------------------------------
  3606. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3607. // Product code: KASPEMHA
  3608. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3609. // Reflashing from original Tuya firmware
  3610. // to thirdparty firmware like espurna by:
  3611. // https://github.com/ct-Open-Source/tuya-convert
  3612. // -----------------------------------------------------------------------------
  3613. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3614. // Info
  3615. #define MANUFACTURER "KOGAN"
  3616. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3617. // Buttons
  3618. #define BUTTON1_PIN 0
  3619. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3620. #define BUTTON1_RELAY 1
  3621. // Relays
  3622. #define RELAY1_PIN 14
  3623. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3624. // LED
  3625. // Red
  3626. #define LED1_PIN 13
  3627. #define LED1_MODE LED_MODE_WIFI
  3628. #define LED1_PIN_INVERSE 1
  3629. // Blue connected to relay
  3630. // HLW8012
  3631. #ifndef HLW8012_SUPPORT
  3632. #define HLW8012_SUPPORT 1
  3633. #endif
  3634. #define HLW8012_SEL_PIN 12
  3635. #define HLW8012_CF1_PIN 5
  3636. #define HLW8012_CF_PIN 4
  3637. #define HLW8012_SEL_CURRENT LOW
  3638. #define HLW8012_CURRENT_RATIO 25740
  3639. #define HLW8012_VOLTAGE_RATIO 282060
  3640. #define HLW8012_POWER_RATIO 3414290
  3641. #define HLW8012_INTERRUPT_ON FALLING
  3642. // -----------------------------------------------------------------------------
  3643. // KINGART_CURTAIN_SWITCH
  3644. // -----------------------------------------------------------------------------
  3645. #elif defined(KINGART_CURTAIN_SWITCH)
  3646. // Info
  3647. #define MANUFACTURER "KINGART"
  3648. #define DEVICE "CURTAIN_SWITCH"
  3649. #define CURTAIN_SUPPORT 1
  3650. // LEDs
  3651. #define LED1_PIN 13
  3652. #define LED1_PIN_INVERSE 1
  3653. // KINGART module handles the UART, can't print any debug messages
  3654. #define KINGART_CURTAIN_SUPPORT 1
  3655. #define DEBUG_SERIAL_SUPPORT 0
  3656. // -----------------------------------------------------------------------------
  3657. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3658. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3659. // Reflashing from original Tuya firmware
  3660. // to thirdparty firmware like espurna by:
  3661. // https://github.com/ct-Open-Source/tuya-convert
  3662. // -----------------------------------------------------------------------------
  3663. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3664. // Info
  3665. #define MANUFACTURER "LSC"
  3666. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3667. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3668. // Light RGBW
  3669. #define LIGHT_CH1_PIN 4 // RED
  3670. #define LIGHT_CH2_PIN 12 // GREEN
  3671. #define LIGHT_CH3_PIN 14 // BLUE
  3672. #define LIGHT_CH4_PIN 13 // WHITE
  3673. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3674. // IR
  3675. #define IR_SUPPORT 1
  3676. #define IR_RX_PIN 0
  3677. #define IR_BUTTON_SET 5
  3678. // -----------------------------------------------------------------------------
  3679. // eHomeDIY WT02
  3680. // https://github.com/eHomeDIY/WT02-hardware
  3681. // -----------------------------------------------------------------------------
  3682. #elif defined(EHOMEDIY_WT02)
  3683. // Info
  3684. #define MANUFACTURER "EHOMEDIY"
  3685. #define DEVICE "WT02"
  3686. #define I2C_SDA_PIN 0
  3687. #define I2C_SCL_PIN 2
  3688. #define BMX280_SUPPORT 1
  3689. // #define SI7021_SUPPORT 1
  3690. // -----------------------------------------------------------------------------
  3691. // eHomeDIY WT03
  3692. // https://github.com/eHomeDIY/WT03-hardware
  3693. // -----------------------------------------------------------------------------
  3694. #elif defined(EHOMEDIY_WT03)
  3695. // Info
  3696. #define MANUFACTURER "EHOMEDIY"
  3697. #define DEVICE "WT03"
  3698. #define I2C_SDA_PIN 2
  3699. #define I2C_SCL_PIN 0
  3700. #define BMX280_SUPPORT 1
  3701. // #define SI7021_SUPPORT 1
  3702. // -----------------------------------------------------------------------------
  3703. // Linksprite R4
  3704. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3705. // -----------------------------------------------------------------------------
  3706. #elif defined(LINKSPRITE_LINKNODE_R4)
  3707. // Info
  3708. #define MANUFACTURER "LINKSPRITE"
  3709. #define DEVICE "LINKNODE_R4"
  3710. // Relays
  3711. #define RELAY1_PIN 12
  3712. #define RELAY2_PIN 13
  3713. #define RELAY3_PIN 14
  3714. #define RELAY4_PIN 16
  3715. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3716. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3717. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3718. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3719. // -----------------------------------------------------------------------------
  3720. // NEDIS WIFIP310FWT Wi-Fi Smart Extension Socket
  3721. // 3x Schuko Type F, 4x USB, 16 A
  3722. // https://nedis.com/en-us/product/smart-living/smart-home/energy/550672299/wi-fi-smart-extension-socket-3x-schuko-type-f-4x-usb-16-a
  3723. // -----------------------------------------------------------------------------
  3724. #elif defined(NEDIS_WIFIP310FWT)
  3725. // Info
  3726. #define MANUFACTURER "NEDIS"
  3727. #define DEVICE "WIFIP310FWT"
  3728. // Based on the reporter, this product uses GPIO1 and 3 for the button
  3729. // and onboard LED, so hardware serial should be disabled...
  3730. #define DEBUG_SERIAL_SUPPORT 0
  3731. // Buttons
  3732. #define BUTTON1_PIN 3
  3733. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3734. // Relays
  3735. #define RELAY1_PIN 5
  3736. #define RELAY2_PIN 4
  3737. #define RELAY3_PIN 13
  3738. #define RELAY4_PIN 14
  3739. // LEDs
  3740. #define LED1_PIN 1
  3741. #define LED1_PIN_INVERSE 1
  3742. // -----------------------------------------------------------------------------
  3743. // Arlec Smart PC190HA Plug
  3744. // https://templates.blakadder.com/arlec_PC190HA.html
  3745. // -----------------------------------------------------------------------------
  3746. #elif defined(ARLEC_PC190HA)
  3747. // Info
  3748. #define MANUFACTURER "ARLEC"
  3749. #define DEVICE "PC190HA"
  3750. // Buttons
  3751. #define BUTTON1_PIN 14
  3752. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3753. #define BUTTON1_RELAY 1
  3754. // Relays
  3755. #define RELAY1_PIN 12
  3756. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3757. // LEDs
  3758. #define LED1_PIN 4 // blue LED
  3759. #define LED1_PIN_INVERSE 1
  3760. #define LED2_PIN 13 // red LED
  3761. #define LED2_PIN_INVERSE 1
  3762. // -----------------------------------------------------------------------------
  3763. // Arlec Smart PB89HA Power Strip
  3764. // https://templates.blakadder.com/arlec_PB89HA.html
  3765. // -----------------------------------------------------------------------------
  3766. #elif defined(ARLEC_PB89HA)
  3767. // Info
  3768. #define MANUFACTURER "ARLEC"
  3769. #define DEVICE "PB89HA"
  3770. // Buttons
  3771. #define BUTTON1_PIN 3
  3772. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3773. // Relays
  3774. #define RELAY1_PIN 5
  3775. #define RELAY2_PIN 4
  3776. #define RELAY3_PIN 13
  3777. #define RELAY4_PIN 12
  3778. // LEDs
  3779. #define LED1_PIN 1
  3780. #define LED1_PIN_INVERSE 1
  3781. // -----------------------------------------------------------------------------
  3782. // Prodino WIFI
  3783. // https://kmpelectronics.eu/products/prodino-wifi-v1/
  3784. // -----------------------------------------------------------------------------
  3785. #elif defined(PRODINO_WIFI)
  3786. // Info
  3787. #define MANUFACTURER "PRODINO"
  3788. #define DEVICE "WIFI"
  3789. // MCP23S08
  3790. #define MCP23S08_SUPPORT 1
  3791. // Relays
  3792. #define RELAY1_PIN 4
  3793. #define RELAY1_PIN_TYPE GPIO_TYPE_MCP23S08
  3794. #define RELAY2_PIN 5
  3795. #define RELAY2_PIN_TYPE GPIO_TYPE_MCP23S08
  3796. #define RELAY3_PIN 6
  3797. #define RELAY3_PIN_TYPE GPIO_TYPE_MCP23S08
  3798. #define RELAY4_PIN 7
  3799. #define RELAY4_PIN_TYPE GPIO_TYPE_MCP23S08
  3800. // Buttons
  3801. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3802. #define BUTTON1_PIN 0
  3803. #define BUTTON1_PIN_TYPE GPIO_TYPE_MCP23S08
  3804. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3805. #define BUTTON2_PIN 1
  3806. #define BUTTON2_PIN_TYPE GPIO_TYPE_MCP23S08
  3807. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3808. #define BUTTON3_PIN 2
  3809. #define BUTTON3_PIN_TYPE GPIO_TYPE_MCP23S08
  3810. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3811. #define BUTTON4_PIN 3
  3812. #define BUTTON4_PIN_TYPE GPIO_TYPE_MCP23S08
  3813. #define BUTTON1_RELAY 1
  3814. #define BUTTON2_RELAY 2
  3815. #define BUTTON3_RELAY 3
  3816. #define BUTTON4_RELAY 4
  3817. // LEDs
  3818. #define LED1_PIN 2
  3819. #define LED1_PIN_INVERSE 1
  3820. // -----------------------------------------------------------------------------
  3821. // Fcmila E27 7W RGB+W Bulb
  3822. // https://www.aliexpress.com/item/32925895199.html
  3823. // -----------------------------------------------------------------------------
  3824. #elif defined(FCMILA_E27_7W_RGBW)
  3825. // Info
  3826. #define MANUFACTURER "FCMILA"
  3827. #define DEVICE "E27_7W_RGBW"
  3828. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3829. // Light
  3830. #define LIGHT_CH1_PIN 4 // RED
  3831. #define LIGHT_CH2_PIN 12 // GREEN
  3832. #define LIGHT_CH3_PIN 14 // BLUE
  3833. #define LIGHT_CH4_PIN 5 // WHITE
  3834. // -----------------------------------------------------------------------------
  3835. // Benexmart 5W GU5.3 (MR16) RGBWW
  3836. // https://www.aliexpress.com/item/4001245365644.html
  3837. // -----------------------------------------------------------------------------
  3838. #elif defined(BENEXMART_GU53_RGBWW)
  3839. // Info
  3840. #define MANUFACTURER "BENEXMART"
  3841. #define DEVICE "GU53_RGBWW"
  3842. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3843. // Light
  3844. #define LIGHT_CH1_PIN 4 // RED
  3845. #define LIGHT_CH2_PIN 12 // GREEN
  3846. #define LIGHT_CH3_PIN 14 // BLUE
  3847. #define LIGHT_CH4_PIN 5 // WARM WHITE
  3848. #define LIGHT_CH5_PIN 13 // COLD WHITE
  3849. // LSC E27 10W White Bulb with TYLC6E ESP8266 module
  3850. // https://www.action.com/de-at/p/lsc-smart-connect-intelligente-led-lampe/
  3851. // -----------------------------------------------------------------------------
  3852. #elif defined(LSC_E27_10W_WHITE)
  3853. // Info
  3854. #define MANUFACTURER "LSC"
  3855. #define DEVICE "E27_10W_WHITE"
  3856. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3857. // Light
  3858. #define LIGHT_CH1_PIN 5 // WARM WHITE LED PWM PIN
  3859. #define LIGHT_CH1_INVERSE 0
  3860. #define LIGHT_CH2_PIN 4 // COLD WHITE LED PWM PIN
  3861. #define LIGHT_CH2_INVERSE 0
  3862. #else
  3863. #error "UNSUPPORTED HARDWARE!!"
  3864. #endif