NodeManager: plugin for a rapid development of battery-powered sensors

  • Mod

    @mar.conte put a capacitor on the PIR vcc/gnd and increase the size until it is stable.

  • @gohan
    Good idea Tanks

  • Contest Winner

    Hi, I've added a "How to contribute" section in the documentation of the dev release in case anybody is interested to contribute to this project:

    I'm not a git expert so I hope those instructions to have some sense 🙂

  • Contest Winner

    Pretty big enhancement in the development branch of NodeManager if anybody is interested. I spent quite a good amount of time working on the core code to introduce mainly two features opening up the door to a good list of enhancements.

    The first one is a sort of countdown utility. Can be based on the number of sleeping cycles or minutes. It detects automatically a sleeping node and instead of using millis sum up the sleep interval and reports when the time is over. This approach has been used to:

    • Allow different sensors reporting at different timeframes (e.g. by configuring a specific sensor to report every e.g. 5 minutes or 10 sleeping cycles instead of at the end of each cycle)
    • For output sensors optionally use the input value as an elapsed time (e.g. the output will be turned on and the input value will be used as a timer to turn it off automatically). For example by sending 3 to a relay, it will be turned on and after 3 minutes turned off automatically. Useful if you already know for how long the output should stay on.
    • For output sensors optionally set a safeguard (e.g. after a relay is set to on, turn it off automatically after 1 hour). Useful if e.g. you are controlling a boiler and you are afraid something could prevent the command to turn it off to reach the board.
    • Add timeframe option for reporting battery level (e.g. instead of reporting every 10 sleeping cycles, report every 1 hour regardless of how long is the sleeping cycles).

    The other big change is a an complete remote API. With the current version you could send to NodeManager's service child id a limited list of commands to change the behavior of the board remotely, mainly to alter the duration of the sleep cycle. In the development release instead, almost every function of both NodeManager AND of every sensor can be invoked remotely. This is done by sending a V_CUSTOM message with a function_id and optional value to pass along to the service child id or each sensor's child id. More details here:

    This development branch is available here:

  • Mod

    Do you think it may be possible to add the function to use a digital pin to power a PIR sensor to turn it on only when setting it armed? (to save a little power)

  • Why does the power manager use two pins to power the sensor? Could we just use one pin for Vcc, and assume that the GND is permanently connected?

  • But i'm trying to test a Pir of panasonic EKMB1201113 papirs series cost a bit but they have low power consumption
    1 to 100 microampers in sleep mode, just connect a 100 kohm resistance in pulldown and it is very precise up to 12 meters

    link text

  • Contest Winner

    @gohan interesting use case. I personally prefer to have the arm/disarm logic on the controller but I can understand there are also different situations. I've opened for this. Thanks for the suggestion!

  • Contest Winner

    @rakeshpai said in NodeManager: plugin for a rapid development of battery-powered sensors:

    Why does the power manager use two pins to power the sensor? Could we just use one pin for Vcc, and assume that the GND is permanently connected?

    I usually use the power pins when either I need to save power or I do not have vcc/gnd pins available on the arduino board. But yes, you're right, there are other scenarios to consider. I've opened for this. Thanks

  • Mod

    saving pins is always good 😄

  • Hello how can i enter the commands type 254; 200; 2; 0; 48; BATTERY in a lua script of domoticz?

  • Contest Winner

    @mar.conte said in NodeManager: plugin for a rapid development of battery-powered sensors:

    Hello how can i enter the commands type 254; 200; 2; 0; 48; BATTERY in a lua script of domoticz?

    Sorry, I don't use domoticz so I cannot help with that. I hope somebody else here will have an answer for you 🙂

  • Contest Winner

    Guys, @hek has been so kind to offer a dedicated section within the forum for NodeManager so feel free to open new topics directly under I hope this can facilitate new users to better find the answers they are looking for and you guys to follow the discussions in a smoother way without the need to jump here and there along the same long thread.

  • Contest Winner

    Hello All,
    I've just released on GitHub ( a hotfix (v1.5.1) for NodeManager in order to include the memory optimization improvements already part of the development version.
    This is to allow saving up to 20% of memory on a pro mini and prevent the board to crash or become unpredictable when approaching the memory limit. No new features or enhancements have been added to this hotfix.
    If instead interested in testing out the development version or contribute please refer to and

  • Contest Winner

    Hello, NodeManager's version 1.6 is almost ready. Plenty of new things and fixes are about to be available but I'd need some diverse testing before officially releasing it.

    The first step would be to ensure that what was working with the current version is still working with this new release 🙂

    All the new things are instead detailed here✓&q=milestone%3Av1.6 is%3Aclosed label%3Afixed and in the associated PRs.

    The code is available at

    Whoever is willing to give it a try, please report any issue directly on github whenever there is already an issue open or on otherwise.

    Ideally I'm targeting mid August for releasing a stable v1.6.

    Many thanks!

  • @user2684
    I'm using NM for all my projects and I really like it!
    Will NodeManager support APDS-9960 RGB and Gesture Sensor in the future?


  • Contest Winner

    @Getz99 thanks for your feedback! I've created to track this request. Keep in mind no new features will be part of v1.6 which should be released soon so I've added this to the v1.7 backlog. Thanks

  • @user2684 Thanks! I understand it will not be in v1.6, I'm waiting for that release!

  • Contest Winner

    Hi, kind of the the last chance to share any feedback regarding NodeManager v1.6-dev which is almost ready and should be out in a week or two.

    Instructions on how to test the pre-release and report issues here:


  • Contest Winner

    Hello All,

    NodeManager v1.6 is finally available! Download and upgrade instructions can be found as always on

    First of all I want to thank everybody contributing to the project, especially those who have submitted pull requests to the repository.

    In v1.6 we have 36 out-of-the-box sensors as well as a good number fixes and enhancements. The most notable are for sure the capability to customize any sensor remotely through a brand new remote API and a more flexible and effective way to configure reporting intervals and sleep cycles:

    • Introduced new remote API to allow calling almost ALL NodeManager's and its sensors' functions remotely
    • Reporting interval configuration is now indipendent from the sleep cycle
    • Reporting interval can be customized per-sensor
    • All intervals (measure/battery reports) are now time-based
    • Added support for BMP280 temperature and pressure sensor
    • Added support for RS485 serial transport
    • Added support for TSL2561 light sensor
    • Added support for DHT21 temperature/humidity sensor
    • Added support for AM2320 temperature/humidity sensor
    • Added support for PT100 high temperature sensor
    • Added support for MH-Z19 CO2 sensor
    • Added support for analog rain and soil moisture sensors
    • Added support for generic dimmer sensor (PWM output)
    • Added support for power and water meter pulse sensors
    • Radio signal level (RSSI) is now reported automatically like the battery level
    • SensorRainGauge now supports sleep mode
    • SensorSwitch now supports awake mode
    • SensorLatchingRealy now handles automatically both on and off commands
    • SensorMQ now depends on its own module
    • Added safeguard (automatic off) to SensorDigitalOutput
    • Any sensor can now access all NodeManager's functions
    • DHT sensor now using MySensors' DHT library

    For those who have previously forked the repository, please ensure to merge the updated development branch first before submitting any new PR.


  • @user2684


    thanks again for your great work!

    As I said, I will try to include my Chirp module into 1.7 via a github branch/fork. You wrote in your explanation of "contributing to the code", that it is not allowed, to change config.h. But how should I include the lines for the chirp sensor?
    And in wich way can the documentation be modified? (chirp sensor paramaters)

    Best regards


  • Contest Winner

    @betonmoewe if I wrote that config.h cannot be changed, I wrote something wrong 🙂 You can change whatever of course, just keep changes to config.h and the main sketch to the minimum since those can only be upgraded manually and not just by replacing the files. To add a new sensor, have a look at one of the existing sensors. Documentation can be updated as well by changing the README file. Should you have any doubt or issue feel free to open a new thread on Thanks!

  • When do you plan to release V1.7 ?

  • Contest Winner

    @vikasjee realistically it will take a while unfortunately 😞 I'm now spending most of my little spare time on which is kind of difficult to fix. Only after I will go through the (long) list of fixes/requests queued for v1.7 🙂

  • Contest Winner

    @vikasjee FYI the blocking issue which was slowing down v1.7 development has been solved now ( Still a long way to get there but at least a bit closer now 🙂

  • Hi @user2684
    Is it possible to add sensor MG996R Servo in V1.7? I know the list is long for fixes but it would be nice if you could squeeze it in.


  • Contest Winner

    @getz99 I've added this feature request for this:


  • @user2684 Thanks, Very much appreciated!

  • Plugin Developer

    I grabbed the latest development branch tonight to try this out. I saved the NodeManager.ino as a new name and copied the NodeManagerLibrary.h and NodeManagerLibrary.ino files into the new folder. I enabled USE_DIGITAL_OUTPUT and added a SensorDigitalOutput and SensorRelay child in my sketch and tried to compile. Unfortunately I got these errors:

    In file included from ino:244:0:
    sketch/NodeManagerLibrary.h:549:27: error: 'SR_RX_RSSI' was not declared in this scope
         int _signal_command = SR_RX_RSSI;
    /NodeManagerLibrary.ino: In member function 'virtual void SensorSignal::onLoop(Child*)':
    /NodeManagerLibrary.ino:741:45: error: 'signalReport_t' was not declared in this scope
       int16_t value = transportGetSignalReport((signalReport_t)_signal_command);
    /NodeManagerLibrary.ino:741:75: error: 'transportGetSignalReport' was not declared in this scope
       int16_t value = transportGetSignalReport((signalReport_t)_signal_command);
    exit status 1
    Error compiling for board Arduino Nano.

    All seems to be related to signal reports but even if I disable signal reporting the errors still occur. Guessing I did something wrong so any ideas would be appreciated.


  • Contest Winner

    @jsiddall thanks for this hit, the issue seems to be related to SR_RX_RSSI which is only available with 2.2.0-beta version of the MySensors library, not 2.1.1 which I guess you are using. Something which needs to be fixed on the NodeManager's side, I've opened for this. Thanks

  • Plugin Developer

    @user2684 Great, thanks for the quick response.

    UPDATE: Confirmed, all is good with MyS 2.2.0-rc2. Not sure what resolution you had in mind for issue #256 but a note in the installation section of this page:

    ...stating the required version of MyS for both the stable and dev versions of NodeManager would probably have been enough to keep me out of trouble!

    Thanks again for NodeManager. It does everything I had been doing manually before, using pages of sketch, and shrinks it down to a few simple lines.

  • Contest Winner

    @jsiddall thanks, fixed in the development branch right now. Adding a compatibility table between NodeManager and the MySensors library version sounds like a good idea, I've added for this. Thanks again

  • GHi, the rfm95 is compatible with nodemanager?
    And the esp32 also?

  • Contest Winner

    @mar-conte everything supported by the core MySensors library is supported by NodeManager since using the same code behind the scene but I'll add some default defines in the main sketch to make this configuration easier ( Thanks

  • @user2684
    Ok Tanks

  • I need help!!!
    I have e mcp23017 Matrix espander i/o in esp nodemecu board, the mcp receive state sensor from my system wired alarm(pir, sismic etc) ; this signal received i want send to my domoticz controller, is the sensor custom the solution? Can i present 16 input sensors from my node to my controller?

  • Contest Winner

    @mar-conte if using NodeManager, this is still not possible since mcp23017 is not supported by NodeManager yet. Thanks!

  • @user2684
    For example using text send if i receive state?

  • Contest Winner

    Hi, for anybody interested in giving the upcoming NodeManager v1.7 a try or share a feedback, please have a look at Thanks!

  • Contest Winner

    Hi, the new version of NodeManager (v1.7) is now available! For those interested in having a look at the new features, supported sensors and capabilities, I've opened a dedicated thread on the forum here

  • @user2684 this project is awesome! Thank you for your work and efforts. Just one question: what exactly is needed for "built-in battery reporting" hardware-wise? is it really "built-in" or do i need additional wiring and resistors for battery reporting? (I'll want to power up my 3.3V Arduino Pro mini with 2 AA cells)

  • Mod

    since you are using 2AA batteries it can report voltage directly, in case you had any voltage regulator or booster it would require external resistors

  • Thank you very much. BTW: Is it possible to use Nodemanager with two, three or even four door sensors on a single ESP8266 (as Gateway without NRF radio)? Any help very appreciated!

  • Contest Winner

    @grau the current door sensor implementation (SensorDoor class) leverages attachInterrupt(); not sure how many interrupt pins are there on a ESP8266 but if there are enough it should work

  • @user2684 Hello all of You,
    this topic is quite old, but hopefully someone is reading this.
    I could not figure out, what to do if the NRF24 is wired to different pins.
    I have a board with nrf24 on board, but this are connected like:
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    #define MY_RF24_CE_PIN 7
    #define MY_RF24_CS_PIN 10
    #define MY_SOFT_SPI_SCK_PIN 11
    #define MY_SOFT_SPI_MOSI_PIN 12
    #define MY_SOFT_SPI_MISO_PIN 13
    How can this be inplemented in the nodemanager?

  • Contest Winner

    @rpunkt just use those directives in your sketch, no differences with NodeManager, those will be seen by the MySensors library and applied. Thanks

  • @user2684 Thanks a lot. I should have tried this, before to post a question, but sometimes the brain is sticky.

  • Hello all of You,
    if have a flight time sensor VL53L0X, that is running so far.
    It should measure the water level in a rain tank.
    But now i want to customize my sensornode in that way, that two other values will be transmitted.
    It should be
    V_level, that represents the percentage of my water tank
    V_volume, that represents the available volume of water
    V_level and V_volume could be calculated from the sensor value of the distance sensor (VL53L0X).
    But somehow I could not manage to to get this running. I don't know where to insert what.
    Cant someone point me to the right direction, help appreciated

    * The MySensors Arduino library handles the wireless radio link and protocol
    * between your home built sensors/actuators and HA controller of choice.
    * The sensors forms a self healing radio network with optional repeaters. Each
    * repeater and gateway builds a routing tables in EEPROM which keeps track of the
    * network topology allowing messages to be routed to nodes.
    * Created by Henrik Ekblad <>
    * Copyright (C) 2013-2017 Sensnology AB
    * Full contributor list:
    * Documentation:
    * Support Forum:
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * version 2 as published by the Free Software Foundation.
    This sketch can be used as a template since containing the most relevant MySensors library configuration settings, 
    NodeManager's settings, all its the supported sensors commented out and a sketch structure fully functional to operate with
    NodeManager. Just uncomment the settings you need and the sensors you want to add and configure the sensors in before()
     * MySensors node configuration
    // General settings
    #define SKETCH_NAME "NodeManager"
    #define SKETCH_VERSION "1.0"
    //#define MY_DEBUG
    #define MY_NODE_ID 8
    // NRF24 radio settings
    #define MY_RADIO_NRF24
    #define MY_RF24_CE_PIN 7
    #define MY_RF24_CS_PIN 10
    #define MY_SOFT_SPI_SCK_PIN 11
    #define MY_SOFT_SPI_MOSI_PIN 12
    #define MY_SOFT_SPI_MISO_PIN 13
    // Advanced settings
    #define MY_BAUD_RATE 9600
     * MySensors gateway configuration
    // Common gateway settings
     * NodeManager configuration
    // import NodeManager library (a nodeManager object will be then made available)
    #include <MySensors_NodeManager.h>
     * Add your sensors
    //PowerManager power(5,6);
    #include <sensors/SensorBattery.h>
    SensorBattery battery;
    //#include <sensors/SensorConfiguration.h>
    //SensorConfiguration configuration;
    #include <sensors/SensorSignal.h>
    SensorSignal signal;
    #include <sensors/SensorVL53L0X.h>
    SensorVL53L0X vl53l0x(9);
     * Main Sketch
    // before
    void before() {
       * Configure your sensors
      // EXAMPLES:
      // report measures of every attached sensors every 10 seconds
      void setADCOff();
      // call NodeManager before routine
    // presentation
    void presentation() {
      // call NodeManager presentation routine
    // setup
    void setup() {
      // call NodeManager setup routine
    // loop
    void loop() {
      // call NodeManager loop routine
    // receive
    void receive(const MyMessage &message) {
      // call NodeManager receive routine
    // receiveTime
    void receiveTime(unsigned long ts) {
      // call NodeManager receiveTime routine

  • Contest Winner

    @rpunkt my recommendation would be to create a custom sensor in NodeManager which is implementing the logic you like. Feel free to copy from and create your own or make your own class by inheriting directly from SensorVL53L0X.

  • @user2684 Seems to be to difficult for a rookie 😭
    On the conventional MySensors library it is possible with my abilities, but then the power management is a issue.
    For me the NodeManager was the choice, because it saves so much battery energy.
    Other way of solution:
    A friend of mine, convinced me off doing all the calculations in the home- automation (in my case FHEM).
    Now I only use the node transmitting the distance and calculating the "volume of water" and "percentage of water" as a "user reading".

  • Hello @user2684 et al,

    I'm trying to use this library on an ESP32 board. I'm trying this sketch out (

    My problem is that if I just try to use the 1.8 version of NodeManager it will use as a dependency a version of MySensors which do not work with ESP32 and I get a known error regarding re-definition of app_main. Because of that I need to use the development version of MySensors but it seems not compatible with NodeManager 1.8 as I get the following error:

    In file included from .pio/libdeps/nodemcu-32s/MySensors/MySensors.h:43:0,
                     from .pio/libdeps/nodemcu-32s/NodeManager/MySensors_NodeManager.h:43,
                     from src\main.cpp:60:
    .pio/libdeps/nodemcu-32s/MySensors/MyConfig.h:288:2: warning: #warning MY_RADIO_NRF24 is deprecated, use MY_RADIO_RF24 instead. [-Wcpp]
     #warning MY_RADIO_NRF24 is deprecated, use MY_RADIO_RF24 instead.
    In file included from .pio/libdeps/nodemcu-32s/NodeManager/MySensors_NodeManager.h:87:0,
                     from src\main.cpp:60:
    .pio/libdeps/nodemcu-32s/NodeManager/nodemanager/Sensor.cpp: In member function 'void Sensor::presentation()':
    .pio/libdeps/nodemcu-32s/NodeManager/nodemanager/Sensor.cpp:135:54: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'mysensors_sensor_t' [-fpermissive]
       present(child->getChildId(), child->getPresentation(), child->getDescription(), nodeManager.getAck());
    In file included from .pio/libdeps/nodemcu-32s/MySensors/MySensors.h:433:0,
                     from .pio/libdeps/nodemcu-32s/NodeManager/MySensors_NodeManager.h:43,
                     from src\main.cpp:60:
    .pio/libdeps/nodemcu-32s/MySensors/core/MySensorsCore.cpp:375:6: note:   initializing argument 2 of 'bool present(uint8_t, mysensors_sensor_t, const char*, bool)'   
     bool present(const uint8_t childSensorId, const mysensors_sensor_t sensorType,
    *** [.pio\build\nodemcu-32s\src\main.cpp.o] Error 1

    I have also tried using the development version of NodeManager with the development version of MySensors although I get the same result.
    I'm stuck and I would really appreciate any input.

    Thanks in advance!

  • Contest Winner

    @justfra thanks for reporting this issue, I believe there is some sort of library conflicts which is arising across MySensors/Nodemanager versions...something which has to be investigated carefully, I'll track this bug with

  • Oh, I hate saying I've noticed this great piece of software just now! 😞 It would have saved me countless hours of software tinkering, giving more eyecare for better soldering...!

  • Contest Winner

    @justfra realizing only now the issue you reported was not ESP32 related but due to a compatibility issues between MySensors v2.3.2 and NodeManager just fixed in the development version with Either try the latest development version of NodeManager or use MySensors v2.3.1. Thanks

Log in to reply

Suggested Topics

  • 2
  • 8
  • 4
  • 2
  • 2
  • 2