From 682bbb5bb4b38bf36f946fcede2c5738d16b1817 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 27 Oct 2023 19:34:12 +0200 Subject: [PATCH] make the N2K source configurable for humidity and temperature --- lib/iictask/GwIicTask.cpp | 4 +- lib/iictask/config.json | 129 ++++++++++++++++++++++++++++++++------ 2 files changed, 113 insertions(+), 20 deletions(-) diff --git a/lib/iictask/GwIicTask.cpp b/lib/iictask/GwIicTask.cpp index 1639973..ea742b1 100644 --- a/lib/iictask/GwIicTask.cpp +++ b/lib/iictask/GwIicTask.cpp @@ -32,8 +32,8 @@ class SHT3XConfig{ humidActive=config->getBool(GwConfigDefinitions::iicSHT3XHumid); interval=config->getInt(GwConfigDefinitions::SHT3Xinterval); interval*=1000; - humiditySource=N2khs_InsideHumidity; - tempSource=N2kts_InsideTemperature; + humiditySource=(tN2kHumiditySource)(config->getInt(GwConfigDefinitions::SHT3XHumSource)); + tempSource=(tN2kTempSource)(config->getInt(GwConfigDefinitions::SHT3XTempSource)); } }; diff --git a/lib/iictask/config.json b/lib/iictask/config.json index bf29dc5..64b056b 100644 --- a/lib/iictask/config.json +++ b/lib/iictask/config.json @@ -10,6 +10,83 @@ "SHT3X":"true" } }, + { + "name": "SHT3XTempSource", + "label": "SHT3X Temp Type", + "type": "list", + "default": "2", + "description": "the NMEA2000 source type for the temperature", + "list": [ + { + "l": "SeaTemperature", + "v": "0" + }, + { + "l": "OutsideTemperature", + "v": "1" + }, + { + "l": "InsideTemperature", + "v": "2" + }, + { + "l": "EngineRoomTemperature", + "v": "3" + }, + { + "l": "MainCabinTemperature", + "v": "4" + }, + { + "l": "LiveWellTemperature", + "v": "5" + }, + { + "l": "BaitWellTemperature", + "v": "6" + }, + { + "l": "RefridgerationTemperature", + "v": "7" + }, + { + "l": "HeatingSystemTemperature", + "v": "8" + }, + { + "l": "DewPointTemperature", + "v": "9" + }, + { + "l": "ApparentWindChillTemperature", + "v": "10" + }, + { + "l": "TheoreticalWindChillTemperature", + "v": "11" + }, + { + "l": "HeatIndexTemperature", + "v": "12" + }, + { + "l": "FreezerTemperature", + "v": "13" + }, + { + "l": "ExhaustGasTemperature", + "v": "14" + }, + { + "l": "ShaftSealTemperature", + "v": "15" + } + ], + "category": "sensors", + "capabilities": { + "SHT3X":"true" + } + }, { "name": "iicSHT3XHumid", "label": "SHT3X Humidity", @@ -22,22 +99,16 @@ } }, { - "name": "SHT3XTempName", - "label": "SHT3X Temp XDR", - "type": "String", - "default": "Temp", - "description": "set the XDR transducer name for the SHT3X Temperature, leave empty to disable ", - "category": "sensors", - "capabilities": { - "SHT3X":"true" - } - }, - { - "name": "SHT3XHumidName", - "label": "SHT3X Humid XDR", - "type": "String", - "default": "Humidity", - "description": "set the XDR transducer name for the SHT3X Humidity, leave empty to disable ", + "name": "SHT3XHumSource", + "label": "SHT3X Humid Type", + "type": "list", + "description": "the NMEA2000 source type for the humidity", + "default": "0", + "list":[ + {"l":"InsideHumidity","v":"0"}, + {"l":"OutsideHumidity","v":"1"}, + {"l":"Undef","v":"0xff"} + ], "category": "sensors", "capabilities": { "SHT3X":"true" @@ -48,10 +119,10 @@ "label": "SHT3X N2K iid", "type": "number", "default": 99, - "description": "the N2K instance id the SHT3X Temperature and Humidity ", + "description": "the N2K instance id for the SHT3X Temperature and Humidity ", "category": "sensors", "min": 0, - "max": 255, + "max": 253, "check": "checkMinMax", "capabilities": { "SHT3X":"true" @@ -70,5 +141,27 @@ "capabilities": { "SHT3X":"true" } + }, + { + "name": "SHT3XTempName", + "label": "SHT3X Temp XDR", + "type": "String", + "default": "Temp", + "description": "set the XDR transducer name for the SHT3X Temperature, leave empty to disable NMEA0183 XDR ", + "category": "sensors", + "capabilities": { + "SHT3X":"true" + } + }, + { + "name": "SHT3XHumidName", + "label": "SHT3X Humid XDR", + "type": "String", + "default": "Humidity", + "description": "set the XDR transducer name for the SHT3X Humidity, leave empty to disable NMEA0183 XDR", + "category": "sensors", + "capabilities": { + "SHT3X":"true" + } } ]