Read battery status

Hello,

I use the Dragino CPL03-LB with the code recommended by the manufacturer (see below) in the data that arrives in Node Red I can't find any data for the battery status. For other sensors I find the value batV. That has to be possible. Does anyone know how this works? Thank you

Dragino CPL03 Formatter Code.txt (4.9 KB)

A quick look at the code shows it has different functions in it. One of the functions

function Decoder(bytes, port) {

checks the port and if it matches 0x05
else if(port==0x05)
Then it returns some batter y information.

If you have any other questions about this code you should contact Dragino.

Thanks zenofmud for your answer. I haven't been in the Node Red world for that long. I have a fundamental question of understanding. Currently the sensor is sending on port 2 and according to the debug under decoded_payload gives Alarm, CMOD Last_Duration, Pin_Status, TDC, Time, Total_Pulse. etc. This is also data that I need. How do I get the data from the battery??? Probably via a different port. Is all other data then gone? Thank you

Sadly I'm not going to be of much help since I don't have the device ad have no experience with it.

As for saving data from a reading there are several things you could do

  1. store it in a database
  2. store it in context
  3. you could join messages into one msg: See this article in the cookbook for an example of how to join messages into one object.

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

1 Like