[SOLVED] Rules error

  • Platform information:
    • Hardware: Intel i3
    • OS: Win 10 1809 x64
    • Java Runtime Environment: 1.8
    • openHAB version: 2.4.0

Hello,

I’m having a small issue with all my rules in visual studio code. Here’s a rule exemple

var Timer delayLoadTimer = null
var boolean timerLoaded = false

rule "System Started"
when
	System started
then
	if (timerLoaded == false){
		val delayLoadTime = now.plusMinutes(1)
        delayLoadTimer = createTimer(delayLoadTime, [|
            if (wemo_SocketSalonIsLight.state == ON){
				wemo_lumiere_interieur_etage.addMember(wemo_SocketSalon)
    			SceneFilm.addMember(wemo_SocketSalon)
				logInfo("System","Load Timer - Setting SocketSalon as a light")
			}else{
				wemo_lumiere_interieur_etage.removeMember(wemo_SocketSalon)
    			SceneFilm.removeMember(wemo_SocketSalon)
				logInfo("System","Load Timer - Setting Socketsalon as a socket")
			}
			if (CloseOutdoorLight.state != ON && CloseOutdoorLight.state != OFF){
				CloseOutdoorLight.sendCommand(ON)
			}
			delayLoadTimer = null
        ])
		timerLoaded = true
	}
end

Now the error is is the 1st line where I declared the Timer var. It says “The type SystemRules is already defined in system.rules.” This code is the content of system.rules. I’m having this error in all my rules, and everytime, it says the samething with the .rules filename. Any idea on this problem?

THank you

1 Like

It’s a VSC artefact, not a real problem

3 Likes