This macro defines how Z-Uno will manage power mode. It is very important to define correct mode because the behavior of the device changes dramatically depending on it. At the start, we recommend you to debug and develop your program using ZUNO_SLEEPING_MODE_ALWAYS_AWAKE mode, because that’s the easiest one.

If not specified in the project, ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE) is assumed.
ZUNO_SETUP_SLEEPING_MODE(mode) mode Mode to manage power There is only three possible values available:
  • ZUNO_SLEEPING_MODE_ALWAYS_AWAKE — device is always awake, reachable and helps to form mesh network acting as router (default mode). Used for mains powered devices.
  • ZUNO_SLEEPING_MODE_SLEEPING — device wakes up by user request (interrupt) or periodically. Does not help to form mesh. Used for battery powered devices.
  • ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE — device wakes up by user request (interrupt) or on packet received. Always available but does not help to form mesh. Used for battery powered devices. In Z-Wave this type of devices is called FLiRS
FLiRS — Frequently Listening Routing Slaves — the device periodically quits the sleeping mode on a short period and checks, whether a message is sent to the device. If no packets are present for this device on air, the device goes back into the sleeping mode. Awakening interval is 1 second.
In sleeping mode periodical wakeup is configured via the Z-Wave controller using the Wake Up Command Class. The period is a factor of 4 minutes, minumum is 4 minutes. Interrupt can wake up the device at any time. Note that in sleeping and FLiRS mode devices should be explicitely sent into sleeping state. This is done using zunoSendDeviceToSleep() function. Once called, loop will not be called anymore and Z-Uno will finalize all jobs to go into sleep mode. Note that in sleeping and FLiRS mode during power consumption (deep sleep) state Z-Uno memory is not maintained. Hence it is cleaned all the time. If you want to keep some variables across sleeps you have to use NZRAM memory (very fast and do not consume enery) or EEPROM (slow and takes energy to read and write, but survive even during power off - this is a so called non-volatile memory). If device is in sleeping mode, the USB port is not available for uploading new sketch. Device should be woken up or turned into rescue mode before uploading new sketch. After changing sleeping mode Z-Uno must be excluded and included back. Z-Uno will not adopt sleeping mode change without being excluded. (A debug configuration parameter can disable this restriction).
Mode setup() called loop() called Wakes up Routing for other Z-Wave devices
on interrupt periodically on command received
ZUNO_SLEEPING_MODE_ALWAYS_AWAKE once after power on eternally Yes
ZUNO_SLEEPING_MODE_SLEEPING on each wake up until zunoSendDeviceToSleep() is called Yes Yes No No
ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE on each wake up until zunoSendDeviceToSleep() is called Yes No Yes No
Get more information about Z-Wave.