Dee – single channel light switch – firmware

HARDWARE

Hardware and setup for flashing is described in the following article:

FIRMWARE FEATURES

  • Control over MQTT broker.
  • State-report contains additional information of switches state – server gets informed if switch is actually pressed by user or not.
  • On ESP a Light-Sleep mode is activated, which allows to reduce consumption from 0.8w to 0.5w, without any side-effects on switches reaction.
  • Might be configured with some settings. It’s possible to invert manual switches.
  • It’s possible to adjust configuration without necessaty to uninstall and reflash module.

WORKING MODES

  • Red LED is on – module is powered on and firmware successfully initialized.
  • Blue LED blinks – module in configuration mode. At this moment open WiFi hotspot “Dee-xxxxx” is enabled. Configuration page can be accessed at IP 192.168.4.1. Or, if network connection isn’t lost, it’s possible to access configuration page at local IP address.
  • Blue LED is on – module in fully operating mode.

OPERATION CONTROLS

  • Has two operating modes: each manual switch state change triggers relay state change; or manual switch turns on/off light only if it moved to appropriate position.
  • Enter configuration mode: quickly press some switch 5 or more times.

CONFIGURATION

  • SSID, password – WiFi network connection.
  • mqtt server, port, client name, user, password – connection to MQTT broker. Note: Client name must be unique! This name also used for Access Point name, and as a Hostname.
  • mqtt output topic – topic for output of relay 1 current state. Value is 0/1 for off/on states. Additionally contains a manual switch state by providing a dot in the end.
    Examples:
    ‘0.’ – relay is off, switch is pressed.
    ‘1’ – relay is on, switch released.
    ‘1.’ – relay is on, switch pressed.
  • mqtt commands topic – topic for relay commands input.
  • respect switch stateswhen disabled, each manual switch state change triggers relay state change. When enabled – pressing manual switch, turns on relay. If relay already was on, then does nothing.
  • invert switch keys – inverts manual switch logic (also makes effect on mqtt output of ‘.’ symbol).

CONTROL COMMANDS

  • 1 – turn on light (closes relay).
  • 0 – turn off light (opens relay).
  • set – enter configuration mode. Analogue pressing ‘Pairing button’ or quick switch on-off more than 5 times.

SOURCES

See GitHub: https://github.com/ai91/dee

Note that it uses development branch of WiFiManager. This branch can start wifi-manager in non-blocking mode. In this mode the module remains fully operable and can be controlled with manual switches (for example if network wasn’t configured properly). Master-branch still doesn’t support this mode.

MORE

There is also a configuration example of MajorDoMo server (unfortunately in Russian only):

Leave a Reply