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.

4989 lines
161 KiB

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