Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
T

tubby

@tubby
About
Posts
9
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SensorMotion to send both tripped and not tripped
    T tubby

    @gohan How would I implement that?
    I only see options for overall sleep time, none that allow me different sleep time for only when the pin is high.

    I'm sorry for all these questions, I feel like an idiot, but I'm so close to getting all the sensors that I need on one board. That I would have no hope of configuring without node manager.

    One hurdle left...

    NodeManager

  • SensorMotion to send both tripped and not tripped
    T tubby

    @user2684 exactly what I thought about the (change) .

    I have a test rig setup at the moment and I have been pulling the pin high and low manually with a jumper wire.
    I've held the pin high for up to 30 seconds.
    The node sends a high value. Than the sleep msg.
    Up to 30 seconds latter I disconnect the high and connect to low but nothing happens, the node just sleeps either till the amount in the timer or if the pin is pulled high again.

    I imagine this is the sort of behaviour you would see with a (rising) state

    NodeManager

  • SensorMotion to send both tripped and not tripped
    T tubby

    @user2684 I really appreciate the help.
    and now I'm able to use all the extra inbuilt features of the code, now that i know how to add them to the sketch.

    And I hate to be a pain but I cant seem to get this damn motion sensor to work properly.
    I've tried the examples you have given me, I've played around with every possible thing I can think/read.
    But for the life of me cant get it to send a (0) for non tripped.

    I assume the (CHANGE) interrupt option should be sending a msg on a motion detect ie: (1)
    and then when the pin goes low it should send a (0), but it seem that the node has already gone to sleep and the changed state is not being recorded.

    What else could I try?

    NodeManager

  • SensorMotion to send both tripped and not tripped
    T tubby

    Thanks guys got it running.
    after a lot of stuffing around

    the problem I'm having now is the controller always say that its tipped (Using home assistant)
    It looks to me that the node doesn't send an off trip, only an on.

    here is my node output

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    3 MCO:BGN:BFR
    REG I=1 P=3 P=1 T=16
    NodeManager v1.5
    INT1 M=3
    INT2 M=255
    6 TSM:INIT
    10 TSF:WUR:MS=0
    17 TSM:INIT:TSP OK
    19 TSF:SID:OK,ID=1
    21 TSM:FPAR
    57 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2064 !TSM:FPAR:NO REPLY
    2066 TSM:FPAR
    2102 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2928 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    2933 TSF:MSG:FPAR OK,ID=0,D=1
    4110 TSM:FPAR:OK
    4111 TSM:ID
    4112 TSM:ID:OK
    4114 TSM:UPL
    4117 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    4126 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    4131 TSF:MSG:PONG RECV,HP=1
    4134 TSM:UPL:OK
    4135 TSM:READY:ID=1,PAR=0,DIS=1
    4141 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    4147 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    4154 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
    4163 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    4802 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    RADIO OK
    4809 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:NodeManager
    4818 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    PRES I=200, T=23
    4827 TSF:MSG:SEND,1-1-0-0,s=200,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=OK:
    PRES I=201, T=30
    4835 TSF:MSG:SEND,1-1-0-0,s=201,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
    BATT V=4.57 P=100
    SEND D=0 I=201 C=0 T=38 S= I=0 F=4.57
    4912 !MCO:SND:NODE NOT REG
    4920 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:100
    PRES I=1 T=1
    4928 TSF:MSG:SEND,1-1-0-0,s=1,c=0,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
    READY
    
    4934 MCO:REG:REQ
    4937 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    4951 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    4956 MCO:PIM:NODE REG=1
    4958 MCO:BGN:STP
    MY I=1 M=1
    4960 MCO:BGN:INIT OK,TSP=1
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=0 T=16 S= I=1 F=0.00
    4966 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    4973 MCO:SLP:MS=60000,SMS=1,I1=1,M1=3,I2=255,M2=255
    4980 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:21
    5487 MCO:SLP:TPD
    5488 MCO:SLP:WUP=1
    WAKE P=3, M=3
    AWAKE
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
    5493 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    5502 MCO:SLP:MS=60000,SMS=1,I1=1,M1=3,I2=255,M2=255
    5510 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:551
    6017 MCO:SLP:TPD
    6018 MCO:SLP:WUP=1
    WAKE P=3, M=3
    AWAKE
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
    6023 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    6032 MCO:SLP:MS=60000,SMS=1,I1=1,M1=3,I2=255,M2=255
    6039 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:1080
    6546 MCO:SLP:TPD
    6547 MCO:SLP:WUP=1
    WAKE P=3, M=3
    AWAKE
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
    6552 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    6561 MCO:SLP:MS=60000,SMS=1,I1=1,M1=3,I2=255,M2=255
    6568 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:1609
    7076 MCO:SLP:TPD
    7077 MCO:SLP:WUP=1
    WAKE P=3, M=3
    AWAKE
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
    7083 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    7092 MCO:SLP:MS=60000,SMS=1,I1=1,M1=3,I2=255,M2=255
    7099 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:2140
    7606 MCO:SLP:TPD
    7607 MCO:SLP:WUP=1
    WAKE P=3, M=3
    AWAKE
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
    7612 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    7621 MCO:SLP:MS=60000,SMS=1,I1=1,M1=3,I2=255,M2=255
    7628 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:2669
    8135 MCO:SLP:TPD
    8136 MCO:SLP:WUP=1
    WAKE P=3, M=3
    AWAKE
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
    8141 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    8151 MCO:SLP:MS=60000,SMS=1,I1=1,M1=3,I2=255,M2=255
    8158 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:3199
    8665 MCO:SLP:TPD
    8666 MCO:SLP:WUP=1
    WAKE P=3, M=3
    AWAKE
    SWITCH I=1 P=3 V=1
    SEND D=0 I=1 C=1 T=16 S= I=1 F=0.00
    8671 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    SLEEP 60s
    
    

    is this correct? Looks to me that the node sends a (1) when tripped but not a (0) when motion stops.
    This makes my controller think that there is constant motion

    NodeManager

  • SensorMotion to send both tripped and not tripped
    T tubby

    @user2684 thanks mate.
    Ill try that tommorrow.

    Really wish I know how to code, but I just don't know where to start.

    NodeManager

  • SensorMotion to send both tripped and not tripped
    T tubby

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

    I have a couple of AM312 sensors around here and they are working ok without any debounce or trigger time, I guess I've been just lucky :) The only issue I had has been a lot of false positives when placed outside and the light changing (e.g. the sun shines over them) but I think this is somehow expected.

    @mar.conte in your example you are creating a switch object, adjusting its settings but then NOT using it since when yo call register sensor it will create and register a new object :)
    Either you call register sensor and then retrive the object in this way:

    nodeManager.setSleep(SLEEP,60,MINUTES); 
    sensor_id = nodeManager.registerSensor(SENSOR_MOTION,3);
    
    SensorMotion* sensorMotion = ((SensorMotion*)nodeManager.getSensor(sensor_id));
    
    sensorMotion->setDebounce(50);
    sensorMotion->setTriggerTime(4000);
    
    

    Or you create your own sensor, adjust the settings and register it by passing the object's instance but then you also need to setup the interrupt manually so I'd recommend the option just above. In your example (if this is what you are using) you basically have a standard sensor with neither debounce nor triggertime set :)

    I appreciate the help.
    Ive tried adding your code to my sketch but I get this error.

    Arduino: 1.8.1 (Windows 10), Board: "Arduino Nano, ATmega328"
    
    In file included from C:\Users\Daniel\Documents\NodeManager_testing_motion\NodeManager_testing_motion.ino:24:0:
    
    sketch\NodeManager.h:388:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    
         char* _description = "";
    
                              ^
    
    sketch\NodeManager.h:400:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    
         char * _value_string = "";
    
                                ^
    
    sketch\NodeManager.h:403:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    
         char * _last_value_string = "";
    
                                     ^
    
    C:\Users\Daniel\Documents\NodeManager_testing_motion\NodeManager_testing_motion.ino: In function 'void before()':
    
    NodeManager_testing_motion:36: error: 'sensor_id' was not declared in this scope
    
       sensor_id = nodeManager.registerSensor(SENSOR_MOTION,3);
    
       ^
    
    exit status 1
    'sensor_id' was not declared in this scope
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    

    'sensor_id' was not declared in this scope..
    Is the error that stops it from compiling, I always get the other errors when compiling but the sensor still works, tested on dht sensor (but this may be the problem)

    I'm guessing i'm missing something in the sketch.
    I'm really sorry for the pathetic questions.

    With this basic sketch:

    /*
    NodeManager is intended to take care on your behalf of all those common tasks a MySensors node has to accomplish, speeding up the development cycle of your projects.
    
    NodeManager includes the following main components:
    - Sleep manager: allows managing automatically the complexity behind battery-powered sensors spending most of their time sleeping
    - Power manager: allows powering on your sensors only while the node is awake
    - Battery manager: provides common functionalities to read and report the battery level
    - Remote configuration: allows configuring remotely the node without the need to have physical access to it
    - Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line 
    
    Documentation available on: https://github.com/mysensors/NodeManager
     */
    
     
    // load user settings
    #include "config.h"
    // include supporting libraries
    #ifdef MY_GATEWAY_ESP8266
      #include <ESP8266WiFi.h>
    #endif
    // load MySensors library
    #include <MySensors.h>
    // load NodeManager library
    #include "NodeManager.h"
    
    // create a NodeManager instance
    NodeManager nodeManager;
    // before
    void before() {
      // setup the serial port baud rate
      Serial.begin(MY_BAUD_RATE);  
      /*
       * Register below your sensors
      */
      nodeManager.setSleep(SLEEP,1,MINUTES); 
      sensor_id = nodeManager.registerSensor(SENSOR_MOTION,3);
    
      SensorMotion* sensorMotion = ((SensorMotion*)nodeManager.getSensor(sensor_id));
    
      sensorMotion->setDebounce(50);
      sensorMotion->setTriggerTime(4000);
    
      
      /*
       * Register above your sensors
      */
      nodeManager.before();
    }
    
    // presentation
    void presentation() {
      // call NodeManager presentation routine
      nodeManager.presentation();
    }
    
    // setup
    void setup() {
      // call NodeManager setup routine
      nodeManager.setup();
    }
    
    // loop
    void loop() {
      // call NodeManager loop routine
      nodeManager.loop();
    
    }
    
    // receive
    void receive(const MyMessage &message) {
      // call NodeManager receive routine
      nodeManager.receive(message);
    }
    
    // receiveTime
    void receiveTime(unsigned long ts) {
      // call NodeManager receiveTime routine
      nodeManager.receiveTime(ts);
    }
    
    
    

    I get this node log on serial:

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    3 MCO:BGN:BFR
    REG I=1 P=2 P=1 T=16
    NodeManager v1.5
    INT1 M=255
    INT2 M=3
    6 TSM:INIT
    10 TSF:WUR:MS=0
    17 TSM:INIT:TSP OK
    19 TSF:SID:OK,ID=1
    21 TSM:FPAR
    57 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    1125 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    1130 !TSF:MSG:PONG RECV,INACTIVE
    2064 !TSM:FPAR:NO REPLY
    2066 TSM:FPAR
    2102 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2120 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    2125 TSF:MSG:FPAR OK,ID=0,D=1
    3100 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    4110 TSM:FPAR:OK
    4111 TSM:ID
    4112 TSM:ID:OK
    4114 TSM:UPL
    4117 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    6124 TSM:UPL
    6126 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    6458 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    6463 TSF:MSG:PONG RECV,HP=1
    6465 TSM:UPL:OK
    6467 TSM:READY:ID=1,PAR=0,DIS=1
    6471 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    6478 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    6483 !TSF:MSG:PONG RECV,INACTIVE
    6490 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    6497 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
    6505 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    RADIO OK
    8513 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:NodeManager
    8522 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    PRES I=200, T=23
    8563 !TSF:MSG:SEND,1-1-0-0,s=200,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=NACK:
    PRES I=201, T=30
    8605 !TSF:MSG:SEND,1-1-0-0,s=201,c=0,t=30,pt=0,l=0,sg=0,ft=1,st=NACK:
    BATT V=4.57 P=100
    SEND D=0 I=201 C=0 T=38 S= I=0 F=4.57
    8683 !MCO:SND:NODE NOT REG
    8725 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=2,st=NACK:100
    PRES I=1 T=1
    8767 !TSF:MSG:SEND,1-1-0-0,s=1,c=0,t=1,pt=0,l=0,sg=0,ft=3,st=NACK:
    READY
    
    8773 MCO:REG:REQ
    8811 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=4,st=NACK:2
    10818 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=5,st=OK:2
    12825 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    13209 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    13214 MCO:PIM:NODE REG=1
    13216 MCO:BGN:STP
    MY I=1 M=1
    13218 MCO:BGN:INIT OK,TSP=1
    SLEEP 60s
    
    13222 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    13230 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:12
    13236 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    13241 MCO:PIM:NODE REG=1
    13736 MCO:SLP:TPD
    13737 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    13741 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    13748 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:530
    14254 MCO:SLP:TPD
    14255 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    14258 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    14265 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:1047
    14772 MCO:SLP:TPD
    14773 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    14776 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    14783 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:1565
    15290 MCO:SLP:TPD
    15291 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    15294 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    15337 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=NACK:2083
    15843 MCO:SLP:TPD
    15844 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    15847 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    15890 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=1,st=NACK:2636
    16396 MCO:SLP:TPD
    16397 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    16400 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    16443 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=2,st=NACK:3189
    16949 MCO:SLP:TPD
    16950 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    16953 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    16960 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=3,st=OK:3742
    17467 MCO:SLP:TPD
    17468 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    17471 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    17478 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:4260
    17985 MCO:SLP:TPD
    17986 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    17989 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    17996 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:4778
    18503 MCO:SLP:TPD
    18504 MCO:SLP:WUP=-2
    AWAKE
    BATT V=4.61 P=100
    SEND D=0 I=201 C=0 T=38 S= I=0 F=4.61
    18615 !TSF:MSG:SEND,1-1-0-0,s=201,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=NACK:4.61
    18658 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=1,st=NACK:100
    SLEEP 60s
    
    18665 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    18707 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=2,st=NACK:5454
    19214 MCO:SLP:TPD
    19215 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    19218 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    19261 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=3,st=NACK:6007
    19767 MCO:SLP:TPD
    19768 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    19771 MCO:SLP:MS=60000,SMS=1,I1=255,M1=255,I2=0,M2=3
    19814 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=4,st=NACK:6560
    20320 MCO:SLP:TPD
    20321 MCO:SLP:WUP=-2
    AWAKE
    SLEEP 60s
    
    

    I know I'm loosing a lot of communication but, I'm just trying to test at the moment.

    Oh and I don't have any sensors connected to this node at the moment, so there is no PIR sending pin high.
    the voltage between ground and pin 2 is 0.28v

    I'm really struggling with this.

    If I run the mysensors example it works as expected.

    any help would be much appreciated

    NodeManager

  • SensorMotion to send both tripped and not tripped
    T tubby

    @mar.conte thanks for the reply.
    I've read that adding the debounce helps, but I just don't know how to add it to the sketch.
    I'm arduino/coding illiterate I manage to bluff my way through most things but this one has me stuffed.

    Where and how do I add debounce to my sketch?

    NodeManager

  • SensorMotion to send both tripped and not tripped
    T tubby

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

    @mar.conte great to hear it is working now! For anybody else interested in these parameters, setDebounce() will set a debounce interval, e.g. the value of the input is checked after the interval from the wakeup so to avoid false positives, while seTriggerTime() ignore any input after the pir has triggered to avoid the sensor to trigger continuously. Btw, very nice and clean packaging!

    Just wanted to say first of, this node manager is great for someone like me who has been playing around with my sensors but really struggling to get past the basic example sketches.

    I've been trying to put together a motion sensor using an AM312 PIR.
    but I'm having problems like others with the sensor always remaining tripped.
    I've read through all the documentation but I'm having troubles figuring out how and where to add the extra sensor parameters.
    do these go in the config.h sketch? if so how and where?
    or do I change them in the NodeManager.h

    sorry for such a basic question but I'm not really good with arduino or coding and have read your instructions over and over but I cant figure out how to add these parameters to my sketch.

    Any help would be appreciated.

    NodeManager

  • Ethernet Gateway + Home Assitant
    T tubby

    So who would have thought this home automation stuff would have such a steel learning curve.
    I've come from absolutely no coding knowledge to be able to get home assistant some what running, and I'm loving it.

    Now I'm trying to add a few sensors around the house.

    I've been reading and trying different things for the last 2 days, but cant seam to figure it out.

    I've got a arduino r3 loaded with the default Ethernet gateway sketch.
    and through the serial monitor it is outputting

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    
    

    Which to my untrained eye seems right.

    The sensor node is a arduino nano and for the moment has a light sensor connected to it.
    with this sketch.

    /**
     * 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 <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * 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.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     *
     * DESCRIPTION
     * Example sketch showing how to measue light level using a LM393 photo-resistor
     * http://www.mysensors.org/build/light
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #include <MySensors.h>
    
    #define CHILD_ID_LIGHT 0
    #define LIGHT_SENSOR_ANALOG_PIN 4
    
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    int lastLightLevel;
    
    
    void presentation()
    {
    	// Send the sketch version information to the gateway and Controller
    	sendSketchInfo("Light Sensor", "1.0");
    
    	// Register all sensors to gateway (they will be created as child devices)
    	present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    }
    
    void loop()
    {
    	int16_t lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23;
    	Serial.println(lightLevel);
    	if (lightLevel != lastLightLevel) {
    		send(msg.set(lightLevel));
    		lastLightLevel = lightLevel;
    	}
    	sleep(SLEEP_TIME);
    }
    
    
    

    The output of the serial monitor

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    3 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSF:SID:OK,ID=4
    15 TSM:FPAR
    51 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    819 TSF:MSG:READ,0-0-4,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    824 TSF:MSG:FPAR OK,ID=0,D=1
    2058 TSM:FPAR:OK
    2059 TSM:ID
    2060 TSM:ID:OK
    2062 TSM:UPL
    2065 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    2074 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    2079 TSF:MSG:PONG RECV,HP=1
    2082 TSM:UPL:OK
    2083 TSM:READY:ID=4,PAR=0,DIS=1
    2088 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2095 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2103 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
    2111 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    4121 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=OK:Light Sensor
    4130 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    4148 TSF:MSG:SEND,4-4-0-0,s=0,c=0,t=16,pt=0,l=0,sg=0,ft=0,st=OK:
    4153 MCO:REG:REQ
    4157 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    6166 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    6173 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    6178 MCO:PIM:NODE REG=1
    6180 MCO:BGN:INIT OK,TSP=1
    49
    6184 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=23,pt=2,l=2,sg=0,ft=0,st=OK:49
    6192 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    6197 MCO:SLP:TPD
    

    Which I dont see anything wrong with.

    So from this point everything seems to be working properly.

    Then I move to home assistant, for the life of me I cannot get anything to show.
    my config.yaml is:

    mysensors:
      gateways:
        - device: '192.168.2.50'
          tcp_port: 5003
    

    and the only out of the ordanry thing in the log is.

    Feb 22 04:33:46 hassbian hass[3097]: 17-02-22 04:33:46 WARNING (Thread-6) [mysensors.mysensors] File does not exist or is not readable: /home/homeassistant/.homeassistant/mysensors1.pickle
    Feb 22 04:33:46 hassbian hass[3097]: 17-02-22 04:33:46 WARNING (Thread-6) [mysensors.mysensors] Trying backup file: /home/homeassistant/.homeassistant/mysensors1.pickle.bak
    Feb 22 04:33:46 hassbian hass[3097]: 17-02-22 04:33:46 WARNING (Thread-6) [mysensors.mysensors] File does not exist or is not readable: /home/homeassistant/.homeassistant/mysensors1.pickle.bak
    Feb 22 04:33:46 hassbian hass[3097]: 17-02-22 04:33:46 WARNING (Thread-6) [mysensors.mysensors] Failed to load sensors from file: /home/homeassistant/.homeassistant/mysensors1.pickle
    

    Which I've read is normal till home assistant discovers a sensor.

    So this leads me to believe my problems have something to do with the persistence..
    which I have no knowledge about, I'm having a stab in the dark and amusing that there is something missing out of my sketch files but I just don't know where to look or what to do.

    Any help or direction would be much appreciate, I'm ripping my hair out and the misses is going to cut my throat if I spend to many more afternoons swearing at the computer.

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular