Skip to content

Outputting PGN 127505 - Fluid Level #42

@geoffschultz

Description

@geoffschultz

I am new to Signal-K and Node-Red, so please excuse me if this is obvious to more experienced users. I have a Victron Cerbo running Signal-K and Node-Red. I have ultrasonic fluid transducers that provide highly varying level readings. I want to smooth the data and send out a level of the data over the past 30 seconds. So here's what I've done:

Subscribe to tanks.freshWater.1.currentLevel (which outputs every 2.5 seconds)
Feed that into a smooth function which outputs every 12 results (every 30 seconds)
Feed the output of the smooth into a function that contains:

var level = msg.payload;
const pgn = {
"pgn": 127505,
"Instance": 102,
"Type": "Fresh Water",
"Level": Number(level),
"Capacity": 0.1
}
msg.payload = pgn;
return msg;

This msg.payload is the input for signalk-send-nmea2000. However, I don't see a tanks.freshWater.102 appear.

What am I doing wrong? I'm guessing that I have the wrong Type, but can't find where tank_type is defined.

Here's the definition of PGN 127505:

{"Fluid Level",
 127505,
 PACKET_COMPLETE,
 PACKET_SINGLE,
 {SIMPLE_FIELD(PK("Instance"), 4),
  LOOKUP_FIELD("Type", 4, TANK_TYPE),
  PERCENTAGE_I16_FIELD("Level"),
  VOLUME_UFIX32_DL_FIELD("Capacity"),
  RESERVED_FIELD(BYTES(1)),
  END_OF_FIELDS},
 .priority = 6,
 .url      = "https://web.archive.org/web/20060511065306/http://www.maretron.com/support/manuals/TLA100UM_1.2.pdf",
 .interval = 2500}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions