Confusion with Astro Binding Sunrise and Sunset

I am a new user to openHAB and really like it. I have openHAB 2.2 installed with the Astro binding installed via the paperUI.

I would like a simple rule to turn on some lights at sunset so I started reading how to do it but there seems to be a lot of confusion whether the astro binding has the same functionality it used to have and what work arounds one should use.

Can someone clear this up for me and maybe post a link to an article on how to do this or just explain how to do this with an example?

Thanks for any help you might provide…

1 Like

Hello,

Have a look at this post which may address your queries
It is a Design Pattern, meaning best practice.
If you follow this, you can’t go wrong

Have a go and come back when you have some code, we’ll have a look then if it doesn’t work or you have any problems

Regards
Good luck and more importantly enjoy!

DateTime Sunrise_Time       "Sun Up [%1$tH:%1$tM]"                                { channel="astro:sun:3d94b7e0:rise#start" }
DateTime Sunset_Time        "Sun Down [%1$tH:%1$tM]"                                { channel="astro:sun:3d94b7e0:set#start" }
rule "Sunrise"
	when
		Channel 'astro:sun:3d94b7e0:rise#event' triggered START
	then
	DayLight.postUpdate(ON)
	sendCommand(GarageUteP, OFF)
end


rule "Sunset"
 	when
    	Channel 'astro:sun:3d94b7e0:set#event' triggered START
 	then 
	DayLight.postUpdate(OFF)
	sendCommand(GarageUteP, ON)
end

I have found at sunset times it can sometimes be difficult to see in certain parts of the house (and curtains being closed) and have an offset of -60 mins on my sunset; this also helps in avoiding random toys being left on floors and stepping/kicking them with bare feet. :roll_eyes:

Good job,
Does it work?

You need to change sendCommand(GarageUteP, OFF) to GarageUteP.sendCommand(OFF)
The action sendCommand has a few reserved use cases whereas the item method is recommended when the item is know as is your case here.

I want to thank everyone who responded. Thanks to you I am able to get this working.

Thanks again…
Adam