asad-boutique / node-bacnet-contrib-extended

MIT License
3 stars 6 forks source link

read-single-value returns "invalid BacnetID" for ID 0 #5

Open balli1187 opened 2 years ago

balli1187 commented 2 years ago

hallo,

first of all: thanks for the bacnet nodes and your work!

I'm new to Bacnet and just started experimenting with it and node red. During this i tried to read a single value from bacnet but get an error for bacnetID=0. The ode returns "bacnetId is invalid". For other bacnetIDs it works like charm.

I'm using YABE (yet another bacnet explorer) and the small Room control simulater.

When i use the read-single-device node it returns all bacnetIDs including the 0.

Thanks for help, Stephan

mentlergy commented 1 year ago

Change the line 147 in the file read-single-point.js from if(msg.bacnetId == "" || msg.bacnetId == null || typeof msg.bacnetId != 'number'){ to if( typeof msg.bacnetId != 'number'){

Not essential but more informative in the line 158: msg.payload = bacnetId is invalid (${typeof msg.bacnetId});