AIMS OF THE GUIDE
SOFTWARE COMPONENTS USED:
PHYSICAL DEVICES USED:
GUIDE MOST INDICATED FOR:
Notes and disclaimer
|Driving review: 2.1|
CAUTION: This command has been passed (although it is still in use) by the command DYNAMIC SLEEP.
One of these, the subject of this guide, is that of regulation (live) of electrical absorption of the components Sonoff thanks to the adoption and configuration of the command "SLEEP". These devices, although they do it in a very limited way, to work they consume electricity.
To give some examples, the Sonoff Dual R2 absorbs from factory 1,24 W, while the Sonoff S20 1,11 W. Obviously we are talking about the state of rest, when the relay is not energized. In this second scenario, even if only slightly, consumption increases further.
Since you can get to have in the profirst home automation too dozens of these devices, the theme of consumption becomes therefore crucial: often i Sonoff are introduced to switch off entire branches of the profirst domestic electricity network in order to reduce consumption: it is absurd to think that they are then the same Sonoff arapppay back an indirect cost.
Every device Sonoff presents a clock internal, cyclical, which acts as a metronome during the execution of the firmware which, in turn, carries out the functions for which it is designed.
Firmware developers Sonoff-Tasmota they had the intuition to introduce a "sleep" state - after each clock cycle - which has the consequence of significantly reduce the absorption of the device. In essence, the device gives a minimum of "responsiveness" to the execution of commands (the more extensive the SLEEP value is) compared to a less electrical absorption. This responsiveness is lost because, if a command is implemented during the brief instant of sleep, this command will not be implemented until the following clock cycle (max 50ms after). On the other hand, if the command is physically commanded (eg pressing the button), this command will be lost.
Set this dormant state around 50 milliseconds (a good tradeoff between energy saving and responsiveness) reduces consumption from ~ 1,1 W to ~ 0,6 W.
|Device||Sleep xnumx||Sleep xnumx||Sleep xnumx||Sleep xnumx|
|Sonoff Dual R2||1,24 W||0,84 W||0,76 W||0,68 W|
|Sonoff S20||1,11 W||0,77 W||0,59 W||0,51 W|
Measurements were made with:
- WiFi STA mode, enabled and connected (70% of signal)
- MQTT enabled and connected
- Syslog enabled and connected
Teleperiod 60for debugging
- open relays
- 24-56 hours of measurement for a more precise result.
As can be seen, a significant reduction in the value of SLEEP does not correspond to a reduction in savings linear, therefore it is also sufficient a low value for optimal results.
The use of this command is as follows:
|Sleep||View the current setting in progress (default: 0)|
|Sleep||0 / off||Disable the SLEEP function|
|Sleep||1 250 ..||Set the SLEEP function from 1 to 250 milliseconds, with 1 millisecond steps.|
The command can be executed - both in interrogation and in setting - via MQTT, interface Web e via serial. More information on the command mode are available here.
To execute the command via MQTT it is sufficient to use a client connected to the same broker to which the device to be configured is connected or directly through his MQTT console present on the firmware web interface ("Console").
An example of querying the proproperty on Sonoff Basic:
To set a SLEEP of 50 millisecond duration, the command is:
This behavior will remain until the command is executed:
cmnd/Sonoff/SLEEP off oppure cmnd/Sonoff/SLEEP 0
More information is available on the page dedicated to the topic in projet Sonoff-Tasmota present on GITHUB.
|ATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Sonoff (and more generally to devices ESP8266), for any doubt, question, information on the specific merit of these components.|