I built a trip wire for the post box that I'm connecting. It's however based on a mercury tilt sensor so I'm really not sure whether I think it's a great idea putting it to use (at least not with a sturdy case...). However, I can share my code:
#define DIGITAL_INPUT_SENSOR 2 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
#define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
MyMessage msgTripped(CHILD_ID_TRIPPED, V_TRIPPED);
void setup()
{
gw.sendSketchInfo("Postal", "1.0");
gw.present(CHILD_ID_TRIPPED, S_MOTION);
pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input
}
void loop()
{
boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == LOW;
if(tripped) {
gw.send(msgTripped.set("1")); // Send tripped value to gw
}
gw.sleep(INTERRUPT,FALLING, SLEEP_TIME);
}
@Tmaster What I meant by my previous comment was to tap on the Node name to see what sensors were connected - Had you clicked on TANQUE you would have seen a box pop up below giving you all the children to that particular Node with what value was last updated and when, so you could easily have found out all about your mysterious 13 children.
At least you have it sorted now, but it pays to do a bit of housekeeping in the sketch setup and Domoticz - eg which of the 6 "Unknown" Nodes is the one you want to next have a look at ?
All my Node IDs are set at the Node, and the sketch name labels the Node ID also, the Nodes are named in Domoticz for easy identification.
In the sketch my sensors are numbered sequentially and commented on what they are, so naming them in Domoticz becomes very much easier.