Hardware
Hardware and setup for flashing is described in the following article:
Firmware features
- Control over MQTT broker.
- Approximately knows state/position of blinds. Fully opened blinds – is zero-position. Once close-switch is pressed for one second – it’s position 1. Every time switch button is pressed, the module calculates time of operation and updates position state (and pushes value to MQTT queue). Means server-side gets info about current position of blinds (fully opened, half-closed, or fully-closed), and can send more precise commands to control blinds. It’s posible to send a command for relative positioning (like “close down-relay for 3 seconds”), or for absolute positioning (“move blinds to the position of 6 seconds from fully-opened”. In this case module will automatically adjust position from current state, without necessity to fully open in advance – it simply makes minimum-required movement to get into desired state). Due to fact that position is calculated by module itself, rather than server, network communication is not a problem at all (unstable network, laggy MQTT broker, etc).
- Also state-report contains additional information of switches state – server gets informed if any of switches 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 zero-position, swap switches and relays.
- It’s possible to adjust configuration without necessaty to uninstall and reflash module.
Working modes
- LED blinks – module is in configuration mode. At this moment open WiFi hotspot “Dorfl-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.
- LED is on – module is in fully operating mode.
Operation controls
- Lock remote control in fully opened/closed state: if keep manual switch pressed, the remote control is blocked.
- Lock remote control at any position: turn switches off, then quickly press switch on, press off, then again press on and keep in this state (off->on-off-on). At this moment remote control gets blocked and relay remains in open state.
- Enter configuration mode: quickly press some switch 5 or more times.
- Even if some manual switch remains pressed forever, relay gets automatically opened after MaxPos seconds.
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 position output topic – topic for output of current curtain position. Value is always in range [0, MaxPos]. Value is an integer with amount of seconds from completely open blinds. Usually it’s written on relay open (after blinds movement is done), but when triggered with manual switch – also on trigger time. When triggered with manual switch, it also contains a dot in the end.
Examples:
‘0’ – blinds fully open.
’30’ – blinds at position 30 (means was closing at least for 30 seconds. But can be more, if MaxPos = 30)
’30.’ – position 30 seconds and switch is pushed. (i.e. remote control is blocked). - mqtt commands topic – topic for commands input.
- blinds max pos – maximum blinds position (MaxPos).
- invert zero-position – inverts relays for open/close direction. By default L1 is for opening, L2 for closing.
- invert switch keys – inverts manual switch logic. By default S1 is for opening, S2 for closing.
- disable manual lock – when set, the “Lock at specific position” is disabled. Experimental, to get rid of potential problems when it interferes with normal work.
Control commands
mvr<XXX>
– move to relative position XXX. XXX can be negative. If XXX negative – it moves curtain UP (closes L1 relay). If positive – DOWN (L2 relay). Absulute value of XXX – is amount of seconds to keep closed relay.
Examples:mvr5
– close relay L2 for 5 seconds (closing curtains)mvr-60
– close relay L1 for 60 seconds (opening curtains)mvr0
– open both relays. I.e. stop curtains.
Note: module takes care of conflicts and guaratees only one relay can be closed at a time. I.e. sequentalmvr5
mvr-5
won’t burn engine, rather terminates/cancels first command.mva<XXX>
– move to absolute position XXX. XXX can be negative or any big number. If XXX is out of range of curtains [0, MaxPos], then after XXX seconds it will be set to 0 or MaxPos.
Examples:mva0
– fully open curtains.mva5
– move curtains from current position to position 5 seconds from fully-open position. If current position is 3, then it will keep L2 closed for 2 seconds. If current position is 9, then will keep L1 closed for 4 seconds.mva60
– fully close curtains. Will be keeping L2 closed for 60 seconds, then position value will be set to MaxPos.mva-60
– fully open curtains. Will be keeping L1 for 60 seconds, then position value will be set to 0.set
– enter configuration mode. Analogue pressing ‘Pairing button’ or quick switch on-off more than 5 times.
Sources
See GitHub: https://github.com/ai91/dorfl/
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):