Ankündigung

Einklappen
Keine Ankündigung bisher.

[SOLVED] given new state is NULL, couldn't post update

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    [SOLVED] given new state is NULL, couldn't post update

    Hallo zusammen,

    ich habe ein interessantes Problem:

    Ich habe mehrere Regeln die den Min und Max Wert für einen Zeitraum raussuchen und in ein Item speichern.

    Das Funktioniert beim Ersten Item, beim Zweiten aber nicht mehr. Dort bekomme ich immer den Fehler:

    12:40:42.199 WARN o.o.c.i.e.EventPublisherImpl[:80]- given new state is NULL, couldn't post update for 'HEIZUNG_WW_IST_TEMP_Min_1W'

    12:40:51.086 WARN o.o.c.i.e.EventPublisherImpl[:80]- given new state is NULL, couldn't post update for 'HEIZUNG_WW_IST_TEMP_Max_1W'

    Habe mir die Funktionierende Regel kopiert, und nur die Item Namen angepasst:

    Items:

    Code:
    Number			HEIZUNG_WW_IST_TEMP				"Warm Wasser Ist Temp. [%.1f °C]"			<temperature>			(GRP_HEIZUNG,HEIZUNG_WW_IST_TEMP_Chart)	{ exec="<[/opt/openhab/etc/ems_ww_ist_temp.php:120000:REGEX((.*?))]" }
    Number			HEIZUNG_WW_IST_TEMP_Min_1W		"Warm Wasser Ist Temp. Min. (1W) [%s]"		<temperature>			
    Number			HEIZUNG_WW_IST_TEMP_Max_1W		"Warm Wasser Ist Temp. Max. (1W) [%s]"		<temperature>
    Und die entsprechende Rule:

    Code:
    rule "HEIZUNG_WW_IST_TEMP Update Temperature Min- and Max values"
    when
    		Item HEIZUNG_WW_IST_TEMP received update
    then
    		var Number Min
    		var Number Max
    		var String tmp
    		var SimpleDateFormat df = new SimpleDateFormat( "dd.MM.yy - HH:mm" ) 
    		logInfo("HEIZUNG","WWW_IST_TEMP Value: " + HEIZUNG_WW_IST_TEMP.state)  // fürs DEBUGGING: Bsp. Output: WWW_IST_TEMP Value: 52.5
    
    		
    		if (HEIZUNG_WW_IST_TEMP.state instanceof DecimalType)
    			{
    			logInfo("HEIZUNG","HEIZUNG_WW_IST_TEMP DecType: True") // fürs DEBUGGING
    			Min = (HEIZUNG_WW_IST_TEMP.minimumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").state as DecimalType)
    			logInfo("HEIZUNG","HEIZUNG_WW_IST_TEMP_Min Value: " + Min)  // fürs  DEBUGGING Bsp. Output: HEIZUNG_WW_IST_TEMP_Min Value: 52.238879310344808573063346557319164276123046875
    			tmp = (Math::round(Min.floatValue*10.0)/10.0) + " °C (" + df.format(HEIZUNG_WW_IST_TEMP.minimumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").timestamp) + " Uhr)"
    			logInfo("HEIZUNG","HEIZUNG_WW_IST_TEMP_TMP Value: " + tmp)  // fürs DEBUGGING: Bsp. Output: HEIZUNG_WW_IST_TEMP_TMP Value: 52.2 �C (06.07.14 - 07:00 Uhr)
    
    
    			postUpdate(HEIZUNG_WW_IST_TEMP_Min_1W, tmp)
    
    			Max = (HEIZUNG_WW_IST_TEMP.maximumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").state as DecimalType)
    			df = new SimpleDateFormat( "dd.MM.yy - HH:mm" ) 
    			tmp = (Math::round(Max.floatValue*10.0)/10.0) + " °C (" + df.format(HEIZUNG_WW_IST_TEMP.maximumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").timestamp) + " Uhr)"
    			postUpdate(HEIZUNG_WW_IST_TEMP_Max_1W, tmp)
    			}
    end
    Und hier noch mal zum Vergleich die Funktionierende Rule:

    Items:
    Code:
    Number			TEMP_WWW_AUSSEN						"Aussentemperatur [%.1f °C]"					<temperature>	(TEMP_WWW_AUSSEN_Chart)		{ exec="<[/opt/openhab/etc/ems_aussen_temp.php:120000:REGEX((.*?))]" }
    String			TEMP_WWW_AUSSEN_Min_1W				"Aussentemp. Min. Temp (1W) [%s]"								<temperature>
    String			TEMP_WWW_AUSSEN_Max_1W				"Aussentemp. Max. Temp (1W) [%s]"								<temperature>
    Rule:
    Code:
    rule "TEMP_WWW_AUSSEN_1W Update Temperature Min- and Max values"
    when
    		Item TEMP_WWW_AUSSEN received update
    then
    		var Number Min
    		var Number Max
    		var String tmp
    		var SimpleDateFormat df = new SimpleDateFormat( "dd.MM.yy - HH:mm" )
    //		logInfo("HEIZUNG","TEMP_WWW_AUSSEN Value: " + TEMP_WWW_AUSSEN.state) 
    		if (TEMP_WWW_AUSSEN.state instanceof DecimalType)
    			{
    			Min = (TEMP_WWW_AUSSEN.minimumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").state as DecimalType)
    			tmp = (Math::round(Min.floatValue*10.0)/10.0) + " °C (" + df.format(TEMP_WWW_AUSSEN.minimumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").timestamp) + " Uhr)"
    			logInfo("HEIZUNG","TEMP_WWW_AUSSEN_Min_OW Value: " + tmp)
    			postUpdate(TEMP_WWW_AUSSEN_Min_1W, tmp)
    			
    
    			Max = TEMP_WWW_AUSSEN.maximumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").state as DecimalType
    			df = new SimpleDateFormat( "dd.MM.yy - HH:mm" ) 
    			tmp = (Math::round(Max.floatValue*10.0)/10.0) + " °C (" + df.format(TEMP_WWW_AUSSEN.maximumSince((now.minusWeeks(1)).toDateMidnight, "rrd4j").timestamp) + " Uhr)"
    			postUpdate(TEMP_WWW_AUSSEN_Max_1W, tmp)
    			}
    end

    Die Werte im Logging sehen identisch aus:

    12:34:38.362 INFO o.openhab.model.script.HEIZUNG[:53]- TEMP_WWW_AUSSEN Value: 22
    12:34:38.362 INFO o.openhab.model.script.HEIZUNG[:53]- TEMP_WWW_AUSSEN_MIN Value: 7.079722222222224026211279124254360795021057128906 25
    12:34:38.362 INFO o.openhab.model.script.HEIZUNG[:53]- TEMP_WWW_AUSSEN_Min_1W Value: 7.1 �C (02.07.14 - 06:00 Uhr)



    12:34:26.148 INFO o.openhab.model.script.HEIZUNG[:53]- HEIZUNG_WW_IST_TEMP Value: 48.7
    12:36:34.521 INFO o.openhab.model.script.HEIZUNG[:53]- HEIZUNG_WW_IST_TEMP_Min Value: 48.728879310344808573063346557319164276123046875
    12:36:38.458 INFO o.openhab.model.script.HEIZUNG[:53]- HEIZUNG_WW_IST_TEMP_TMP Value: 48.7 �C (06.07.14 - 07:00 Uhr)

    Vielleicht sehe ich einfach den Wald vor lauter Bäumen nicht ;-)

    #2
    Hab den Wald gefunden :-)

    Die Items waren als Number deklariert. Nicht Als STRING!!!

    Danke WMF...

    Kommentar

    Lädt...
    X