Hello Folks,
i want to update to OH3 but i have many timers an such sort of things. After the update all of this stop working.
What type of changes do i need?
My working OH2 Script looks is this
var Timer rueckfallzeitduschbad = null
var Timer duschbadlichttimer = null
//Bewegungsmelder
//Licht Duschbad
rule "Licht Duschbad Rückfallzeit"
when
Item Duschbad_licht changed
then
if( Duschbad_licht.state != 0 ) {
if (rueckfallzeitduschbad !== null){
rueckfallzeitduschbad.cancel()
rueckfallzeitduschbad = null
}
else
//logInfo("Duschbadlicht", "Rückfallzeit gestartet")
rueckfallzeitduschbad = createTimer(now.plusMinutes(60)) [| Duschbad_licht.sendCommand(0) rueckfallzeitduschbad = null]
}
else {
//logInfo("Duschbadlicht", "Rückfallzeit zurückgesetzt")
rueckfallzeitduschbad.cancel()
rueckfallzeitduschbad = null
}
end
rule "Licht Duschbad einschalten Präsenzsmelder"
when
Item Duschbadpraesenz_Status changed
then
if (Duschbadpraesenz_Status.state == 1){
if(duschbadlichttimer !== null ) {
//logInfo("Duschbadlicht", "Auscchalten Timer gestoppt")
duschbadlichttimer.cancel()
duschbadlichttimer = null
}
else
if(Tag_Nacht_Lichter.state== ON){
if((Helligkeit_Duschbad.state<60)&&(Duschbad_licht.state == 0)) {
//logInfo("Duschbadlicht", "Licht Tag an")
Duschbad_licht.sendCommand(100)
}
}
else {
if((Helligkeit_Duschbad.state<60)&&(Duschbad_licht.state == 0)){
//logInfo("Duschbadlicht", "Licht Tag Nacht")
Duschbad_licht.sendCommand(5)
}
}
}
else
{
if( duschbadlichttimer === null ) {
//logInfo("Duschbadlicht", "Ausschalten gestartet")
duschbadlichttimer = createTimer(now.plusMinutes(5)) [| Duschbad_licht.sendCommand(0) duschbadlichttimer = null]
}
}
end
The Item “Tag_Nacht_Lichter” is an switch that updated with this rule
rule "Lichter in Tag oder Nachtmodus schalten"
when
Item KNX_Zeit changed //NTP-Server Item
then
if( (isWeekend == true) || (isBankHoliday == true) ) {
if( (now.getHourOfDay == (Tag_Nacht_morgens_Stunde_Lichter_Wochenende.state as DecimalType).intValue)&&(now.getMinuteOfHour == (Tag_Nacht_morgens_Minute_Lichter_Wochenende.state as DecimalType).intValue)) {
if (Tag_Nacht_Lichter.state != ON){
Tag_Nacht_Lichter.sendCommand(ON)
}
}
else
if((now.getHourOfDay == (Tag_Nacht_abend_Stunde_Lichter_Wochenende.state as DecimalType).intValue)&&(now.getMinuteOfHour == (Tag_Nacht_abend_Minute_Lichter_Wochenende.state as DecimalType).intValue) ) {
if (Tag_Nacht_Lichter.state != OFF){
Tag_Nacht_Lichter.sendCommand(OFF)
}
}
}
else {
if( (now.getHourOfDay == (Tag_Nacht_morgens_Stunde_Lichter.state as DecimalType).intValue)&&(now.getMinuteOfHour == (Tag_Nacht_morgens_Minute_Lichter.state as DecimalType).intValue)) {
if (Tag_Nacht_Lichter.state != ON){
Tag_Nacht_Lichter.sendCommand(ON)
}
}
else
if((now.getHourOfDay == (Tag_Nacht_abend_Stunde_Lichter.state as DecimalType).intValue)&&(now.getMinuteOfHour == (Tag_Nacht_abend_Minute_Lichter.state as DecimalType).intValue) ) {
if (Tag_Nacht_Lichter.state != OFF){
Tag_Nacht_Lichter.sendCommand(OFF)
}
}
}
end
All other configuration works pretty fine on OH3 except my issue.
I hope anyone can help me.
Best regards