eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
863 stars 782 forks source link

Startup rule "system started" fired multiple times #2966

Closed stefaanbolle closed 6 years ago

stefaanbolle commented 7 years ago

I have defined a rule which should only run once when system is started on a RPI3 running OH2.0 stable. I notice that after each reboot or restart of OH2 this rules is fired multiple times.

Is this a possible bug with the System started trigger mechanism? Below my rule (simplified)

rule "System started"
when
System started
then
var Timer waitTimer = null

SystemStarting.sendCommand(ON)
logDebug("startup", "System started")
waitTimer = createTimer(now.plusMinutes(4)) [|
  LichtenUit.sendCommand(OFF)
  Thread::sleep(10)
  LichtenAan.sendCommand(OFF)
  Thread::sleep(10)
  Sfeerlicht.sendCommand(OFF)
  Thread::sleep(100)
  SystemStarting.sendCommand(OFF)
  logDebug("startup", "Rule System starting ended")
  logDebug("startup", "System is ready!")
    ]

end

The log gives:

2017-02-02 19:00:06.121 [INFO ] [ore.internal.i18n.LocaleProviderImpl] - Locale set to en_GB 2017-02-02 19:00:28.409 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.items' 2017-02-02 19:00:33.346 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mqtt.persist' 2017-02-02 19:00:33.713 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rrd4j.persist' 2017-02-02 19:00:33.752 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mapdb.persist' 2017-02-02 19:00:50.863 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'startup.rules' 2017-02-02 19:00:55.139 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.sitemap' 2017-02-02 19:00:56.834 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.things' 2017-02-02 19:01:00.944 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start 2017-02-02 19:01:06.317 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed uninstalling 'openhab-transformation-regex': Feature named 'openhab-transformation-regex/0.0.0' is not installed 2017-02-02 19:01:06.713 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed uninstalling 'openhab-misc-gcal1': Feature named 'openhab-misc-gcal1/0.0.0' is not installed 2017-02-02 19:01:08.787 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app 2017-02-02 19:01:08.915 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui 2017-02-02 19:01:09.064 [INFO ] [egram.internal.TelegramActionService] - Bot messenger loaded from config file 2017-02-02 19:01:20.035 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-moon at midnight for thing astro:moon:local 2017-02-02 19:01:20.054 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-positional with interval of 60 seconds for thing astro:moon:local 2017-02-02 19:01:20.087 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-sun at midnight for thing astro:sun:local 2017-02-02 19:01:20.092 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-positional with interval of 60 seconds for thing astro:sun:local 2017-02-02 19:01:48.923 [DEBUG] [lipse.smarthome.model.script.startup] - System started 2017-02-02 19:01:50.783 [INFO ] [.astro.internal.job.AbstractDailyJob] - Scheduled astro event-jobs for thing astro:moon:local 2017-02-02 19:01:50.816 [INFO ] [.astro.internal.job.AbstractDailyJob] - Scheduled astro event-jobs for thing astro:sun:local 2017-02-02 19:01:53.218 [INFO ] [rvice.dhcp.ReceiveDHCPRequestPackets] - DHCP request packet listener online 2017-02-02 19:01:53.728 [INFO ] [eather.internal.common.WeatherConfig] - ProviderConfig[providerName=WUNDERGROUND,apiKey=xxx 2017-02-02 19:01:53.730 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=WUNDERGROUND,language=en,updateInterval=60,latitude=xx,longitude=xx,woeid=,locationId=xx,name=xx] 2017-02-02 19:01:56.821 [ERROR] [platform.linux.LinuxCentralProcessor] - Couldn't find physical processor count. Assuming 1. 2017-02-02 19:01:56.853 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Starting and scheduling weatherJob-xx with interval of 60 minutesx 2017-02-02 19:01:57.030 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.link.ThingLinkManager@1814155' takes more than 5000ms. 2017-02-02 19:02:12.400 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin 2017-02-02 19:02:12.618 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel 2017-02-02 19:02:13.405 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app 2017-02-02 19:03:32.357 [INFO ] [kobus.internal.core.NikobusInterface] - Connected to serial port '/dev/ttyUSB0' 2017-02-02 19:03:32.564 [INFO ] [kobus.internal.core.NikobusInterface] - Connected to Nikobus :-) 2017-02-02 19:04:33.986 [DEBUG] [lipse.smarthome.model.script.startup] - System started 2017-02-02 19:05:48.974 [DEBUG] [lipse.smarthome.model.script.startup] - Rule System starting started 2017-02-02 19:05:48.983 [DEBUG] [lipse.smarthome.model.script.startup] - SystemStarting = ON 2017-02-02 19:06:37.214 [DEBUG] [lipse.smarthome.model.script.startup] - Rule System starting ended 2017-02-02 19:06:37.216 [DEBUG] [lipse.smarthome.model.script.startup] - System is ready! 2017-02-02 19:08:33.991 [DEBUG] [lipse.smarthome.model.script.startup] - Rule System starting started 2017-02-02 19:08:33.996 [DEBUG] [lipse.smarthome.model.script.startup] - SystemStarting = OFF 2017-02-02 19:08:36.610 [DEBUG] [lipse.smarthome.model.script.startup] - SystemStarting = OFF 2017-02-02 19:08:36.612 [DEBUG] [lipse.smarthome.model.script.startup] - Rule System starting ended 2017-02-02 19:08:36.614 [DEBUG] [lipse.smarthome.model.script.startup] - System is ready!

triller-telekom commented 6 years ago

Although this issue is older than #5188 I guess we can close it as a duplicate since the discussion has started over in #5188.

@kaikreuzer Can you please close this issue?