# Not called aux.txt: AUX is a reserved Windows device name, with or without
# an extension, so PowerShell, Explorer and sync clients refuse to copy a file
# of that name, and older Windows opens the AUX device instead of the file.
#
# Innovate sensor box on aux_port (settings.txt) - the MTX-D oil pressure /
# temperature gauge, p/n 3852. Read as ordinary channels: tiles, min/max,
# danger rules, the log, replay and the spec all see them.
#
#   key | word | lo | hi | label | units
#
# "word" is the index of the channel's word among a packet's aux words. A count
# of 0 decodes to lo and 1023 to hi (Innovate aux inputs are 10-bit, 0-5 V).
#
# ⬜ TBD - PART VERIFIED. The MTX-D's published ranges are 0-150 psi and
# 120-280 F, and a two-channel MTS box is expected to send pressure then
# temperature.
#
#   Which word is which: SETTLED from the logs, 2026-11-14. In that day's drive
#   (pull-20261114-155402, 25,538 rows with the gauge) word 0 follows engine
#   speed (correlation 0.95) and changes with every packet; word 1 does not
#   follow it (-0.22) and does not move inside a second. Word 0 is the
#   pressure and word 1 the temperature, as mapped below.
#
#   Whether each count spans its published range: NOT yet checked against the
#   gauge's face. The pressure cannot be read off at one moment (noted
#   2026-11-14: "the oil gauge never holds pressure steady to compare
#   numbers"): each packet differs from the last by a few psi. In that drive a
#   steady idle read 24.6 to 30.4 psi and a steady 2,800 rpm read 77 to 89,
#   while the average over a second moved about one psi. So compare the SWING,
#   not a number:
#     1. Engine warm, idling. Press F6 (reset min/max).
#     2. Watch the gauge for ten seconds: note the lowest and the highest.
#     3. Read min and max on the app's oil pressure tile.
#     4. Do it again holding about 2,800 rpm.
#   If the gauge's two swings are the app's, lo and hi are right. A wrong scale
#   is out by the same factor at both and shows plainly at the higher one. The
#   temperature holds still, so it is read straight off, once warm and once
#   hot. aux_raw=20 in settings.txt still writes each packet's raw words to
#   app.log, for working out a true lo/hi if they differ.
#
# When the spans are checked, delete this paragraph.
#
# A count of 0 on a channel whose range does not start at 0 is the gauge's bottom
# stop, not a reading: oil_temp's 0 means "120 F or colder". The tile shows <120,
# the log leaves the cell empty, and no rule judges it. oil_psi's range starts at
# 0 psi, so its 0 is a real reading.
#
# word_offset moves where this box's words start among the AUX words of an MTS
# packet, for a box that shares a daisy chain with another aux box whose words
# come first. Alone on its own cable: 0. With a wideband in the chain (LC-1,
# LC-2, MTX-L...): still 0, ahead of the gauge or behind it - since 2026-11-12
# the wideband's two words are recognised and stepped over, and no longer count.
# (An LM-1 is not such a wideband: it sends its own 16-byte packet, and what it
# puts into a chain has never been captured here. Chained with it, expect empty
# oil columns and a status saying what was heard, not numbers.)
#
# A reading stands for half a second after its packet. The first packet after a
# silence that long is written to logs\app.log as NOT USED and left out: the
# gauge's first packet after a restart has been seen to be all zeros. So is a
# packet with a count above 1023 in a mapped word, which no aux input can send.
#
# device names the box. Tiles and the gauge picker show "label / device", the
# way the wideband tile reads "Wideband / LM-1", so the screen says where a
# number comes from even before the cable is plugged in. The log column stays
# "label (units)".

# packet names the shape this box sends and is the ONLY shape believed. The
# MTX-D sends MTS packets. An LM-1 on the same cable sends its fixed 16-byte
# packet, whose empty aux inputs would otherwise read as 0 psi and 120 F,
# marked valid, and trip the oil-pressure alarm. lm1 is for reading an LM-1's
# own aux inputs instead.

word_offset = 0
device = MTX-D
packet = mts

oil_psi  | 0 |   0 | 150 | Oil pressure | psi
oil_temp | 1 | 120 | 280 | Oil temp     | F
