Extra Sensors: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
1,109 bytes added ,  20:29, 26 November 2022
m
mNo edit summary
(6 intermediate revisions by the same user not shown)
Line 14: Line 14:


=== Dependency ===
=== Dependency ===
Unlike other modules the Extra Sensors module is dependent on the [[ChartsCompiler]] which means that the file CutilsCharts.def must be present in the utils directory. This may contain a user made charts definition but for a starting user it will be easiest to just copy the file ''CutilsCharts-default-for-use.def'' from the distribution and rename it to ''CutilsCharts.def''.  
Unlike other modules the Extra Sensors module is dependent on the [[ChartsCompiler]] which means that the file CutilsCharts.def must be present in the utils directory. This may contain a user made charts definition but for a starting user it will be easiest to just copy the file ''CutilsCharts-default-for-use.def'' from the distribution and rename it to ''CutilsCharts.def''. Make sure that your CMX configured datafiles and the charts definitions agree, if they don't than you won't see data lines or/and get errors in the console.


User made or just default, the file '''''MUST''''' contain the lines
User made or just default, the file '''''MUST''''' contain the lines
Line 26: Line 26:


== Operation ==
== Operation ==
#CumulusUtils must be run once with the  command ''ExtraSensors'' or ''Website'' to create the required parameters in the section ''[ExtraSensors]'' in the inifile.
#CumulusUtils must be run once with the  command ''ExtraSensors'' (fastest) or ''Website'' to create the required parameters in the section ''[ExtraSensors]'' in the inifile.
#The module requires that the user has ''Extra Sensor'' logging enabled in CumulusMX(''CMX menu=>Station Settings=>Common Options=>Log Extra sensors'' must be enabled) AND the user must set the parameter ''ExtraSensors'' in the cumulusutils.ini file to ''true''. This last parameter makes it possible to have ''Extra Sensors'' operational in CMX but not display them on the web (if you are generating the website). Once both parameters are set to true the module is active.  
#The module requires that the user has ''Extra Sensor'' logging enabled in CumulusMX(''CMX menu=>Station Settings=>Common Options=>Log Extra sensors'' must be enabled) AND the user must set the parameter ''ExtraSensors'' in the cumulusutils.ini file to ''true''. This last parameter makes it possible to have ''Extra Sensors'' operational in CMX but not display them on the web (if you are generating the website). Once both parameters are set to true the module is active.  
#Finally, to make it work and to bring system in the ''Extra Sensors'', '''it is required''' for the user to use ''strings.ini'' (copy it from samplestrings.ini in the distribution of CumulusMX) in the CumulusMX directory and give the sensors you want to be handled by CumulusUtils '''a short meaningfull name'''. Leave the default value or remove the default value to make an empty string to have CumulusUtils ignore the sensor. '''Default value or empty define a sensor as NOT PRESENT.''' Existing sensors which keep their default names (or have empty entries) will be displayed in the CMX interface but will not be used by CumulusUtils.
#After the first run the following inifile parameters exist: ''ExtraTemp, ExtraHum, ExtraDP, SoilTemperature, SoilMoisture, AirQuality, UserTemp, LeafTemp, LeafWetness''. Filling these with e.g. '''1,2,3''' activates those sensors and a subsequent run will show these under the menu choice ''Extra''.
#Finally, to make it work and to bring system in the ''Extra Sensors'', '''it is required''' for the user to use ''strings.ini'' (copy it from samplestrings.ini in the distribution of CumulusMX) in the CumulusMX directory and give the sensors you want to be handled by CumulusUtils '''a short meaningfull name'''.  


For the [[Website_Generator|Website Generator]] this means everything is automatically available in the menu of the website.
For the [[Website_Generator|Website Generator]] this means everything is automatically available in the menu of the website.
Line 75: Line 76:
                                               (NOTE that this sensor is not logged by CMX and therefore does not have a corresponding chart)
                                               (NOTE that this sensor is not logged by CMX and therefore does not have a corresponding chart)
   ExternalExtraSensors=                    => A comma separated list of strings naming the External Extra Sensors the user wishes to use (See [[External Extra Sensors]])
   ExternalExtraSensors=                    => A comma separated list of strings naming the External Extra Sensors the user wishes to use (See [[External Extra Sensors]])
This list of parameters defines which extra sensors are used in your system (combine with strings.txt for the descriptions (Captions) used):
  ExtraTemp=                              =>  fill with comma separated digits from 1 - 8
  ExtraHum=                                =>  fill with comma separated digits from 1 - 8
  ExtraDP=                                =>  fill with comma separated digits from 1 - 8
  SoilTemperature=                        =>  fill with comma separated digits from 1 - 16
  SoilMoisture=                            =>  fill with comma separated digits from 1 - 16
  AirQuality=                              =>  fill with comma separated digits from 1 - 4
  UserTemp=                                =>  fill with comma separated digits from 1 - 8
  LeafTemp=                                =>  fill with comma separated digits from 1 - 2
  LeafWetness=                            =>  fill with comma separated digits from 1 - 2
NOTE: the Ecowitt CO2 sensor is not parameterised but its presence is detected by the presence of a value in the database. Implicitly it is always assumed to be required to be displayed<br/>
NOTE: the Ecowitt AirQuality sensors have an implicit accompanying AirQualityAvg giving the 24 hr average


== Inner working ==
== Inner working ==
When run it is first checked if anything has to be done through the parameters ''ExtraSensors'' (in cumulusutils.ini) and ''LogExtraSensors'' (in Cumulus.ini).  
When run it is first checked if anything has to be done through the parameters ''ExtraSensors'' (in cumulusutils.ini) and ''LogExtraSensors'' (in Cumulus.ini).  


When both parameters are true then the names of the extra sensors in ''strings.ini'' are checked if they deviate from the default. If they deviate it means the user has changed the name which is taken as a proof of presence of an ''Extra Sensor''. NOTE: the sensors are intended to be defined in a contiguous order, so defining ''sensor 1'' and ''sensor 3'' would leave open ''sensor 2''. If ''sensor 2'' is not connected you would need to give it a name (e.g. ''Not Connected''). It will be displayed but always have a value 0. This may change in future versions.
When both parameters are true then sensors are checked from the parameters and the names of the extra sensors in ''strings.ini'' are fetched.


A sensor present means the realtime data and a corresponding chart will be created for presentation. The only sensor where the name in ''strings.ini'' is not determinant for its presence is the Ecowitt CO2 sensor. Those names may be changed by the user, but only a value in the logfile for the CO2 value is taken as proof of presence.
A sensor present means the realtime data and a corresponding chart will be created for presentation. The only sensor where a parameter is not determinant for its presence is the Ecowitt CO2 sensor. Those names may be changed by the user, but only a value in the logfile for the CO2 value is taken as proof of presence. Currently a CO2 is always shown on the website. This may change in future when requested.


A structure is created for each sensor present. Each AirQuality sensor is automatically coupled with an AirQualityAvg sensor (which is not a physical sensor by itself) for presentation. For each CO2 sensor all seven successive sensors (see strings.ini) are also created.
A structure is created for each sensor present. Each AirQuality sensor is automatically coupled with an AirQualityAvg sensor (which is not a physical sensor by itself) for presentation. For each CO2 sensor all seven successive sensors (see strings.ini) are also created.


With the list of sensors the extrasensorsrealtime.txt is generated, followed by extrasensors.txt (the code) and the charts are added to CutilsCharts.def. The last line of the userdefined charts is:
With the list of sensors the extrasensorsrealtime.txt is generated, followed by extrasensors.txt (the code) and the charts are added to CutilsCharts.def. The last line of the userdefined charts is:
; ExtraSensorCharts
  ; DO NOT CHANGE ANYTHING BELOW THIS INDICATOR LINE
  ; ExtraSensorCharts
After this line no changes may be made unless the parameter ''UserModificationExtraSensorCharts=true''. This line marks the beginning of the ''Extra Sensor Chart definitions''.
After this line no changes may be made unless the parameter ''UserModificationExtraSensorCharts=true''. This line marks the beginning of the ''Extra Sensor Chart definitions''.
The actual charts code is generated by the compiler. The compiler runs implicitly when generating the website or when generating ExtraSensors as a module.
The actual charts code is generated by the compiler. The compiler runs implicitly when generating the website or when generating ExtraSensors as a module.

Navigation menu