Astro 2 question

Getting ready to convert from Astro1 to Astro2. The readme is a little confusing. Do I need to create a new thing file for the sun and moon configuration?

Wouldn’t it be more in line with OH2 (if this is the case) to have lat/long configured in a binding configuration section in Paper UI and have the binding automatically generate sun/moon things?

No, just click on the plus sign, select astro and you will find two new things in your inbox.

Also possible: PaperUI -> Configuration -> Astro sun or moon data -> edit -> type in your geolocation.

Ok, figured it out. Found out after much clicking you must set the lat/long by editing the individual thing info. I guess it works if you want to have this based on another location but it does seem kind of clunky.

One last question, I’m trying to set up my rule as in the readme and have the following:

rule "Lights on at Sunset"
    Channel 'astro:sun:home:set#event' triggered START
	if(LightsOnAtSunset.state==ON) {
		sendCommand(FrontDoorLight, ON)
		sendCommand(FrontDoorDecorations, ON)
		sendCommand(FoyerLanternLoadLevelStatus, 30)
		sendCommand(MasonJarLight, ON)
		sendCommand(PlantAccent, ON)
		sendCommand(GreatRoomFrontWindowPlug, ON)
		sendCommand(GreatRoomSideWindowPlug, ON)
		sendCommand(DiningRoomFrontWindowPlug, ON)
		sendCommand(MasterBedroomFrontWindowPlug, ON)
		sendCommand(NathanRoomFrontWindowPlug, ON)
		sendCommand(OfficePlug, ON)
		sendCommand(FoyerPlug, ON)
		say("Evening has fallen, time for children to return to their homes.")

Eclipse designer is balking at the use of “Channel” as an input. Is this the case of Designer not being in line with the current version of ESH or is there really an issue with the rule?


What did you expect? Autodetection of your geo location? I did not want to have that in any software :grinning:

Well, the rule didn’t fire this evening. Reading over the readme again… do I need to change #event to start? So the “when” portion of the rule would read:

Channel 'astro:sun:home:set#start' triggered START

Well, in fact:

The {@link AstroDiscoveryService} tries to automatically discover the geolocation based on the internet IP address.


    Channel 'astro:sun:home:set#event' triggered START

worked for me.

Maybe your things file has a wrong syntax?

astro:sun:home [ geolocation="53.yyyyyy,7.xxxxxx", interval=300]

Also you might try to show the time on your sitemap to verify:

DateTime Sunset_Time "Sunset [%1$tH:%1$tM]" <sunset> { channel="astro:sun:home:set#start" }

Text item=Sunset_Time

The default channel after installation afaik is “astro:sun:local” and not “astro:sun:home”. Maybe that’s the problem? Have a look in the Paper UI -> Configuration -> Things.

1 Like

The docs example is astro:sun:home, when you do it through PaperUI it’s astro:sun:local.
As long as both (things and channels) have the same wording it should be okay.

Hence my confusion… you just told me a few posts above that I didn’t need a thing file. Bit by the Paper UI/ non-Paper UI confusion bug.

That’s probably it then… I’m not at home to look right now but since I created the thing via Paper UI but copied the example from the binding readme I’m assuming the channel labeling is incorrect.

You don’t NEED it but you may USE it :grinning:

Yepp, I guess …

That could be the solution …

Props to Doc! The channel label via Paper UI is different than the readme of the binding. Changed to “local” and it fired tonight.

Question is, is this by design or is it a typo/oversight within the binding? Is there any reason why they would be different?

In his example Gerhard defined the thing manually in his config file as “astro:sun:home”, so he refers to that in the item config.

I get that (now), but for someone researching and not an expert in OH this can cause a lot of confusion. I think (unless there is a reason for it) it would make a lot more sense in the examples for the channels to be defined the same way in both methods.