Some errors in rule since snapshot 2.3 #1231

Hi, i get the following errors inside my rules-file:

Since #1231. With old versions until #1227 it worked.

rule "Präsenzmelder State Changed"
	when
		Item gPraesenz received update // NOTE: the rule will trigger multiple times per event
	then
		Thread::sleep(500) // give persistence time to catch up
                // logInfo("Test PM", "Test Änderung erkannt")
		val haveHistory = gPraesenz.members.filter[c|c.lastUpdate("mapdb") !== null]
		val mostRecent = haveHistory.sortBy[lastUpdate("mapdb")].last
		if(mostRecent === null) logError("Test PM", "Failed to find most recent")
		else if(mostRecent.state == ON){
				val dt = gPraesenzZeit.members.filter[dt|dt.name == mostRecent.name+"_last_movement"].head
                                // logInfo("Test PM", mostRecent.name + " is ON")
				if(dt === null) logError("Test PM", "Failed to find " + mostRecent.name+"_last_movement")
                                else if(dt === NULL) logError("Test PM", "Failed to find " + mostRecent.name+"_last_movement")
				else dt.postUpdate(new DateTimeType)
		}
		// else if(mostRecent.state != ON){
		//        	logInfo("Test PM", mostRecent.name + " is not ON")
		// }
end

I found the solution myself:

But i still have some warnings:

rule "PV-Leistung - Strahlung Average"
when
	Item stromzaehler1_radiation received update
then
	stromzaehler1_radiation_Avrg_10min.postUpdate(stromzaehler1_radiation.averageSince(now.minusMinutes(10), "rrd4j"))
	stromzaehler1_radiation_Avrg_30min.postUpdate(stromzaehler1_radiation.averageSince(now.minusMinutes(30), "rrd4j"))
end

Items:

Number stromzaehler1_radiation    "Stromzähler PV Total-Strahlung [%.2f]"    <solarplant>    (gSolarStrahlung)
Number stromzaehler1_radiation_Avrg_10min    "Strom Total-Strahlung avg 10min [%.2f]"    <solarplant>    (gSolarStrahlung)
Number stromzaehler1_radiation_Avrg_30min    "Strom Total-Strahlung avg 30min [%.2f]"    <solarplant>    (gSolarStrahlung)

@halloween change to

stromzaehler1_radiation_Avrg_10min.postUpdate(stromzaehler1_radiation.averageSince(now.minusMinutes(10), "rrd4j").toString)
1 Like

Thanks, that helped.