try to set the same startingNodeid in the pluginconfig, deviceconfig and arduinosketch.
for me works following configuration as example:
{
"plugin": "mysensors",
"driver": "serialport",
"protocols": "1.5.1",
"startingNodeId": 2,
"driverOptions": {
"serialDevice": "/dev/ttyUSB1",
"baudrate": 115200
}
{
"id": "Plant_Soil_Gummibaum",
"name": "Erdfeuchte Gummibaum",
"class": "MySensorsPIR",
"nodeid": 2,
"resetTime": 21600000,
"autoReset": true,
"sensorid": 4
},
{
"id": "MySensors_Contact",
"name": "MySensors Contact",
"class": "MySensorsButton",
"nodeid": 2,
"sensorid": 1,
"batterySensor": true
}
Soil Sketch Header:
#include <MySensor.h>
#include <SPI.h>
#include <Bounce2.h>
#define CHILD_ID 4
#define BUTTON_PIN 8 // Arduino Digital I/O pin for button/reed switch
...
..
.
contactswitch sketch header:
#include <MySensor.h>
#include <SPI.h>
#include <readVcc.h>
#define NODE_ID 2 // ID of node
#define CHILD_ID 1 // ID of sensor
#define PIR_PIN 3 // Pin connected to the PIR
#define MIN_V 4900 // empty voltage (0%)
#define MAX_V 5200 // full voltage (100%)
...
..
.