Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Astro binding - Channel 'astro:sun:local:set#event' does not trigger #4018

Closed
DriesA opened this issue Aug 10, 2017 · 17 comments
Closed

Astro binding - Channel 'astro:sun:local:set#event' does not trigger #4018

DriesA opened this issue Aug 10, 2017 · 17 comments

Comments

@DriesA
Copy link

DriesA commented Aug 10, 2017

Dear,
When I was on build #986 (OH 2.2). I freshly installed the Astro binding and made the required settings.

I have the following rule:
`rule "Zonsondergang - nachtverlichting aan"

when
Channel 'astro:sun:local:set#event' triggered START
then
logInfo("Astro","De zon gaat onder. Slaapwel.")
sendCommand(KNX_GV_Nachtverlichting_4_2_0, ON)
end`

It does not get triggered. At midnight I do see this:

2017-08-10 00:00:00.371 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local 2017-08-10 00:00:00.876 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
If I check out the value of my Astro-items, the sun should have risen on 05:50 and will set at 21h37. So the values of all Astro-items are calculated correctly.

My current build is #1003.

It seems I am not the only one with this issue. See this thread on the OpenHAB Community.

Thank you for looking in to this.

@triller-telekom
Copy link
Contributor

Have you tried deleting your caches and restarting openHAB?

sudo rm --recursive /var/lib/openhab2/cache/*
sudo rm --recursive /var/lib/openhab2/tmp/*

Because in the newest snapshots the problem of non firing events in the Astro binding should have been fixed.

@DriesA
Copy link
Author

DriesA commented Aug 15, 2017

Hi,
Thank you for your help.
What I did:


2017-08-15 00:01:24.071 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-moon at midnight for thing astro:moon:local 2017-08-15 00:01:24.080 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-sun at midnight for thing astro:sun:local 2017-08-15 00:01:24.283 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local 2017-08-15 00:01:24.505 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local


I waited for the next morning, expecting the following rule to be triggered:


`rule "Zonsopgang - nachtverlichting uit"

when
Channel 'astro:sun:local:rise#event' triggered START
then
logInfo("Astro","De zon komt op. Goedemorgen.")
sendCommand(KNX_GV_Nachtverlichting_4_2_0, OFF)
end
`


However, the rule is still not triggered.

I run OpenHAB 2.2 on my Synology via chroot.
The astro:sun:local is shown as "online" in my Things in PaperUI.

@ghost
Copy link

ghost commented Aug 24, 2017

This has been going on since #850 I believe and was reported by a lot of folks.
I am on build #1023 now and nothing has improved.
As you can see below the Astro event-jobs get scheduled right before midnight.
I then run a rule at 00:01 to display the new times. I wonder why they display the past day for the upcoming one?
In any case, none of the rules that should run at Civil Dawn or Nautic Dawn get triggered.

23:59:58.916 [INFO ] [rthome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
00:00:15.444 [INFO ] [smarthome.event.ItemStateChangedEvent] - LocalTime_Date changed from 2017-08-23T23:59:15.441-0500 to **2017-08-24T00:00:15.442-0500
00:01:00.004** [INFO ] [.eclipse.smarthome.model.script.event] - Civil dawn: CivilDawn_Time (Type=DateTimeItem, State=**2017-08-23T06:01:00.000-0500**, Label=Civil Dawn, Category=null, Groups=[Astro])
00:01:00.006 [INFO ] [.eclipse.smarthome.model.script.event] - Nautic dawn: NauticDawn_Time (Type=DateTimeItem, State=2017-08-23T05:31:00.000-0500, Label=Nautic Dawn, Category=null, Groups=[Astro])

@Baumi1245
Copy link

Same here... after some time it stops working.
I´m on openHAB 2.2.0 Build #999 at the moment - also the ntp-binding does not show the correct time anymore...

@triller-telekom
Copy link
Contributor

@Baumi1245 Do you have any logs when it last worked and once it stopped? I am especially interested in the time when this happened: [INFO ] [rthome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:YOURNAME

Also that you are saying that the ntp binding is reporting wrong times is interesting. Can you elaborate a bit on this please? In which sense is it wrong? What is the offset?

@DriesA
Copy link
Author

DriesA commented Aug 31, 2017

Hi,
Some more info from my side:

  • The rule never gets triggered, also not directly after restarting OpenHAB. I saw that a potential fix is to schedule the job 30secs after midnight, but I'm not convinced it would be the solution for me. In that case the jobs would be scheduled after rebooting OH and stop running after the first midnight.
  • I also have the NTP binding, and I can say it is showing the correct time.

@triller-telekom
Copy link
Contributor

@DriesA Please have a look on whether the 30seconds hack fixes the issue for your and if not feel free to reopen this issue. Thanks.

@DriesA
Copy link
Author

DriesA commented Aug 31, 2017

I will test! In which build can I expect the fix? The upcoming #1029?

@triller-telekom
Copy link
Contributor

You mean the #1029 build of openHAB? No, it will not be included there. In openHAB it takes until we release a new ESH stable and then the next openHAB build will contain the fix.

But meanwhile you can uninstall the Astro binding via paperui and download the attached zip file and extract the containing jar file into the addons directory. It contains the newest sources as of now.

astro.zip

@Baumi1245
Copy link

Baumi1245 commented Aug 31, 2017

@triller-telekom
Waiting for the next crash... i createt a rule to get notified if the ntp-binding isn´t changing time...

2017-08-29 00:00:00.062 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-29 00:00:00.098 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home

2017-08-30 00:00:00.061 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-30 00:00:00.109 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home

2017-08-30 20:17:56.268 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2017-08-30 20:17:56.504 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-30 20:17:56.540 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds

2017-08-31 00:00:00.095 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 00:00:00.153 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home

2017-08-31 08:22:08.166 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-astro'

2017-08-31 08:23:20.591 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2017-08-31 08:23:20.715 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 08:23:20.722 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds
2017-08-31 08:23:20.802 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 08:23:20.805 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds
2017-08-31 08:23:20.937 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2017-08-31 08:23:21.041 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 08:23:21.046 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds

2017-08-31 08:24:23.063 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-astro'

2017-08-31 08:25:00.584 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2017-08-31 08:25:00.770 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 08:25:00.778 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds
2017-08-31 08:25:00.922 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 08:25:00.931 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds
2017-08-31 08:25:01.038 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2017-08-31 08:25:01.139 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 08:25:01.142 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds

2017-08-31 08:28:58.727 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2017-08-31 08:28:58.985 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-08-31 08:28:59.008 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:home every 300 seconds

Just searched for astro in the log... last crash was around 23:00(30.08.) - ntp stopped.
Astro didn´t fire at 2017-08-31 04:48, which ist the first today....
Installing/uninstalling ntp and astro did not help to get the right ntp-time - had to restart oh.

Could it be, that the Astro-Binding can´t fire if the ntp-binding does not work?
How does the Astro-Binding know, how late it is?

@Baumi1245
Copy link

Here is my setup...

astro:sun:home	"Sun"	@	"home"	[ geolocation="xx.4833,xx.0667,515", interval=300 ] {
    Channels:
    	Type rangeEvent : civilDusk#event [offset=-40]
        Type start		: civilDusk#start [offset=-40]		// Dämmerung
        
        Type rangeEvent : nauticDusk#event [offset=-10]
        Type start		: nauticDusk#start [offset=-10]		// Abend
        
        Type rangeEvent : astroDusk#event [offset=10]
        Type start		: astroDusk#start [offset=10]		// Nacht
        
        Type rangeEvent : astroDawn#event [offset=10]
	Type start		: astroDawn#start [offset=10]		// Frühmorgens
		
	Type rangeEvent : nauticDawn#event [offset=20]
	Type start		: nauticDawn#start [offset=20]		// Morgengrauen
}

astro:moon:home	"Moon"	@	"home"	[ geolocation="xx.4833,xx.0667,515", interval=300 ]

ntp:ntp:home	"Time"	@	"home"	[ hostname="0.pool.ntp.org", refreshInterval=60, refreshNtp=30 ] 

@triller-telekom: Also that you are saying that the ntp binding is reporting wrong times is interesting.

No - no wrong times... it stops!
Therefor i now wrote this, to be informed (ntp refresh 1 Minute, sleep 2 Minutes - testet and working so far):

rule "NTP-Fehler"
when
Time cron "0 0/8 * * * ?"
then
var test = homeTime_string.state
Thread::sleep(120000)
if (test == homeTime_string.state) {pushover ("NTP-Fehler", "Baumi", 0)}
end

Everytime the Astro didn´t trigger, the NTP-time has stopped working.

@DriesA
Copy link
Author

DriesA commented Aug 31, 2017

@triller-telekom : I can confirm the Astro JAR file you provided works, thanks!!

This is what I did:

  • I delete the things “local sun” and “local moon”;
  • I removed the Astro binding installed via PaperUI;
  • I stopped OpenHAB;
  • I deleted the contents of /cache and /tmp;
  • I upgraded to the latest build (A human language interpreter binding interface #1028) (apt-get);
  • I started OpenHAB;
  • I added the jar-file to the addons-file;
  • Two things where found in PaperUI - I added them. Latitude/longitude were prefilled nicely.

@Baumi1245
Copy link

NTP stopped working at 11:53
Last astro log:

2017-09-01 00:00:00.050 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2017-09-01 00:00:00.130 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home

Astro triggert three times today - next trigger is in the evening.
I don´t think, astro ist still working...

@kaikreuzer
Copy link
Contributor

FTR, the latest openHAB distro 1030 includes @triller-telekom's fix.

@ghost
Copy link

ghost commented Sep 2, 2017

I installed 1030 and can confirm that the triggers work as designed (again). @triller-telekom : excellent job!

@kgoderis
Copy link
Contributor

@kaimahnke Could you provide me the necessary .items, .things and alike that I can use to reproduce the problem that some Astro linked jobs are executed ahead of their scheduled time?

@ghost
Copy link

ghost commented Sep 11, 2017

@kgoderis , as mentioned above, everything works fine since build 1030. But I can provide the item and ruel files if it would help you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants