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.

5017 lines
162 KiB

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