@martinhjelmare said:
Fixed code with gw.wait(50). There was an error on sending third child before that:
...
send: 1-1-0-0 s=3,c=0,t=1,pt=0,l=0,sg=0,st=fail:
...
Now sketch looks like that:
...
gw.begin(NULL, NodeID, false);
gw.wait(50);
gw.sendSketchInfo("Light Lux Sensor", "2.1");
gw.wait(50);
gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
gw.wait(50);
gw.present(CHILD_ID_HUM, S_HUM);
gw.wait(50);
gw.present(CHILD_ID_TEMP, S_TEMP);
gw.wait(50);
gw.present(CHILD_ID_MOTION, S_MOTION);
...
Sensor log:
send: 1-1-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:1
read: 0-0-1 s=255,c=3,t=15,pt=2,l=2,sg=0:1
send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01C5B0DC963CB71F2DCD27C8B0F6D158F42093428EB9CC8D57
send: 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,sg=1,st=ok:1.5.4
send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:017372F9A88F43BC6507E63AF0E71A395A1D40BA4DE874C687
send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=1,st=ok:0
sensor started, id=1, parent=0, distance=1
send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:019A79B90F8BC63410C3F580DA25F2F468EFA1419E3B4E5FFE
send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=16,sg=1,st=ok:Light Lux Sensor
send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:019A79B90F8BC63410C3F580DA25F2F468EFA1419E3B4E5FFE
send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=1,st=ok:2.1
send: 1-1-0-0 s=0,c=0,t=16,pt=0,l=0,sg=0,st=ok:
send: 1-1-0-0 s=1,c=0,t=7,pt=0,l=0,sg=0,st=ok:
send: 1-1-0-0 s=2,c=0,t=6,pt=0,l=0,sg=0,st=ok:
send: 1-1-0-0 s=3,c=0,t=1,pt=0,l=0,sg=0,st=ok:
Battery Voltage: 4077.00 mV; percentage: 89 %
send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01857D3E43A059F8EBDBA3F632014EB2B1CE62B3F58C017BE0
send: 1-1-0-0 s=255,c=3,t=0,pt=1,l=1,sg=1,st=ok:89
Motion detected: 1
send: 1-1-0-0 s=3,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:017372F9A88F43BC6507E63AF0E71A395A1D40BA4DE874C687
send: 1-1-0-0 s=3,c=1,t=16,pt=2,l=2,sg=1,st=ok:1
Light: 3 lx
send: 1-1-0-0 s=0,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01857D3E43A059F8EBDBA3F632014EB2B1CE62B3F58C017BE0
send: 1-1-0-0 s=0,c=1,t=23,pt=3,l=2,sg=1,st=ok:3
Wait fro DHT22: 288
DHT22, OK, 50.3, 24.6
send: 1-1-0-0 s=2,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:011D852C06DD95F9234FD0E592B9A2DDA3429BCA9F77526474
send: 1-1-0-0 s=2,c=1,t=0,pt=7,l=5,sg=1,st=ok:24.6
send: 1-1-0-0 s=1,c=3,t=16,pt=0,l=0,sg=0,st=ok:
read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:013CD41180660904233472CD7B7B8A48DC6CAB595096EC18FC
send: 1-1-0-0 s=1,c=1,t=1,pt=7,l=5,sg=1,st=ok:50.3
Gateway:
1;255;3;0;6;0
1;255;3;0;11;Light Lux Sensor
1;255;3;0;12;2.1
1;0;0;0;16;
1;1;0;0;7;
1;2;0;0;6;
1;3;0;0;1;
1;255;3;0;0;89
1;3;1;0;16;1
1;0;1;0;23;3
1;2;1;0;0;24.6
1;1;1;0;1;50.3
Log of HA is the same:
WARNING:mysensors.mysensors:Node 1 is unknown
WARNING:mysensors.mysensors:Node 1 is unknown
WARNING:mysensors.mysensors:Node 1 is unknown
ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 0.
WARNING:mysensors.mysensors:Node 1 is unknown
ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 1.
WARNING:mysensors.mysensors:Node 1 is unknown
ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 2.
WARNING:mysensors.mysensors:Node 1 is unknown
ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 3.
WARNING:mysensors.mysensors:Node 1 is unknown
WARNING:mysensors.mysensors:Node 1 is unknown
WARNING:mysensors.mysensors:Node 1 is unknown
I added logger with debug. Also "debug: true" in mysensors section. Also --debug to hass command line. But there are no debug messages.
Config:
homeassistant:
name: Home
elevation: 185
unit_system: metric
time_zone: Europe/Kiev
logger:
default: debug
logs:
mysensors.mysensors: debug
frontend:
http:
history:
logbook:
mysensors:
gateways:
- device: '/dev/ttyUSB0'
persistence_file: '/home/homeassistant/.homeassistant/mysensors.json'
baud_rate: 115200
debug: true
optimistic: true
persistence: true
version: 1.5