import java.util.Random
var Timer timer = null
val resList = newArrayList("640/480", "320/240", "480/360")
val urlList = newArrayList("https://www.fillmurray.com", "https://www.fillmurray.com/g",
"https://www.placecage.com", "https://www.placecage.com/c", "https://www.placecage.com/g")
val Random random = new Random()
rule "Trigger Garage Door"
when
Item VIR_IN_GarageDoorSwitch changed to ON
then
if(VIR_IN_GarageDoorSwitch.state == ON)
{
sendCommand(Switch_GarageS2, ON)
createTimer(now.plusSeconds(5)) [|Switch_GarageS2.sendCommand(OFF)]
logInfo("Trigger Garage Door.rules", "Garage Door rule has triggered")
}
VIR_IN_GarageDoorSwitch.postUpdate(OFF)
end
rule "Garage Door Open"
when
Item Switch_GarageOC changed from OFF to ON
then
sendCommand(Switch_GarageL, ON)
sendCommand(Switch_TableL, ON)
logInfo("Trigger Garage Door.rules", "Garage Door Open rule has triggered")
end
rule "Garage Door Closed"
when
Item Switch_GarageOC changed from ON to OFF
then
sendCommand(Switch_GarageL, OFF)
sendCommand(Switch_TableL, OFF)
logInfo("Trigger Garage Door.rules", "Garage Door Closed rule has triggered")
end
rule "Evening Lighthouse On"
when
Channel 'astro:sun:local:set#event' triggered START
then
sendCommand(Switch_Lighthouse, ON)
sendCommand(Switch_China, ON)
logInfo("Evening ", "Lighthouse & China Cabinet on at Civil Dusk")
end
rule "Evening Lighthouse Off"
when
Time cron "0 30 22 ? * * *"
then
sendCommand(Switch_Lighthouse, OFF)
sendCommand(Switch_China, OFF)
logInfo("Evening ", "Lighthouse & China Cabinet off at 10:30PM")
end
rule "Monday-Thurday Morning WakeUp"
when
Time cron "0 44 4 ? * MON,TUE,WED,THU *"
then
/*Monday - Thursday Wakeup*/
sendCommand(Switch_Overhead, ON)
sendCommand(Switch_TableL, ON)
logInfo("Morning", "Monday - Thursday Morning Wakeup on at 4:44AM")
end
rule "Friday Morning WakeUp"
when
Time cron "0 30 5 ? * FRI *"
then
/*Friday Wakeup*/
sendCommand(Switch_Overhead, ON)
sendCommand(Switch_TableL, ON)
logInfo("Morning", "Friday Morning Wakeup on at 5:30AM")
end
rule "Morning WakeUp Lights Off"
when
Time cron "0 15 6 ? * MON,TUE,WED,THU,FRI *"
then
/*WakeUp Lights Off*/
sendCommand(Switch_Overhead, OFF)
sendCommand(Switch_TableL, OFF)
logInfo("Morning", "Monday - Friday Morning Wakeup Lights Off at 6:15AM")
end
rule "Everyday Morning Lighthouse On"
when
Time cron "0 50 4 ? * * *"
then
/*Everyday Morning Lighthouse On*/
sendCommand(Switch_Lighthouse, ON)
logInfo("Morning", "Everyday 4:50AM Lighthouse On")
end
rule "Everyday Morning Lighthouse Off"
when
Time cron "0 30 5 ? * * *"
then
/*Everyday Morning Lighthouse Off*/
sendCommand(Switch_Lighthouse, OFF)
logInfo("Morning", "Everyday 5:30AM Lighthouse Off")
end
// vim: syntax=Xtend
You are saying the same thing as I.
All I can say, is since I upgraded to the latest version of Visual studio, the first line of my rules file always has the double underlined, indicating an error on the line. Its only my Rules file and you can see the content of the entire file above.
I honestly cannot see an error. So, I thought I would ask before rebooting the Raspberry PI.
Another strange thing is,
If I comment out the first line, the double underline error indicator drops to the second line.
If I comment out the first and second lines, the double underline error indicator drops to the third line.
Can anyone see something I am missing?
I’d appreciate it.
Bill
Rules demo.rules (Wrench graphic)DemoRules.astro_sun_local_zodiac_sign
The type DemoRules is already defined in demo.rules.(org.eclipse.xtext.xbase.validation.IssueCodes.duplicate_type)
Quick Fix button responds;
No code action available
I had this problem and resolved it, the cause was that when I selected ‘Add Folder to Workspace’ I selected the root OH folder. When I removed this folder from the Workspace and then added the ‘conf’ sub-folder only the problem went away
I found the problem. The other day, I created a ‘Backup’ directory in the root of OH. At the time, I did not think making a ‘Backup’ directory here would be a problem. Just by coincidence Visual Studio updated at the same time.
When I moved the Backup directory off the RaspberryPI to another drive on my PC. Low-and-behold my problem disappeared.
Thanks Folks.
Lesson Learned; Do NOT play with the OH root directory.
Good job Bill!
please mark the post which helped you solve the problem and the thread as solved by adding [SOLVED] to beginning of thread title to help others who might encounter a similar problem