Confusing about 1 and 1.0 in rules

Nope, that was your choice.

It’s the obvious, most effective way to get restore-on-startup.
The mapdb docs tell you what it does.
openHAB is flexible, does offer alternatives, and doesn’t force you to use mapdb as the One True Way.

You can do that yourself.
(It is true that mapdb doesn’t sell itself until you look at its own page)

I think you’re rather over reacting here.

I should I think! Cause Status_Home could be 4 or 4.0 :wink: Better change

if (DecimalType(items.Status_Home) == 4):

That should be the solution in python.

Still cutting parts out, because it’s room for room the same:

rule "Status_Heat-Control: Home"
when
   Item Status_Home changed to 1.0 or
   Item Status_Home changed to 1
then
var Number help
var int UpMin
var int UpMinD
var int currentHour = now.getHourOfDay



// Modus Thermostate Fussbodenheizung (OG) auf Eco zurücksetzen
logInfo("11_Status_Heat-Control-Home.rules","OG-Heating: Neuer Modus nun ECO")
gThermoModus.members.forEach[ i | 
	i.sendCommand(11)
	logInfo("11_Status_Heat-Control-Home.rules", "Auf Eco: " + i.name)
]

logInfo("11_Status_Heat-Control-Home.rules", "Einstellungen Zuhause: Setze Temperaturen hoch (" + currentHour.toString + " Uhr")

// LC-13 EG-Flur
// Nur, wenn Nachts Raum kälter als Tagessoll-Temperatur
if (EG_Flur_Sensor_Temperatur.state <= Pref_EG_Flur_Soll_Temp.state) {
	if (currentHour != 6) { UpMin=1 }
	else { UpMin=(Pref_EG_Flur_Soll_UpMin.state as Number).intValue }

	logInfo("11_Status_Heat-Control-Home.rules", "EG-Flur auf " + Pref_EG_Flur_Soll_Temp.state + " in " + UpMin.toString + "Min.")
	createTimer(now.plusMinutes(UpMin )) [|
// Falls sich bis zur Uptime der Modus geändert hat
	    if (Status_Home.state == 1.0) {
		logInfo("11_Status_Heat-Control-Home.rules", "Timer: EG-Flur jetzt erhöht")
		EG_Flur_Thermo_Soll_Temp.sendCommand(Pref_EG_Flur_Soll_Temp.state as Number) 
	    } else if (Status_Home.state == 3.0) {
		logInfo("11_Status_Heat-Control-Home.rules", "Timer: EG-Flur jetzt erhöht (Abwesend)")
		help=((Pref_EG_Flur_Soll_Temp.state as Number) - (Pref_Away_Soll_Decrease.state as Number)).doubleValue
		EG_Flur_Thermo_Soll_Temp.sendCommand(help) 
	    }
	]
}

// LC-13 EG-Bad
if (currentHour != 6) { UpMin=1 }
else { UpMin=(Pref_EG_Bad_Soll_UpMin.state as Number).intValue }
logInfo("11_Status_Heat-Control-Home.rules", "EG-Badezimmer auf " + Pref_EG_Bad_Soll_Temp.state + " in " + UpMin.toString + "Min.")
//    var Timer UptimerB=createTimer(now.plusMinutes(UpMin ))) [|
createTimer(now.plusMinutes(UpMin )) [|
	if ((Status_Home.state == 1.0) || (Status_Home.state == 1)) {
	    logInfo("11_Status_Heat-Control-Home.rules", "Timer: EG-Bad jetzt erhöht")	
	    if (EG_Bad_Window_Contact.state == CLOSED) {
		EG_Bad_Thermo_Soll_Temp.sendCommand(Pref_EG_Bad_Soll_Temp.state as Number)
	    }
	    else {
		TMP_EG_Bad_Soll_Temp.sendCommand(Pref_EG_Bad_Soll_Temp.state as Number)
		TMP_EG_Bad_Soll_Temp.postUpdate(Pref_EG_Bad_Soll_Temp.state as Number)
	    }
	} else if (Status_Home.state == 3.0) {
		logInfo("11_Status_Heat-Control-Home.rules", "Timer: EG-Bad jetzt erhöht (Abwesend)")
		help=((Pref_EG_Bad_Soll_Temp.state as Number) - (Pref_Away_Soll_Decrease.state as Number)).doubleValue
		if (EG_Bad_Window_Contact.state == CLOSED) {
		    EG_Bad_Thermo_Soll_Temp.sendCommand(help)
		} else {
		    TMP_EG_Bad_Soll_Temp.sendCommand(help)
		}
	}
//		UptimerB=null
]


// TRM2fx OG-Flur
if (currentHour != 6) { 
	UpMin=1 
	UpMinD=1 
} else { 
	UpMin=(Pref_OG_Flur_Soll_UpMin.state as Number).intValue 
	UpMinD=(Pref_OG_Flur_Display_UpMin.state as Number).intValue 
}
if (OG_Flur_Sensor_Temperatur.state <= Pref_OG_Flur_Soll_Temp.state) {
	logInfo("11_Status_Heat-Control-Home.rules", "OG-Flur auf " + Pref_OG_Flur_Soll_Temp.state + " in " + UpMin.toString + "Min.")
	createTimer(now.plusMinutes(UpMin )) [|
	    if ((Status_Home.state == 1.0) || (Status_Home.state == 1)) {
		logInfo("11_Status_Heat-Control-Home.rules", "Timer: OG-Flur jetzt erhöht")	
		OG_Flur_Thermo_Soll_Temp.sendCommand(Pref_OG_Flur_Soll_Temp.state as Number) 
		OG_Flur_Thermo_Soll_Temp.postUpdate(Pref_OG_Flur_Soll_Temp.state as Number) 
	    } else if (Status_Home.state == 3.0) {
		logInfo("11_Status_Heat-Control-Home.rules", "Timer: OG-Flur jetzt erhöht (Abwesend)")
		help=((Pref_OG_Flur_Soll_Temp.state as Number) - (Pref_Away_Soll_Decrease.state as Number)).doubleValue
		OG_Flur_Thermo_Soll_Temp.sendCommand(help)
		OG_Flur_Thermo_Soll_Temp.postUpdate(help)
	    }
	]
}

logInfo("11_Status_Heat-Control-Home.rules", "OG-Flur Display: " + Pref_OG_Flur_Disp_Day.state + " Buttons: "+Pref_OG_Flur_Butt_Day.state + "in " + UpMinD.toString + "Min.")
createTimer(now.plusMinutes(UpMinD )) [|
	if ((Status_Home.state == 1.0) || (Status_Home.state == 1)) {
	    logInfo("11_Status_Heat-Control-Home.rules", "Timer: OG-Flur Display jetzt erhellt")	
	    OG_Flur_Thermo_Display_Helligkeit.sendCommand((Pref_OG_Flur_Disp_Day.state as Number).intValue) 
	    OG_Flur_Thermo_Button_Helligkeit.sendCommand((Pref_OG_Flur_Butt_Day.state as Number).intValue) 
	}
]

// TRM2fx OG-Bad
if (currentHour != 6) { 
   UpMin=1 
   UpMinD=1 
} else { 
	UpMin=(Pref_OG_Bad_Soll_UpMin.state as Number).intValue 
	UpMinD=(Pref_OG_Bad_Display_UpMin.state as Number).intValue 
}
logInfo("11_Status_Heat-Control-Home.rules", "OG-Bad auf " + Pref_OG_Bad_Soll_Temp.state + " in " + UpMin.toString + "Min.")
createTimer(now.plusMinutes(UpMin )) [|
	if ((Status_Home.state == 1.0) || (Status_Home.state == 1)) {
	    logInfo("11_Status_Heat-Control-Home.rules", "Timer: OG-Bad jetzt erhöht")	
	    OG_Bad_Thermo_Soll_Temp.sendCommand(Pref_OG_Bad_Soll_Temp.state as Number) 
	    OG_Bad_Thermo_Soll_Temp.postUpdate(Pref_OG_Bad_Soll_Temp.state as Number) 
	} else if (Status_Home.state == 3.0) {
	    logInfo("11_Status_Heat-Control-Home.rules", "Timer: OG-Bad jetzt erhöht (Abwesend)")
	    help=((Pref_OG_Bad_Soll_Temp.state as Number) - (Pref_Away_Soll_Decrease.state as Number)).doubleValue
	    OG_Bad_Thermo_Soll_Temp.sendCommand(help)
	    OG_Bad_Thermo_Soll_Temp.postUpdate(help)
	}
]

logInfo("11_Status_Heat-Control-Home.rules", "OG-Bad Display: " + Pref_OG_Bad_Disp_Day.state + " Buttons: "+Pref_OG_Bad_Butt_Day.state + "in " + UpMinD.toString + "Min.")
createTimer(now.plusMinutes(UpMinD )) [|
	if ((Status_Home.state == 1.0) || (Status_Home.state == 1)) {
	    logInfo("11_Status_Heat-Control-Home.rules", "Timer: OG-Bad Display jetzt erhellt")	
	    OG_Bad_Thermo_Display_Helligkeit.sendCommand((Pref_OG_Bad_Disp_Day.state as Number).intValue) 
	    OG_Bad_Thermo_Button_Helligkeit.sendCommand((Pref_OG_Bad_Butt_Day.state as Number).intValue) 
	}
]


//		Downtimer = null
//		Uptimer = null
help = null
end

Maybe you are right.

Where I come from, that would be considered an insult. Especially when directed at the people who are spending their personal time to help you! I get it… it’s obvious to see there is a language barrier going on here, but I can’t think of any alternative translation that wouldn’t be insulting.

No. This will work for both cases…

if items.Status_Home == DecimalType(4):
1 Like

This is much simpler in Jython.

I excuse for that. english is not my mother language. It really hasn’t been my interest! You all do great work here and I’m thankful for it.

I try another way: Your work made openhab so great, so it should reach more people, including people don’t have your know how or so much time to read and try all variations openhab has got.

2 Likes