function checkActualStates () {
    /**
     * switch Holiday
     * @param {string|null} err
     * @param {ioBroker.State|null|undefined} state
     */
    adapter.getState('control.Holiday', (err, state) => {
        if (state) {
            holidayStr = state.val;
        }
    });

    /**
     * switch autoOnOff
     * @param {string|null} err
     * @param {ioBroker.State|null|undefined} state
     */
    adapter.getState('control.autoOnOff', (err, state) => {
        if (state) {
            autoOnOffStr = state.val;
        }
    });

    //
    if (adapter.config.publicHolidays === true && (adapter.config.publicHolInstance !== 'none' || adapter.config.publicHolInstance !== '')) {
        /**
         * Feiertag HEUTE
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */
        adapter.getForeignState(adapter.config.publicHolInstance + '.heute.boolean', (err, state) => {
            if (state) {
                publicHolidayStr = state.val;
            }
        });
        /**
         * Feiertag MORGEN
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */
        adapter.getForeignState(adapter.config.publicHolInstance + '.morgen.boolean', (err, state) => {
            if (state) {
                publicHolidayTomorrowStr = state.val;
            }
        });
    }

    if (adapter.config.weatherForecast === true && (adapter.config.weatherForInstance !== 'none' || adapter.config.weatherForInstance !== '')) {
        /**
         * Niederschlagsmenge HEUTE in mm
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */
        adapter.getForeignState(adapter.config.weatherForInstance + '.NextDaysDetailed.Location_1.Day_1.rain_value', (err, state) => {
            if (state) {
                if (typeof state.val == 'string') {
                    weatherForecastTodayNum = parseFloat(state.val);
                } else if (typeof state.val == 'number') {
                    weatherForecastTodayNum = state.val;
                } else {
                    weatherForecastTodayNum = 0;
                    console.log.info('checkActualStates => Wettervorhersage state.val ( ' + state.val + '; ' + typeof state.val + ' ) kann nicht als Number verarbeitet werden');
                }
                adapter.setState('info.rainToday', {
                    val: weatherForecastTodayNum,
                    ack: true
                });
            }
        });
        /**
         * Niederschlagsmenge MORGEN in mm
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */
        adapter.getForeignState(adapter.config.weatherForInstance, (err, state) => {
            if (state) {
                weatherForecastTomorrowNum = state.val;
                adapter.setState('info.rainTomorrow', {
                    val: weatherForecastTomorrowNum,
                    ack: true
                });
            }
        });
        /**
         * Füllstand der Zisterne in %
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */
        adapter.getForeignState(adapter.config.actualValueLevel, (err, state) => {
            if (typeof state !== undefined && state != null) {
                valveControl.setFillLevelCistern(parseFloat(state.val));
            }
        });
    }

    //
    adapter.getForeignObjects(adapter.namespace + '.sprinkle.*', 'channel',
        function (err, list) {
            if (err) {
                adapter.log.error(err);
            } else {
                ObjSprinkle = list;
            }
        });	
	
    //
    setTimeout(() => {
        createSprinklers();
    }, 1000);
    setTimeout(() => {
        startTimeSprinkle();
    }, 2000);
	
}
//	aktuelle States checken nach dem Start (2000 ms)
aktuelle States checken nach dem Start (2000 ms)
aktuelle States checken nach dem Start ( 2000 ms )
function checkActualStates () {
    adapter.getState('control.Holiday', (err, state) => {
        if (state) {
            holidayStr = state.val;
        }
    });
    adapter.getState('control.autoOnOff', (err, state) => {
        if (state) {
            autoOnOffStr = state.val;
        }
    });
    if (adapter.config.publicHolidays === true && (adapter.config.publicHolInstance !== 'none' || adapter.config.publicHolInstance !== '')) {
        adapter.getForeignState(adapter.config.publicHolInstance + '.heute.boolean', (err, state) => {
            if (state) {
                publicHolidayStr = state.val;
            }
        });
        adapter.getForeignState(adapter.config.publicHolInstance + '.morgen.boolean', (err, state) => {
            if (state) {
                publicHolidayTomorrowStr = state.val;
            }
        });
    }
    if (adapter.config.weatherForecast === true && (adapter.config.weatherForInstance !== 'none' || adapter.config.weatherForInstance !== '')) {
        adapter.getForeignState(adapter.config.weatherForInstance + '.NextDaysDetailed.Location_1.Day_1.rain_value', (err, state) => {
            if (state) {
                if (typeof state.val == 'string') {
                    weatherForecastTodayNum = parseFloat(state.val);
                } else if (typeof state.val == 'number') {
                    weatherForecastTodayNum = state.val;
                } else {
                    weatherForecastTodayNum = 0;
                    console.log.info('checkActualStates => Wettervorhersage state.val ( ' + state.val + '; ' + typeof state.val + ' ) kann nicht als Number verarbeitet werden');
                }
                adapter.setState('info.rainToday', {
                    val: weatherForecastTodayNum,
                    ack: true
                });
            }
        });
        adapter.getForeignState(adapter.config.weatherForInstance, (err, state) => {
            if (state) {
                weatherForecastTomorrowNum = state.val;
                adapter.setState('info.rainTomorrow', {
                    val: weatherForecastTomorrowNum,
                    ack: true
                });
            }
        });
        adapter.getForeignState(adapter.config.actualValueLevel, (err, state) => {
            if (typeof state !== undefined && state != null) {
                valveControl.setFillLevelCistern(parseFloat(state.val));
            }
        });
    }
    adapter.getForeignObjects(adapter.namespace + '.sprinkle.*', 'channel',
        function (err, list) {
            if (err) {
                adapter.log.error(err);
            } else {
                ObjSprinkle = list;
            }
        });	
    setTimeout(() => {
        createSprinklers();
    }, 1000);
    setTimeout(() => {
        startTimeSprinkle();
    }, 2000);
}
function checkActualStates ( ) { adapter . getState ( 'control.Holiday' , ( err , state ) => { if ( state ) { holidayStr = state . val ; } } ) ; adapter . getState ( 'control.autoOnOff' , ( err , state ) => { if ( state ) { autoOnOffStr = state . val ; } } ) ; if ( adapter . config . publicHolidays === true && ( adapter . config . publicHolInstance !== 'none' || adapter . config . publicHolInstance !== '' ) ) { adapter . getForeignState ( adapter . config . publicHolInstance + '.heute.boolean' , ( err , state ) => { if ( state ) { publicHolidayStr = state . val ; } } ) ; adapter . getForeignState ( adapter . config . publicHolInstance + '.morgen.boolean' , ( err , state ) => { if ( state ) { publicHolidayTomorrowStr = state . val ; } } ) ; } if ( adapter . config . weatherForecast === true && ( adapter . config . weatherForInstance !== 'none' || adapter . config . weatherForInstance !== '' ) ) { adapter . getForeignState ( adapter . config . weatherForInstance + '.NextDaysDetailed.Location_1.Day_1.rain_value' , ( err , state ) => { if ( state ) { if ( typeof state . val == 'string' ) { weatherForecastTodayNum = parseFloat ( state . val ) ; } else if ( typeof state . val == 'number' ) { weatherForecastTodayNum = state . val ; } else { weatherForecastTodayNum = 0 ; console . log . info ( 'checkActualStates => Wettervorhersage state.val ( ' + state . val + '; ' + typeof state . val + ' ) kann nicht als Number verarbeitet werden' ) ; } adapter . setState ( 'info.rainToday' , { val : weatherForecastTodayNum , ack : true } ) ; } } ) ; adapter . getForeignState ( adapter . config . weatherForInstance , ( err , state ) => { if ( state ) { weatherForecastTomorrowNum = state . val ; adapter . setState ( 'info.rainTomorrow' , { val : weatherForecastTomorrowNum , ack : true } ) ; } } ) ; adapter . getForeignState ( adapter . config . actualValueLevel , ( err , state ) => { if ( typeof state !== undefined && state != null ) { valveControl . setFillLevelCistern ( parseFloat ( state . val ) ) ; } } ) ; } adapter . getForeignObjects ( adapter . namespace + '.sprinkle.*' , 'channel' , function ( err , list ) { if ( err ) { adapter . log . error ( err ) ; } else { ObjSprinkle = list ; } } ) ; setTimeout ( ( ) => { createSprinklers ( ) ; } , 1000 ) ; setTimeout ( ( ) => { startTimeSprinkle ( ) ; } , 2000 ) ; }
aktuelle States checken nach dem Start (2000 ms)
aktuelle States checken nach dem Start ( 2000 ms )
/**
     * switch Holiday
     * @param {string|null} err
     * @param {ioBroker.State|null|undefined} state
     */ /**
     * switch autoOnOff
     * @param {string|null} err
     * @param {ioBroker.State|null|undefined} state
     */ // /**
         * Feiertag HEUTE
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */ /**
         * Feiertag MORGEN
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */ /**
         * Niederschlagsmenge HEUTE in mm
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */ /**
         * Niederschlagsmenge MORGEN in mm
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */ /**
         * Füllstand der Zisterne in %
         * @param {string|null} err
         * @param {ioBroker.State|null|undefined} state
         */ // //