This article explains how the PredictWind DataHub converts NMEA 2000 tank level data into NMEA 0183 XDR sentences, using an example configuration of two freshwater tanks and one fuel tank.
The examples demonstrate how individual tanks are identified, the XDR sentence format and how frequently the data is transmitted.
Although this example uses three tanks, the same principles apply to other tank configurations and supported fluid types.
1. Independent tanks and instance numbers
Each tank is identified by its fluid type plus its NMEA 2000 instance number, and each becomes its own XDR sentence. Two freshwater tanks with instances 0 and 1 come out as FRESHWATER#0 and FRESHWATER#1. The fuel tank comes out as FUEL#0.
Two things to check when you set up sensors:
Unique instances per fluid type. Two freshwater tanks on the same instance would produce identical identifiers and could not be told apart. NMEA 2000 fluid instances range from 0 to 15.
Correct fluid type. The DataHub maps fluid types to identifier names as follows:
Fuel (diesel or gasoline) →
FUELFresh water →
FRESHWATERGrey/waste water →
WASTEWATERBlack water →
BLACKWATERLive well →
LIVEWELLWATEROil →
OILAny other type →
FLUID
2. Sentence format
The DataHub uses the NMEA 0183 v4.11 XDR convention, the same one OpenCPN’s Engine Dashboard uses:
code:
$IIXDR,E,<level>,P,<TYPE>#<instance>,V,<capacity>,l,<TYPE>#<instance>*hh
E/P: level as percent full, 0–100, sent with one decimal placeV/l: tank capacity in litres (lowercase L)The capacity group is included only when the sensor reports a valid capacity greater than zero. If the tank sensor doesn’t send a capacity, the sentence ends after the level group.
These examples show the exact format, with illustrative values:
code:
$IIXDR,E,72.4,P,FRESHWATER#0,V,300.0,l,FRESHWATER#0*53
$IIXDR,E,55.0,P,FRESHWATER#1,V,150.0,l,FRESHWATER#1*55
$IIXDR,E,88.8,P,FUEL#0,V,400.0,l,FUEL#0*5D
Without a capacity, the fuel sentence would be:
code:
$IIXDR,E,88.8,P,FUEL#0*44
The DataHub skips a reading entirely if the level is unavailable or the fluid type is flagged as an error.
3. Transmission frequency
The DataHub does not keep its own schedule for tank data. It emits one XDR sentence for each PGN 127505 message the sensor puts on the network. The rate therefore matches whatever the tank sensor transmits. The NMEA 2000 standard rate for this PGN is every 2.5 seconds; Simarine can confirm the STR2’s actual rate.
Sensors broadcast this PGN periodically regardless of changes, so the sentences repeat even when the level hasn’t moved. In Home Assistant you will see a steady update stream rather than updates only on change.
Next Steps: Setting Up Your Tank Sensors
When connecting compatible NMEA 2000 tank sensors to your DataHub:
Configure your tank sensors according to the manufacturer's instructions, ensuring each tank has the correct fluid type and a unique instance number for that fluid type.
Connect the sensors to your NMEA 2000 network and ensure the DataHub is connected to the same network.
Check that the sensors are transmitting tank level data using NMEA 2000 PGN 127505.
Connect your receiving application to the DataHub's local NMEA 0183 TCP stream to view the converted XDR sentences.
Verify the tank readings in your receiving application, checking that each tank is identified correctly and the reported levels match the sensor readings.
Note: The DataHub converts tank level messages as they are received from the NMEA 2000 network. The frequency of updates depends on the sensors and their transmission settings. An internet connection is not required for this conversion.
