OH2 Astro Binding Rule

I have OH2 working on my RPi3 and using Eclipse SmartHome Designer. I have the rule below based on the examples provided in the OH2 tutorial for the Astro Binding, but I’m getting an error in Eclipse that says "no viable alternative at Input ‘Channel’.

rule "Sunset"
when
	Channel 'astro:sun:local:set#start' triggered START
then
	Daylight.sendCommand(OFF)	
end

The virtual switch is defined in my items file as well:

Switch Daylight "Daylight" <sun> (Virtuals)

Good news: You can ignore that :slight_smile:
It’s a flaw in the designer. Your rule will work just fine.

1 Like

I still can’t get “sunset” to turn on my lights. If I use a cron time, the lights will turn on, but they won’t trigger on the rule below.

rule "Lights on at Sunset"
when
	Channel 'astro:sun:local:set#start' triggered START
then
	sendCommand(LightStrips_Right, "240,100,100")
	sendCommand(LightStrips_Left, "240,100,100")
end

I verified the lat and long in the Paper UI for “Local Sun” does match my home.

'astro:sun:local:set#start'

That’s a DateTime channel; it does not trigger a start event, it just updates to the current time for sunset.
Use:

'astro:sun:local:set#event'

This will trigger a start and a stop event. Didn’t notice at first glance.

1 Like

Thanks a million for your help! I’ll update my rule and give it a try!