main.js
/**
     * createNO2
     *
     * creates the data fields for the values itself and the index if the device has a NO2 sensor
     *
     * @param message {object} the received mqtt message
     * @param row     {string} the current data row
     * @param device  {object} the device object the data is valid for
     */
createNO2
creates the data fields for the values itself and the index if the device has a NO2 sensor

@param message {object} the received mqtt message
@param row     {string} the current data row
@param device  {object} the device object the data is valid for
createNO2 creates the data fields for the values itself and the index if the device has a NO2 sensor @param message { object } the received mqtt message @param row { string } the current data row @param device { object } the device object the data is valid for
createNO2(message, row, device) {
        let NO2Index = 0;
        if (message[row].noxl < 4) {
            NO2Index = 0;
        } else if (message[row].noxl >= 4 && message[row].noxl <= 6) {
            NO2Index = 1;
        } else if (message[row].noxl >= 7 && message[row].noxl <= 8) {
            NO2Index = 2;
        } else if (message[row].noxl >= 9) {
            NO2Index = 3;
        }
        this.createOrExtendObject(device.Serial + '.Sensor.NO2Index', {
            type: 'state',
            common: {
                name: 'NO2 QualityIndex. 0-3: Good, 4-6: Medium, 7-8, Bad, >9: very Bad',
                'read': true,
                'write': false,
                'role': 'value',
                'type': 'number',
                'states' : {0:'Good', 1:'Medium', 2:'Bad', 3:'very Bad', 4:'extremely Bad', 5:'worrying'}
            },
            native: {}
        }, NO2Index);
        NO2 = NO2Index;
        this.subscribeStates(device.Serial + '.Sensor.NO2Index' );
    }
createNO2 ( message , row , device ) { let NO2Index = 0 ; if ( message [ row ] . noxl < 4 ) { NO2Index = 0 ; } else if ( message [ row ] . noxl >= 4 && message [ row ] . noxl <= 6 ) { NO2Index = 1 ; } else if ( message [ row ] . noxl >= 7 && message [ row ] . noxl <= 8 ) { NO2Index = 2 ; } else if ( message [ row ] . noxl >= 9 ) { NO2Index = 3 ; } this . createOrExtendObject ( device . Serial + '.Sensor.NO2Index' , { type : 'state' , common : { name : 'NO2 QualityIndex. 0-3: Good, 4-6: Medium, 7-8, Bad, >9: very Bad' , 'read' : true , 'write' : false , 'role' : 'value' , 'type' : 'number' , 'states' : { 0 : 'Good' , 1 : 'Medium' , 2 : 'Bad' , 3 : 'very Bad' , 4 : 'extremely Bad' , 5 : 'worrying' } } , native : { } } , NO2Index ) ; NO2 = NO2Index ; this . subscribeStates ( device . Serial + '.Sensor.NO2Index' ) ; }
createNO2
 creates the data fields for the values itself and the index if the device has a NO2 sensor
createNO2 creates the data fields for the values itself and the index if the device has a NO2 sensor
// NO2 QualityIndex // 0-3: Good, 4-6: Medium, 7-8, Bad, >9: very Bad