Skip to content

How to display discovered telemetry sensors

Alessandro Apostoli edited this page Dec 12, 2022 · 2 revisions

Up to 10 user slots con be used to show sensors or timers on screen

  • horizontally, from left to right 1,2,3,4,5,6
  • vertically from top to bottom 7,8,9,10

image

Sensors are defined in a lua file in the \WIDGEST\YaapuMaps\cfg folder.

Sensor config type

  • per model: sensors config file is modelname_sensors_maps.lua, where modelname has to replaced with the actual model name (blank spaces in the name have to be trimmed)
  • global: profile 1, profile 2 and profile 3, sensor confing file name is profile[1|2|3]_sensors_maps.lua

Per model config means the configured sensors will be used only by that specific model whereas profiles are shared between all models.

Sensors file name and syntax

The script looks for a file with the same name of the configuration file but ending in _sensors_maps.lua.

If the config file is modelname_maps.cfg the lua file has to named modelname_sensors_maps.lua.

There's an example file here

File syntax is quite easy

----------------------------------------
-- custom sensors configuration file
----------------------------------------
local sensors = {
  -- Sensor 1
[1]=  {
    "Celm",   -- label
    "Celm",     -- OpenTX sensor name, or timer name like timer2
    2,          -- precision: number of decimals 0,1,2
    "Vmin",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "-",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    3.65,        -- warning level (nil is do not use feature)
    3.30,        -- critical level (nil is do not use feature)
  },

  -- Sensor 2
[2]=  {
    "Celd",   -- label
    "Celd",     -- OpenTX sensor name, or timer name like timer2
    2,          -- precision: number of decimals 0,1,2
    "Vdelta",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "+",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    0.2,        -- warning level (nil is do not use feature)
    0.4,        -- critical level (nil is do not use feature)
  }
-- add sensors up to sensor 10...
[10]=  {
    "Celd",   -- label
    "Celd",     -- OpenTX sensor name, or timer name like timer2
    2,          -- precision: number of decimals 0,1,2
    "Vdelta",         -- label for unit of measure
    1,          -- multiplier if < 1 than divides
    "+",        -- "+" track max values, "-" track min values with
    1,          -- font size 1=small, 2=big
    0.2,        -- warning level (nil is do not use feature)
    0.4,        -- critical level (nil is do not use feature)
  }
}

------------------------------------------------------
-- the script can optionally look up values here
-- for each sensor and display the corresponding text instead
-- as an example to associate a lookup table to sensor 3 declare it like
--
--local lookups = {
-- [3] = {
--     [-10] = "ERR",
--     [0] = "OK",
--     [10] = "CRIT",
--   }
-- }
-- this would display the sensor value except when the value corresponds to one
-- of entered above
-- 
local lookups = {
}

collectgarbage()

return {
  sensors=sensors,lookups=lookups
}