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.

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