Node-red-contrib-buffer-parser issue

I am trying to get this new node working on data coming from a bluetooth pressure sensor. I cant seem to get at the nested data correctly.

Here is the data for the first value.

3/18/2021, 10:29:25 AMnode: 3880141e.2cbf04
msg : Object
object
payload: object
uuid: "0081f9974020"
characteristics: object
2a07: buffer[1]
0: 0xa
_msgid: "5c78a7a7.e92c18"

Here is the testing flow.

[{"id":"c0d5dea4.880a9","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"ea7a7199.23adb","type":"inject","z":"c0d5dea4.880a9","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"835ab4c051e411e3a5bd0002a5d5c51b","payloadType":"str","x":300,"y":360,"wires":[["6c40fa5c.0c67c4"]]},{"id":"ad0b93de.c385f","type":"inject","z":"c0d5dea4.880a9","name":"Connect","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"connect","payloadType":"str","x":400,"y":440,"wires":[["6c40fa5c.0c67c4"]]},{"id":"a65a7d65.34f43","type":"inject","z":"c0d5dea4.880a9","name":"Disconnect","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"disconnect","x":400,"y":480,"wires":[["6c40fa5c.0c67c4"]]},{"id":"3880141e.2cbf04","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1230,"y":140,"wires":[]},{"id":"33480316.ff149c","type":"inject","z":"c0d5dea4.880a9","name":"Subscribe","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"notify\":true,\"period\":0}","payloadType":"json","x":400,"y":520,"wires":[["6c40fa5c.0c67c4"]]},{"id":"6c40fa5c.0c67c4","type":"Generic BLE in","z":"c0d5dea4.880a9","name":"91087","genericBle":"9078f63b.0dc458","useString":false,"notification":true,"x":910,"y":140,"wires":[["dd81fdd0.ff58e8","3880141e.2cbf04"]]},{"id":"97906e53.8d662","type":"inject","z":"c0d5dea4.880a9","name":"Temperature Measurement","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a1c","payloadType":"str","x":350,"y":320,"wires":[["6c40fa5c.0c67c4"]]},{"id":"8b4f2471.4be59","type":"inject","z":"c0d5dea4.880a9","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"8cd67da0da9b11e390870002a5d5c51b","x":300,"y":400,"wires":[["6c40fa5c.0c67c4"]]},{"id":"9ba2bc2d.00f108","type":"inject","z":"c0d5dea4.880a9","name":"Measurement Interval","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a21","payloadType":"str","x":360,"y":280,"wires":[["6c40fa5c.0c67c4"]]},{"id":"f83805b4.357a28","type":"inject","z":"c0d5dea4.880a9","name":"Model Number String","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a24","payloadType":"str","x":360,"y":200,"wires":[["6c40fa5c.0c67c4"]]},{"id":"388476a2.477302","type":"inject","z":"c0d5dea4.880a9","name":"<Unnamed>","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2aff","payloadType":"str","x":390,"y":240,"wires":[["6c40fa5c.0c67c4"]]},{"id":"d6d0ad88.2c0918","type":"inject","z":"c0d5dea4.880a9","name":"Serial Number String","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a25","payloadType":"str","x":370,"y":160,"wires":[["6c40fa5c.0c67c4"]]},{"id":"501297f9.7c5b9","type":"inject","z":"c0d5dea4.880a9","name":"Tx Power Level","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a07","x":380,"y":40,"wires":[["6c40fa5c.0c67c4"]]},{"id":"bc0b41.65bcbcc","type":"inject","z":"c0d5dea4.880a9","name":"Firmware Revision String","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a26","payloadType":"str","x":350,"y":120,"wires":[["6c40fa5c.0c67c4"]]},{"id":"b3e31ee5.6fbaa8","type":"inject","z":"c0d5dea4.880a9","name":"Manufacturer Name String","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a29","payloadType":"str","x":350,"y":80,"wires":[["6c40fa5c.0c67c4"]]},{"id":"dd81fdd0.ff58e8","type":"buffer-parser","z":"c0d5dea4.880a9","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int8","name":"2a07","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Manufacturer Name","offset":0,"length":22,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Firmware Revision","offset":0,"length":7,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Serial Number","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Model Number","offset":0,"length":20,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"<Unnamed>","offset":0,"length":12,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Measurement Interval","offset":0,"length":2,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Temperature Measurement","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item9","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item10","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"object","resultTypeType":"output","multipleResult":true,"fanOutMultipleResult":true,"setTopic":true,"outputs":10,"x":1070,"y":320,"wires":[["3880141e.2cbf04"],[],[],[],[],[],[],[],[],[]]},{"id":"9078f63b.0dc458","type":"Generic BLE","localName":"91087              ","address":"00:81:f9:97:40:20","uuid":"0081f9974020","characteristics":[{"uuid":"2a07","name":"Tx Power Level","type":"org.bluetooth.characteristic.tx_power_level","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a29","name":"Manufacturer Name String","type":"org.bluetooth.characteristic.manufacturer_name_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a26","name":"Firmware Revision String","type":"org.bluetooth.characteristic.firmware_revision_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a25","name":"Serial Number String","type":"org.bluetooth.characteristic.serial_number_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a24","name":"Model Number String","type":"org.bluetooth.characteristic.model_number_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2aff","name":"<Unnamed>","type":"(Custom Type)","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a21","name":"Measurement Interval","type":"org.bluetooth.characteristic.measurement_interval","notifiable":false,"readable":true,"writable":true,"writeWithoutResponse":false},{"uuid":"2a1c","name":"Temperature Measurement","type":"org.bluetooth.characteristic.temperature_measurement","notifiable":true,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"8cd67da0da9b11e390870002a5d5c51b","name":"<Unnamed>","type":"(Custom Type)","notifiable":false,"readable":true,"writable":true,"writeWithoutResponse":false},{"uuid":"835ab4c051e411e3a5bd0002a5d5c51b","name":"<Unnamed>","type":"(Custom Type)","notifiable":true,"readable":true,"writable":false,"writeWithoutResponse":false}]}]

I stringified the bluetooth output to this, and still cant seem to get it retrieved.

3/18/2021, 11:05:15 AMnode: 3880141e.2cbf04
msg : Object
object
payload: "{"uuid":"0081f9974020","characteristics":{"2a29":{"type":"Buffer","data":[84,114,97,110,115,100,117,99,101,114,115,32,68,105,114,101,99,116,32,76,76,67]}}}"
_msgid: "6f68c25.88fb13c"

I should mention that the payload has 2 items of interest.

  1. Characteristics key
  2. Data

The sensor returns all of the following.

Tx Power Level (2a07)Read
org.bluetooth.characteristic.tx_power_level
Manufacturer Name String (2a29)Read
org.bluetooth.characteristic.manufacturer_name_string
Firmware Revision String (2a26)Read
org.bluetooth.characteristic.firmware_revision_string
Serial Number String (2a25)Read
org.bluetooth.characteristic.serial_number_string
Model Number String (2a24)Read
org.bluetooth.characteristic.model_number_string
<Unnamed> (2aff)Read
(Custom Type)
Measurement Interval (2a21)ReadWrite
org.bluetooth.characteristic.measurement_interval
Temperature Measurement (2a1c)ReadNotify
org.bluetooth.characteristic.temperature_measurement
<Unnamed> (8cd67da0da9b11e390870002a5d5c51b)ReadWrite
(Custom Type)
<Unnamed> (835ab4c051e411e3a5bd0002a5d5c51b)ReadNotify
(Custom Type)

Hi, when you capture a debug output - please do the following...

  1. Press the "Copy Value" button that appears under your mouse pointer when you hover over the message in the debug sidebar (it copies it correctly - what you pasted is pretty much unusable)
  2. Be sure to paste it as a code block (surrounded by 3 backticks on new lines)

OK, so by the looks of it, your buffer from the BLE node is in msg.payload["2a29"].characteristics but you have the input property of the buffer parser set to read msg.payload - hence the error.
image

So, I have put together a demo using the buffer values I found in your post [84,114,97,110,115,100,117,99,101,114,115,32,68,105,114,101,99,116,32,76,76,67] and connected that to the buffer parser (to fake your BLE node (I dont have BLE or your device so I have to fabricate the data))

This is the result ...

^ note how all values are essentially starting from the 1st byte? ...

This is because yo havent set any offsets...


any how, here is the demo flow...

[{"id":"3880141e.2cbf04","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":144,"wires":[]},{"id":"dd81fdd0.ff58e8","type":"buffer-parser","z":"c0d5dea4.880a9","name":"","data":"payload[\"2a07\"].characteristics","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int8","name":"2a07","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Manufacturer Name","offset":0,"length":22,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Firmware Revision","offset":0,"length":7,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Serial Number","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Model Number","offset":0,"length":20,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"<Unnamed>","offset":0,"length":12,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Measurement Interval","offset":0,"length":2,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Temperature Measurement","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item9","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item10","offset":0,"length":5,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"output","multipleResult":true,"fanOutMultipleResult":true,"setTopic":true,"outputs":10,"x":1238,"y":352,"wires":[["3880141e.2cbf04"],["bdad8685.3637e8"],["3c6d5ff3.29ade"],["605ab10.845f75"],["fc4ca81f.1989f8"],["aea4a54e.a88bb8"],["6dc8407e.d300a"],["dffd79e.18a6288"],["2510148b.2a56cc"],["d4a42ff8.c34cf"]]},{"id":"b9a795bb.efaa78","type":"function","z":"c0d5dea4.880a9","name":"","func":"msg.payload = {};\nmsg.payload[\"2a07\"] = {\n    characteristics: Buffer.from([84,114,97,110,115,100,117,99,101,114,115,32,68,105,114,101,99,116,32,76,76,67])\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1036,"y":256,"wires":[["dd81fdd0.ff58e8"]]},{"id":"adf48181.de88b","type":"inject","z":"c0d5dea4.880a9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1036,"y":208,"wires":[["b9a795bb.efaa78"]]},{"id":"bdad8685.3637e8","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":192,"wires":[]},{"id":"3c6d5ff3.29ade","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":240,"wires":[]},{"id":"605ab10.845f75","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":288,"wires":[]},{"id":"fc4ca81f.1989f8","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":336,"wires":[]},{"id":"aea4a54e.a88bb8","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":384,"wires":[]},{"id":"6dc8407e.d300a","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":432,"wires":[]},{"id":"dffd79e.18a6288","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":480,"wires":[]},{"id":"2510148b.2a56cc","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":528,"wires":[]},{"id":"d4a42ff8.c34cf","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1478,"y":576,"wires":[]}]

PS Please read the built in help...

And try the built in demos

I stepped back and can't seem to get the data to represent the temperature.
Here is the payload and the configuration. The vendor says its a 32 Float BE value and I keep getting the error.

RangeError: The value of "offset" is out of range. It must be >= 0 and <= 0. Received 4

This is the message passed into it.

3/18/2021, 9:41:23 PMnode: 3880141e.2cbf04
Temperature : msg : Object
object
topic: "Temperature"
payload: buffer[4]
0: 0x41
1: 0xcb
2: 0x30
3: 0x0
_msgid: "e79e3aec.168318"

1 Like

As I said before...

e.g...

You did neither of these :frowning: that makes it is very difficult for me to help you as I cant easily copy what you pasted!


Onto your issue...

... your input data is only 4 bytes long & you are trying to read 3 floats from it.

More, so, that data [0x41,0xcb,0x30,0x0] looks suspiciously like a string.

image

[{"id":"6530f850.c3f6c8","type":"inject","z":"c0d5dea4.880a9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1452,"y":736,"wires":[["66510ff4.8f654"]]},{"id":"66510ff4.8f654","type":"function","z":"c0d5dea4.880a9","name":"","func":"msg.payload = Buffer.from([0x41,0xcb,0x30,0])\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1452,"y":784,"wires":[["cb979d92.213f9"]]},{"id":"cb979d92.213f9","type":"buffer-parser","z":"c0d5dea4.880a9","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"string","name":"item1","offset":0,"length":3,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":true,"setTopic":true,"outputs":1,"x":1478,"y":832,"wires":[["767ab56.3b7814c"]]},{"id":"767ab56.3b7814c","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1510,"y":880,"wires":[]}]

I got it working, but had to drop the buffer parser except in one condition.

Here is a good Bluetooth Flow. It works with the Transducers Direct TDWLB-LC0100034 Pressure Transducer.

Thanks all

[{"id":"c0d5dea4.880a9","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"ea7a7199.23adb","type":"inject","z":"c0d5dea4.880a9","name":"UUID2","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"835ab4c051e411e3a5bd0002a5d5c51b","payloadType":"str","x":230,"y":400,"wires":[["6c40fa5c.0c67c4"]]},{"id":"ad0b93de.c385f","type":"inject","z":"c0d5dea4.880a9","name":"Connect","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"connect","payloadType":"str","x":220,"y":620,"wires":[["6c40fa5c.0c67c4"]]},{"id":"a65a7d65.34f43","type":"inject","z":"c0d5dea4.880a9","name":"Disconnect","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"disconnect","x":220,"y":660,"wires":[["6c40fa5c.0c67c4"]]},{"id":"3880141e.2cbf04","type":"debug","z":"c0d5dea4.880a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1350,"y":140,"wires":[]},{"id":"33480316.ff149c","type":"inject","z":"c0d5dea4.880a9","name":"Subscribe","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"notify\":true,\"period\":300000}","payloadType":"json","x":220,"y":700,"wires":[["6c40fa5c.0c67c4"]]},{"id":"6c40fa5c.0c67c4","type":"Generic BLE in","z":"c0d5dea4.880a9","name":"91087","genericBle":"9078f63b.0dc458","useString":false,"notification":true,"x":450,"y":140,"wires":[["acca877e.c6a21"]]},{"id":"97906e53.8d662","type":"inject","z":"c0d5dea4.880a9","name":"Temperature","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a1c","x":210,"y":360,"wires":[["6c40fa5c.0c67c4"]]},{"id":"8b4f2471.4be59","type":"inject","z":"c0d5dea4.880a9","name":"UUID4","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"8cd67da0da9b11e390870002a5d5c51b","payloadType":"str","x":230,"y":440,"wires":[["6c40fa5c.0c67c4"]]},{"id":"9ba2bc2d.00f108","type":"inject","z":"c0d5dea4.880a9","name":"Measurement Interval","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a21","x":180,"y":320,"wires":[["6c40fa5c.0c67c4"]]},{"id":"f83805b4.357a28","type":"inject","z":"c0d5dea4.880a9","name":"Model Number","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a24","payloadType":"str","x":200,"y":240,"wires":[["6c40fa5c.0c67c4"]]},{"id":"388476a2.477302","type":"inject","z":"c0d5dea4.880a9","name":"Advertising Blob","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2aff","x":200,"y":280,"wires":[["6c40fa5c.0c67c4"]]},{"id":"d6d0ad88.2c0918","type":"inject","z":"c0d5dea4.880a9","name":"Serial Number","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a25","x":210,"y":200,"wires":[["6c40fa5c.0c67c4"]]},{"id":"501297f9.7c5b9","type":"inject","z":"c0d5dea4.880a9","name":"Tx Power Level","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a07","payloadType":"str","x":200,"y":80,"wires":[["6c40fa5c.0c67c4"]]},{"id":"bc0b41.65bcbcc","type":"inject","z":"c0d5dea4.880a9","name":"Firmware Revision","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a26","x":190,"y":160,"wires":[["6c40fa5c.0c67c4"]]},{"id":"b3e31ee5.6fbaa8","type":"inject","z":"c0d5dea4.880a9","name":"Manufacturer Name","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2a29","x":190,"y":120,"wires":[["6c40fa5c.0c67c4"]]},{"id":"acca877e.c6a21","type":"switch","z":"c0d5dea4.880a9","name":"","property":"payload.characteristics","propertyType":"msg","rules":[{"t":"hask","v":"2a07","vt":"str"},{"t":"hask","v":"2a29","vt":"str"},{"t":"hask","v":"2a26","vt":"str"},{"t":"hask","v":"2a25","vt":"str"},{"t":"hask","v":"2a24","vt":"str"},{"t":"hask","v":"2a21","vt":"str"},{"t":"hask","v":"2a1c","vt":"str"},{"t":"hask","v":"835ab4c051e411e3a5bd0002a5d5c51b","vt":"str"},{"t":"hask","v":"8cd67da0da9b11e390870002a5d5c51b","vt":"str"},{"t":"hask","v":"2904","vt":"str"},{"t":"hask","v":"2aff","vt":"str"}],"checkall":"true","repair":false,"outputs":11,"x":610,"y":240,"wires":[["1ffc7951.024a4f"],["a50ad569.2e6218"],["4f20d698.5fcd7"],["18f05622.4a7eda"],["6456013c.7fbd48"],["512c19e4.4eaee"],["60451453.d5fda4"],["f4cf3b81.325f58"],["2c16b8bd.47d628"],[],["6217570b.609788"]]},{"id":"f2a3079.9559078","type":"inject","z":"c0d5dea4.880a9","name":"Probe","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":230,"y":540,"wires":[["6c40fa5c.0c67c4"]]},{"id":"60451453.d5fda4","type":"function","z":"c0d5dea4.880a9","name":"Temperature","func":"msg.topic = \"Temperature\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"2a1c\"];\n    value = value.slice(1,5);\n    value = value.readFloatBE();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":930,"y":320,"wires":[["3880141e.2cbf04"]]},{"id":"2c16b8bd.47d628","type":"function","z":"c0d5dea4.880a9","name":"Pressure - UUID4","func":"msg.topic = \"Pressure\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"8cd67da0da9b11e390870002a5d5c51b\"][0];\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":400,"wires":[["3880141e.2cbf04"]]},{"id":"f4cf3b81.325f58","type":"function","z":"c0d5dea4.880a9","name":"Pressure -UUID2","func":"msg.topic = \"Pressure\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"835ab4c051e411e3a5bd0002a5d5c51b\"];\n    value = value.readInt16BE();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":360,"wires":[["3880141e.2cbf04"]]},{"id":"bfc2662e.abbe","type":"inject","z":"c0d5dea4.880a9","name":"Scale Value","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2904","x":210,"y":480,"wires":[["6c40fa5c.0c67c4"]]},{"id":"a50ad569.2e6218","type":"function","z":"c0d5dea4.880a9","name":"Manufacturer Name","func":"msg.topic = \"Manufacturer Name\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"2a29\"];\n    value = value.toString();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":120,"wires":[["3880141e.2cbf04"]]},{"id":"1ffc7951.024a4f","type":"function","z":"c0d5dea4.880a9","name":"Tx Power","func":"msg.topic = \"Tx Power\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"2a07\"];\n    value = value.readInt8(0);\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":80,"wires":[["3880141e.2cbf04"]]},{"id":"4f20d698.5fcd7","type":"function","z":"c0d5dea4.880a9","name":"Firmware Revision","func":"msg.topic = \"Firmware Revision\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"2a26\"];\n    value = value.toString();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":160,"wires":[["3880141e.2cbf04"]]},{"id":"18f05622.4a7eda","type":"function","z":"c0d5dea4.880a9","name":"Serial Number","func":"msg.topic = \"Serial Number\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"2a25\"];\n    value = value.toString();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":200,"wires":[["3880141e.2cbf04"]]},{"id":"6456013c.7fbd48","type":"function","z":"c0d5dea4.880a9","name":"Model Number","func":"msg.topic = \"Model Number\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"2a24\"];\n    value = value.toString();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":240,"wires":[["3880141e.2cbf04"]]},{"id":"512c19e4.4eaee","type":"function","z":"c0d5dea4.880a9","name":"Measurement Interval","func":"msg.topic = \"Measurement Interval\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload.characteristics[\"2a21\"];\n    value = value.readInt16LE();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":280,"wires":[["3880141e.2cbf04"]]},{"id":"6217570b.609788","type":"buffer-parser","z":"c0d5dea4.880a9","name":"Advertising Blob","data":"payload.characteristics[\"2aff\"]","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int32le","name":"Pressure","offset":0,"length":3,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"Temperature","offset":2,"length":2,"offsetbit":0,"scale":"1","mask":""},{"type":"int8","name":"Battery Level","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"string","name":"Device","offset":6,"length":6,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"output","multipleResult":true,"fanOutMultipleResult":true,"setTopic":true,"outputs":4,"x":700,"y":500,"wires":[["a85706bc.860988"],["7d54150f.ee403c"],["7190d2ce.c702ac"],["d0fcc386.ef9318"]]},{"id":"a85706bc.860988","type":"function","z":"c0d5dea4.880a9","name":"Pressure","func":"msg.topic = \"Pressure\";\nvar now = ( new Date() ).getTime();\nvar array = [\"0x0\"];\narray = array.concat(msg.payload);\nvar value = Buffer.from(array)\n    value = value.readUInt32LE();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":440,"wires":[["3880141e.2cbf04"]]},{"id":"7d54150f.ee403c","type":"function","z":"c0d5dea4.880a9","name":"Temperature","func":"msg.topic = \"Temperature\";\nvar now = ( new Date() ).getTime();\nvar value = Buffer.from(msg.payload);\n    value = value.readInt16LE(0);\n   msg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":930,"y":480,"wires":[["3880141e.2cbf04"]]},{"id":"d0fcc386.ef9318","type":"function","z":"c0d5dea4.880a9","name":"Device Address","func":"msg.topic = \"Device Address\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload;\n    value = value.toString();\nmsg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":560,"wires":[["3880141e.2cbf04"]]},{"id":"7190d2ce.c702ac","type":"function","z":"c0d5dea4.880a9","name":"Battery Level","func":"msg.topic = \"Battery Level\";\nvar now = ( new Date() ).getTime();\nvar value = msg.payload;\n   msg.payload = {\n    tstamp: now,\n    data: value\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":930,"y":520,"wires":[["3880141e.2cbf04"]]},{"id":"9078f63b.0dc458","type":"Generic BLE","localName":"91087              ","address":"00:81:f9:97:40:20","uuid":"0081f9974020","characteristics":[{"uuid":"2a07","name":"Tx Power Level","type":"org.bluetooth.characteristic.tx_power_level","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a29","name":"Manufacturer Name String","type":"org.bluetooth.characteristic.manufacturer_name_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a26","name":"Firmware Revision String","type":"org.bluetooth.characteristic.firmware_revision_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a25","name":"Serial Number String","type":"org.bluetooth.characteristic.serial_number_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a24","name":"Model Number String","type":"org.bluetooth.characteristic.model_number_string","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2aff","name":"<Unnamed>","type":"(Custom Type)","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a21","name":"Measurement Interval","type":"org.bluetooth.characteristic.measurement_interval","notifiable":false,"readable":true,"writable":true,"writeWithoutResponse":false},{"uuid":"2a1c","name":"Temperature Measurement","type":"org.bluetooth.characteristic.temperature_measurement","notifiable":true,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"8cd67da0da9b11e390870002a5d5c51b","name":"<Unnamed>","type":"(Custom Type)","notifiable":false,"readable":true,"writable":true,"writeWithoutResponse":false},{"uuid":"835ab4c051e411e3a5bd0002a5d5c51b","name":"<Unnamed>","type":"(Custom Type)","notifiable":true,"readable":true,"writable":false,"writeWithoutResponse":false}]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.