Double config of things

Hey,

I’m running OH 2.5.0.M3 so far so good but recently I discovered an issue with the astro binding. Sunrise and sunset are triggered twice hence I did a grep through my config and found these files:

# ls runtime/system/org/openhab/distro/distro-resources/2.5.0.M3/
distro-resources-2.5.0.M3-automation-js.cfg		distro-resources-2.5.0.M3-rules.cfg			 
distro-resources-2.5.0.M3-services-classicui.cfg	distro-resources-2.5.0.M3-things.cfg
distro-resources-2.5.0.M3-items.cfg			distro-resources-2.5.0.M3-scripts.cfg			 
distro-resources-2.5.0.M3-services-logging.cfg		distro-resources-2.5.0.M3-transform-en.cfg
distro-resources-2.5.0.M3-persistence-rrd4j.cfg		distro-resources-2.5.0.M3-services-basicui.cfg		 
distro-resources-2.5.0.M3-sitemaps.cfg

Obiviously the things file mentioned above is interfering my file underneath conf/things directory. Any ideas how to get rid of? Can I just delete these files?!?
thx

For me the Things were automatically define when discovering the Sun & Moon in the Paper UI. Many bindings have deprecated manually creating a Things file as needed for OpenHAB 1.

But there are no things files shown. A things file has extension xxx.things and lives in /things/ folder.

Astro binding does auto discover (generate) some Things named “local”. I just ignore those and create my own Astro Things, referenced with their own names like “myHome”.

May we see the events.log for that?

Hey rossko57,

you can see the things file if you scroll right but meanwhile I deleted the things file. It contained two things only local sun & moon.
Sure I can post my events.log this is an excerpt grepped by astro:

2019-10-31 00:00:27.888 [vent.ChannelTriggeredEvent] - astro:sun:home:morningNight#event triggered START
2019-10-31 00:00:31.118 [vent.ChannelTriggeredEvent] - astro:sun:home:morningNight#event triggered START
2019-10-31 05:32:59.548 [vent.ChannelTriggeredEvent] - astro:sun:home:morningNight#event triggered END
2019-10-31 05:32:59.548 [vent.ChannelTriggeredEvent] - astro:sun:home:astroDawn#event triggered START
2019-10-31 05:32:59.549 [vent.ChannelTriggeredEvent] - astro:sun:home:morningNight#event triggered END
2019-10-31 05:32:59.549 [vent.ChannelTriggeredEvent] - astro:sun:home:astroDawn#event triggered START
2019-10-31 06:10:59.394 [vent.ChannelTriggeredEvent] - astro:sun:home:astroDawn#event triggered END
2019-10-31 06:10:59.395 [vent.ChannelTriggeredEvent] - astro:sun:home:astroDawn#event triggered END
2019-10-31 06:10:59.395 [vent.ChannelTriggeredEvent] - astro:sun:home:nauticDawn#event triggered START
2019-10-31 06:10:59.395 [vent.ChannelTriggeredEvent] - astro:sun:home:nauticDawn#event triggered START
2019-10-31 06:49:59.397 [vent.ChannelTriggeredEvent] - astro:sun:home:nauticDawn#event triggered END
2019-10-31 06:49:59.397 [vent.ChannelTriggeredEvent] - astro:sun:home:nauticDawn#event triggered END
2019-10-31 06:49:59.398 [vent.ChannelTriggeredEvent] - astro:sun:home:civilDawn#event triggered START
2019-10-31 06:49:59.398 [vent.ChannelTriggeredEvent] - astro:sun:home:civilDawn#event triggered START
2019-10-31 07:24:59.333 [vent.ChannelTriggeredEvent] - astro:sun:home:civilDawn#event triggered END
2019-10-31 07:24:59.334 [vent.ChannelTriggeredEvent] - astro:sun:home:rise#event triggered START
2019-10-31 07:24:59.334 [vent.ChannelTriggeredEvent] - astro:sun:home:civilDawn#event triggered END
2019-10-31 07:24:59.335 [vent.ChannelTriggeredEvent] - astro:sun:home:rise#event triggered START
2019-10-31 07:28:59.343 [vent.ChannelTriggeredEvent] - astro:sun:home:daylight#event triggered START
2019-10-31 07:28:59.343 [vent.ChannelTriggeredEvent] - astro:sun:home:rise#event triggered END
2019-10-31 07:28:59.343 [vent.ChannelTriggeredEvent] - astro:sun:home:daylight#event triggered START
2019-10-31 07:28:59.343 [vent.ChannelTriggeredEvent] - astro:sun:home:rise#event triggered END
2019-10-31 12:17:58.827 [vent.ChannelTriggeredEvent] - astro:sun:home:noon#event triggered START
2019-10-31 12:17:58.827 [vent.ChannelTriggeredEvent] - astro:sun:home:noon#event triggered START
2019-10-31 12:18:58.815 [vent.ChannelTriggeredEvent] - astro:sun:home:noon#event triggered END
2019-10-31 12:18:58.816 [vent.ChannelTriggeredEvent] - astro:sun:home:noon#event triggered END

As you can see all these events are triggered twice. I tried to ignore the sun thing found in my inbox which was not even added…no luck.

Okay, all the events are for the Astro “home” Thing, presumably this is what you have configured yourself and nothing to do with “local”.

It appears the binding has set up a duplicate schedule. This may be some unexpected consequence of editing, and go away at next system boot.

This statement is both correct and incorrect at the same time. It’s correct in that many do not recommend manually creating .things files. But this is not deprecated so much as discouraged. No binding developer can unilaterally deprecate .things files as the format and parsers for .things files as that is all implemented and controlled by the core.

There are no Things in openHAB 1.

Thanks for the correction. I have nor studies the ancient history of OH 1. :smiley:

I’ve rebooted OH 2.5.0.M3 but no luck the astro thing is triggered twice. Now I switched back to OH 2.4.0 let’s see if it will fix the trigger.

Just to let you know I’m running OH 2.4.0 now and the astro issue has gone…no more double astro triggers.

Weird. I have run Milestones 2 through 4 with astro and have never had a double trigger issue. I use the Things generated by the system though.
Perhaps you should open an issue on GitHub.

Sure but before raising an issue on github I’ll try to reproduce the error with a fresh install of the latest 2.5.0. Many thanks for feedback.

1 Like

OK. My recent fresh installs do not show the issue if you configure your lat/long for the system in Paper UI and use the discovered Things for local sun and local moon. There may well be a regression when using Thing text files.

Back again. I tested with a fresh install of OH 2.5.0M4. After configuring the astro item in the config *.thing file everything went well:

astro:sun:casa  [ geolocation="51.2338520,6.6085500,50", interval=60 ] {
Channels:
	Type rangeEvent : rise#start [
		earliest="06:45",
		latest="07:30"
	]
	Type rangeEvent : set#end [
		earliest="20:58",
		latest="22:04"
	]
}

The event log was showing one event only but after one day OH discovered an astro item for sun and moon. Both items have NOT been added to my things but after these items were discovered I got every notification twice. Where can I raise a bug for this issue? As you can see the day after the new things have been discovered I got double notifications
See my event.log:

2019-11-17 22:39:33.907 [thome.event.ExtensionEvent] - Extension 'binding-astro' has been installed.
2019-11-18 00:00:30.428 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered START
2019-11-18 05:58:59.460 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDawn#event triggered START
2019-11-18 05:58:59.461 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered END
2019-11-18 06:38:59.316 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDawn#event triggered END
2019-11-18 06:38:59.317 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDawn#event triggered START
2019-11-18 07:18:59.357 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDawn#event triggered END
2019-11-18 07:18:59.358 [vent.ChannelTriggeredEvent] - astro:sun:casa:civilDawn#event triggered START
2019-11-18 07:55:59.287 [vent.ChannelTriggeredEvent] - astro:sun:casa:rise#event triggered START
2019-11-18 07:55:59.288 [vent.ChannelTriggeredEvent] - astro:sun:casa:civilDawn#event triggered END
2019-11-18 07:59:59.286 [vent.ChannelTriggeredEvent] - astro:sun:casa:rise#event triggered END
2019-11-18 07:59:59.286 [vent.ChannelTriggeredEvent] - astro:sun:casa:daylight#event triggered START
2019-11-18 10:40:44.640 [home.event.InboxAddedEvent] - Discovery Result with UID 'astro:sun:local' has been added.
2019-11-18 10:40:44.640 [home.event.InboxAddedEvent] - Discovery Result with UID 'astro:moon:local' has been added.
2019-11-18 12:19:58.805 [vent.ChannelTriggeredEvent] - astro:sun:casa:noon#event triggered START
2019-11-18 12:20:58.804 [vent.ChannelTriggeredEvent] - astro:sun:casa:noon#event triggered END
2019-11-18 16:39:58.207 [vent.ChannelTriggeredEvent] - astro:sun:casa:set#event triggered START
2019-11-18 16:39:58.208 [vent.ChannelTriggeredEvent] - astro:sun:casa:daylight#event triggered END
2019-11-18 16:43:58.340 [vent.ChannelTriggeredEvent] - astro:sun:casa:set#event triggered END
2019-11-18 16:43:58.340 [vent.ChannelTriggeredEvent] - astro:sun:casa:civilDusk#event triggered START
2019-11-18 17:20:58.241 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDusk#event triggered START
2019-11-18 17:20:58.241 [vent.ChannelTriggeredEvent] - astro:sun:casa:civilDusk#event triggered END
2019-11-18 18:01:58.187 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDusk#event triggered START
2019-11-18 18:01:58.187 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDusk#event triggered END
2019-11-18 18:40:58.126 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDusk#event triggered END
2019-11-18 18:40:58.127 [vent.ChannelTriggeredEvent] - astro:sun:casa:eveningNight#event triggered START
2019-11-18 18:40:58.127 [vent.ChannelTriggeredEvent] - astro:sun:casa:night#event triggered START
2019-11-19 00:00:28.002 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered START
2019-11-19 00:00:31.197 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered START
2019-11-19 06:00:59.488 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered END
2019-11-19 06:00:59.489 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDawn#event triggered START
2019-11-19 06:00:59.489 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDawn#event triggered START
2019-11-19 06:00:59.489 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered END
2019-11-19 06:39:59.289 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDawn#event triggered END
2019-11-19 06:39:59.289 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDawn#event triggered START
2019-11-19 06:39:59.290 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDawn#event triggered START
2019-11-19 06:39:59.290 [vent.ChannelTriggeredEvent] - astro:sun:casa:astroDawn#event triggered END
2019-11-19 07:20:59.241 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDawn#event triggered END
2019-11-19 07:20:59.241 [vent.ChannelTriggeredEvent] - astro:sun:casa:civilDawn#event triggered START
2019-11-19 07:20:59.242 [vent.ChannelTriggeredEvent] - astro:sun:casa:civilDawn#event triggered START
2019-11-19 07:20:59.242 [vent.ChannelTriggeredEvent] - astro:sun:casa:nauticDawn#event triggered END
2019-11-19 07:57:59.282 [vent.ChannelTriggeredEvent] - astro:sun:casa:rise#event triggered START
2019-11-19 07:57:59.282 [vent.ChannelTriggeredEvent] - astro:sun:casa:civilDawn#event triggered END
2019-11-19 07:57:59.283 [vent.ChannelTriggeredEvent] - astro:sun:casa:rise#event triggered START

Before raising the issue. Do you have “Auto Approve” turned on under Configuration -> System -> Inbox?If so, then it’s automatically accepting the Thing out of the Inbox because you’ve told it to do so. Disable that and it shouldn’t happen any longer.

Github openHAB2 addons

I think there is something going on here

This might well be connected but is not the direct cause

Note the new Thing UID

2019-11-19 00:00:28.002 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered START
2019-11-19 00:00:31.197 [vent.ChannelTriggeredEvent] - astro:sun:casa:morningNight#event triggered START

The new Thing UID is not involved in the duplicate events.
There are no events for the new Thing UID at all (that is expected unless you link to Items).

As duplicate events begin on the stroke of midnight - when Astro binding sets up events for the day ahead - this really looks like binding is messing up that process.
It may be that it mungles together two sets of Things.

hey rikoshak I don’t use auto approve at all. It’s disable in my runtime.cfg:

# Setting this to true will automatically approve all inbox entries and create Things for them,
# so that they are immediately available in the system (default is false)
#
org.eclipse.smarthome.inbox:autoApprove=false

@rossko57
you’re right. The new thing is not triggering the second notification although it’s a coincidence that the events have been working for 1-2 days but after discovering the new items I got double notification from midnight onwards. Let me check GItHub and raise a bug.

many thanks for your thougts!

I’m sure there are other manifestations of this issue kicking around the forum. It’s not really clear what is going on, as Astro seems to get people in knots with Thing (mis)configuring anyway, and state/event confusion.

It’s not something I’ve seen in OH2.4 but then once setup I don’t tinker with Astro Things - it feels like the editing is behind it, and probably only >2.4 versions. Worth finding out if a “clear cache” chases it away,

Perhaps we’re looking at your unexpected discovery of Things the wrong way - why did that suddenly happen? Suggests the binding has done some kind of reinitializing, but not at midnight or system start?