Sun Elevation rule syntax

Hi everyone,
I have write the above rule

rule “Sunset Dummy Lights ON when Sun Elevation 5° Rule”
when
Item Sun_Elevation changed
then
if
(Sun_Elevation.state < 5|° && Sun_Elevation.state > 4.8|°)
{
Dummy_Lights.sendCommand (ON)
}
end

the point is to switch ON the lights when the sun elevation dropped lower of 5° but in case I’m home and wanted the lights OFF then I added the second part && Sun_Elevation.state > 4.8|° so the lights are not going to switch ON again on the next astro logging, I guess there might be an easier way to run the rule for just one time when the sun is below 5°

Any suggestions would be really appreciated
Thank you.

  • Platform information:
    • Hardware: Raspberry Pi 4B 4GB
    • OS: what OS is used and which version
    • openHAB version:2.5.3-1

Maybe something like this?

rule “Sunset Dummy Lights ON when Sun Elevation 5° Rule”
when
Item Sun_Elevation changed
then
if(Sun_Elevation.state < 5|°){
    Dummy_Lights.sendCommand (ON)
}
else {
    Dummy_Lights.sendCommand (OFF)
}
end

Thank you for your reply,
the thing is that if I switch the lights OFF after the rule runs then at the next sun elevation logging they are going back ON again because the elevation still < 5
Looking for something to fire the rule just once.

Change the < to == so it only happen when elevation is equal to 5° and nothing else.

rule “Sunset Dummy Lights ON when Sun Elevation 5° Rule”
when
Item Sun_Elevation changed
then
if(Sun_Elevation.state == 5|°){
    Dummy_Lights.sendCommand (ON)
}
else {
    Dummy_Lights.sendCommand (OFF)
}
end

Thnaks again,
that’s another thing, the elevation logging will never be 5 exactly,
will be always something like this
Sun_Elevation changed from -8.920637877230362 ° to -9.11411846210004 °

Add a timer to allow elevation to move outside of the limits then execute the commands.

var Timer myTimer = null
rule "Sunset Dummy Lights ON when Sun Elevation 5° Rule"
when
Item Sun_Elevation changed
then
        if(Sun_Elevation.state < 5|° && Sun_Elevation.state > 4.8|°){
            myTimer = createTimer(now.plusMinutes(5))[
            Dummy_Lights.sendCommand (ON)
            ]
            myTimer = null
    }
end
1 Like

Can you give an example?

Was editing post above to add example when you replied. :grin:

In this case I think I’m not going to need the timer because I can wait for the next sun elevation statement and switch OFF the lights without have them switch ON again.
I think there might be a way to fire the rule just once.

You can leave the timer in and add another if statement after the timer expires to make sure the elevation is within your range then execute.

Yes but the way the rule is written now I think is the same thing, the rule can be fired only between 5 and 4.8 degrees.
The point for me is to find the way to remove the second part (the bounder >4.8) and just run fire the rule once after sun elevation 5.

Like this?

var Timer myTimer = null
rule "Sunset Dummy Lights ON when Sun Elevation 5° Rule"
when
Item Sun_Elevation changed
then
        if(Sun_Elevation.state == 5|°){
            myTimer = createTimer(now.plusMinutes(5))[
            Dummy_Lights.sendCommand (ON)
            ]
            myTimer = null
    }
end

Nope,
the rule still in the loop.

I’d use another Item, let’s call it “Nighttime”, which might have uses in other rules.
Don’t be afraid to use several small rules to accomplish tasks.

rule "Set Nighttime"
when
   Item Sun_Elevation changed
then
   if (Sun_Elevation.state < 5|° && Nighttime.state != ON) {
      Nighttime.postUpdate(ON)
   } else if (Nighttime.state != OFF) {
      Nighttime.postUpdate(OFF)
   }
end

rule "Sunset Dummy Lights ON when Sun Elevation 5° Rule"
when
   Item Nighttime changed
then
   if (Nighttime.state == ON) {
      Dummy_Lights.sendCommand (ON)
   } else {
      Dummy_Lights.sendCommand (OFF)
   }
end

The Nightime changed event will happen just twice a day, and at system reboot

1 Like

So here is what I’ve done,

I created an Item first

Switch Nighttime

Then just for optical reasons, I inserted the switch item into my sitemap.

I followed the rule above and the behavior was that the rule normally fired and switched ON the Nighttime switch after the inserted Sun Elevation, then I’m switching OFF the Dummy Lights because let’s say I don’t need them to be ON at the time.
At the second Sun Elevation state update the Nighttime Item switch switched OFF and then at the third Sun Elevation state update Switched back ON, switching ON the Dummy lights again :frowning:
Do I missed something?

What do you mean with the second or third Sun_Elevation.state update? Every xx minutes the Sun_Elevation.state will change. If is becomes a value <5 and Nighttime.state is OFF, it changes Nighttime.state to ON. The next time, when Sun_Elevation.state is again <5 (ex at night), the Nighttime.state won’t change because it is already ON and thus it will not fire the other rule.

So can you please explain when the rules doesn’t do what you expect?

A snip of your events.log would show us what happened.

Something is going on…

2020-03-29 15:13:20.832 [vent.ItemStateChangedEvent] - Sun_Elevation changed from 48.49131975205211 ° to 48.362939660403306 °

2020-03-29 15:13:21.211 [vent.ItemStateChangedEvent] - Nighttime changed from OFF to ON

2020-03-29 15:13:21.215 [ome.event.ItemCommandEvent] - Item ‘Dummy_Lights2’ received command ON

2020-03-29 15:13:21.217 [vent.ItemStateChangedEvent] - Dummy_Lights2 changed from OFF to ON

2020-03-29 15:13:21.811 [ome.event.ItemCommandEvent] - Item ‘Fireplace_Light’ received command ON

2020-03-29 15:13:21.857 [ome.event.ItemCommandEvent] - Item ‘Fireplace_Light_Dimm’ received command 100

2020-03-29 15:13:21.858 [nt.ItemStatePredictedEvent] - Fireplace_Light predicted to become ON

2020-03-29 15:13:21.875 [ome.event.ItemCommandEvent] - Item ‘Bar_Light’ received command ON

2020-03-29 15:13:21.884 [ome.event.ItemCommandEvent] - Item ‘Bar_Light_Dimm’ received command 100

2020-03-29 15:13:21.886 [nt.ItemStatePredictedEvent] - Fireplace_Light_Dimm predicted to become 100

2020-03-29 15:13:21.895 [vent.ItemStateChangedEvent] - Fireplace_Light changed from OFF to ON

2020-03-29 15:13:21.897 [nt.ItemStatePredictedEvent] - Bar_Light predicted to become ON

2020-03-29 15:13:21.904 [nt.ItemStatePredictedEvent] - Bar_Light_Dimm predicted to become 100

2020-03-29 15:13:21.913 [vent.ItemStateChangedEvent] - Fireplace_Light_Dimm changed from 0 to 100

2020-03-29 15:13:21.915 [vent.ItemStateChangedEvent] - Bar_Light changed from OFF to ON

2020-03-29 15:13:21.917 [vent.ItemStateChangedEvent] - Bar_Light_Dimm changed from 0 to 100

2020-03-29 15:13:22.445 [vent.ChannelTriggeredEvent] - shelly:shellydimmer:f3d4ee:device#event triggered LIGHT0_OUT_ON

2020-03-29 15:13:22.461 [vent.ChannelTriggeredEvent] - shelly:shellydimmer:f3ede7:device#event triggered LIGHT0_OUT_ON

2020-03-29 15:13:23.972 [vent.ItemStateChangedEvent] - Date changed from 2020-03-29T15:12:23.968+0300 to 2020-03-29T15:13:23.969+0300

2020-03-29 15:14:07.402 [ome.event.ItemCommandEvent] - Item ‘Fireplace_Light’ received command OFF

2020-03-29 15:14:07.405 [nt.ItemStatePredictedEvent] - Fireplace_Light predicted to become OFF

2020-03-29 15:14:07.418 [vent.ItemStateChangedEvent] - Fireplace_Light changed from ON to OFF

2020-03-29 15:14:07.938 [vent.ChannelTriggeredEvent] - shelly:shellydimmer:f3d4ee:device#event triggered LIGHT0_OUT_OFF

2020-03-29 15:14:08.140 [ome.event.ItemCommandEvent] - Item ‘Bar_Light’ received command OFF

2020-03-29 15:14:08.142 [nt.ItemStatePredictedEvent] - Bar_Light predicted to become OFF

2020-03-29 15:14:08.149 [vent.ItemStateChangedEvent] - Bar_Light changed from ON to OFF

2020-03-29 15:14:08.668 [vent.ChannelTriggeredEvent] - shelly:shellydimmer:f3ede7:device#event triggered LIGHT0_OUT_OFF

2020-03-29 15:14:10.056 [vent.ItemStateChangedEvent] - Fireplace_Light_Dimm changed from 100 to 0

2020-03-29 15:14:10.086 [vent.ItemStateChangedEvent] - Bar_Light_Dimm changed from 100 to 0

2020-03-29 15:14:20.775 [vent.ItemStateChangedEvent] - Sun_Azimuth changed from 220.8281641860582 ° to 221.14899594900965 °

2020-03-29 15:14:20.777 [vent.ItemStateChangedEvent] - Sun_Elevation changed from 48.362939660403306 ° to 48.23371633894458 °

2020-03-29 15:14:20.795 [vent.ItemStateChangedEvent] - Nighttime changed from ON to OFF

2020-03-29 15:14:20.798 [ome.event.ItemCommandEvent] - Item ‘Dummy_Lights2’ received command OFF

2020-03-29 15:14:20.802 [vent.ItemStateChangedEvent] - Dummy_Lights2 changed from ON to OFF

2020-03-29 15:14:23.976 [vent.ItemStateChangedEvent] - Date changed from 2020-03-29T15:13:23.969+0300 to 2020-03-29T15:14:23.970+0300

==> /var/log/openhab2/openhab.log <==

2020-03-29 15:15:01.075 [ERROR] [ersey.server.ServerRuntime$Responder] - An I/O error has occurred while writing a response message entity to the container output stream.

org.glassfish.jersey.server.internal.process.MappableException: org.eclipse.jetty.io.EofException

at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:92) ~[?:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130) ~[bundleFile:?]

at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711) [bundleFile:?]

at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444) [bundleFile:?]

at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434) [bundleFile:?]

at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329) [bundleFile:?]

at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [bundleFile:?]

at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [bundleFile:?]

at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [bundleFile:?]

at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [bundleFile:?]

at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [bundleFile:?]

at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [bundleFile:?]

at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [bundleFile:?]

at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [bundleFile:?]

at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [bundleFile:?]

at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [bundleFile:?]

at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [bundleFile:?]

at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [bundleFile:?]

at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [bundleFile:?]

at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [bundleFile:?]

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544) [bundleFile:9.4.20.v20190813]

at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [bundleFile:?]

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307) [bundleFile:9.4.20.v20190813]

at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) [bundleFile:?]

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [bundleFile:9.4.20.v20190813]

at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [bundleFile:?]

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.Server.handle(Server.java:494) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

Caused by: org.eclipse.jetty.io.EofException

at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:283) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:277) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:812) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:549) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:852) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:929) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:250) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:226) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:551) ~[bundleFile:9.4.20.v20190813]

at java.io.OutputStream.write(OutputStream.java:75) ~[?:1.8.0_222]

at org.glassfish.jersey.servlet.internal.ResponseWriter$NonCloseableOutputStreamWrapper.write(ResponseWriter.java:320) ~[?:?]

at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:218) ~[bundleFile:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:294) ~[bundleFile:?]

at org.eclipse.smarthome.io.rest.core.internal.GsonProvider.writeTo(GsonProvider.java:71) ~[?:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265) ~[bundleFile:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250) ~[bundleFile:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106) ~[?:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86) ~[?:?]

… 53 more

Caused by: java.io.IOException: Broken pipe

at sun.nio.ch.FileDispatcherImpl.writev0(Native Method) ~[?:1.8.0_222]

at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51) ~[?:1.8.0_222]

at sun.nio.ch.IOUtil.write(IOUtil.java:148) ~[?:1.8.0_222]

at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504) ~[?:1.8.0_222]

at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:263) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:277) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:812) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:549) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:852) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:929) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:250) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:226) ~[bundleFile:9.4.20.v20190813]

at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:551) ~[bundleFile:9.4.20.v20190813]

at java.io.OutputStream.write(OutputStream.java:75) ~[?:1.8.0_222]

at org.glassfish.jersey.servlet.internal.ResponseWriter$NonCloseableOutputStreamWrapper.write(ResponseWriter.java:320) ~[?:?]

at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:218) ~[bundleFile:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:294) ~[bundleFile:?]

at org.eclipse.smarthome.io.rest.core.internal.GsonProvider.writeTo(GsonProvider.java:71) ~[?:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265) ~[bundleFile:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250) ~[bundleFile:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106) ~[?:?]

at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86) ~[?:?]

… 53 more

==> /var/log/openhab2/events.log <==

2020-03-29 15:15:20.835 [vent.ItemStateChangedEvent] - Sun_Azimuth changed from 221.14899594900965 ° to 221.46858750144662 °

2020-03-29 15:15:20.838 [vent.ItemStateChangedEvent] - Sun_Elevation changed from 48.23371633894458 ° to 48.10352745890094 °

2020-03-29 15:15:20.853 [vent.ItemStateChangedEvent] - Nighttime changed from OFF to ON

2020-03-29 15:15:20.859 [ome.event.ItemCommandEvent] - Item ‘Dummy_Lights2’ received command ON

2020-03-29 15:15:20.870 [vent.ItemStateChangedEvent] - Dummy_Lights2 changed from OFF to ON

2020-03-29 15:15:20.883 [ome.event.ItemCommandEvent] - Item ‘Fireplace_Light’ received command ON

2020-03-29 15:15:20.902 [ome.event.ItemCommandEvent] - Item ‘Fireplace_Light_Dimm’ received command 100

2020-03-29 15:15:20.914 [ome.event.ItemCommandEvent] - Item ‘Bar_Light’ received command ON

2020-03-29 15:15:20.965 [ome.event.ItemCommandEvent] - Item ‘Bar_Light_Dimm’ received command 100

2020-03-29 15:15:20.968 [nt.ItemStatePredictedEvent] - Fireplace_Light predicted to become ON

2020-03-29 15:15:20.980 [nt.ItemStatePredictedEvent] - Fireplace_Light_Dimm predicted to become 100

2020-03-29 15:15:20.990 [nt.ItemStatePredictedEvent] - Bar_Light predicted to become ON

2020-03-29 15:15:21.004 [nt.ItemStatePredictedEvent] - Bar_Light_Dimm predicted to become 100

2020-03-29 15:15:21.018 [vent.ItemStateChangedEvent] - Fireplace_Light changed from OFF to ON

2020-03-29 15:15:21.021 [vent.ItemStateChangedEvent] - Fireplace_Light_Dimm changed from 0 to 100

2020-03-29 15:15:21.032 [vent.ItemStateChangedEvent] - Bar_Light changed from OFF to ON

2020-03-29 15:15:21.036 [vent.ItemStateChangedEvent] - Bar_Light_Dimm changed from 0 to 100

2020-03-29 15:15:21.524 [vent.ChannelTriggeredEvent] - shelly:shellydimmer:f3d4ee:device#event triggered LIGHT0_OUT_ON

2020-03-29 15:15:21.556 [vent.ChannelTriggeredEvent] - shelly:shellydimmer:f3ede7:device#event triggered LIGHT0_OUT_ON

Okay, the logs relevant to the rules

2020-03-29 15:13:20.832 [vent.ItemStateChangedEvent] - Sun_Elevation changed from 48.49131975205211 ° to 48.362939660403306 °
2020-03-29 15:13:21.211 [vent.ItemStateChangedEvent] - Nighttime changed from OFF to ON
2020-03-29 15:13:21.215 [ome.event.ItemCommandEvent] - Item ‘Dummy_Lights2’ received command ON
2020-03-29 15:13:21.217 [vent.ItemStateChangedEvent] - Dummy_Lights2 changed from OFF to ON
2020-03-29 15:14:20.777 [vent.ItemStateChangedEvent] - Sun_Elevation changed from 48.362939660403306 ° to 48.23371633894458 °
2020-03-29 15:14:20.795 [vent.ItemStateChangedEvent] - Nighttime changed from ON to OFF
2020-03-29 15:14:20.798 [ome.event.ItemCommandEvent] - Item ‘Dummy_Lights2’ received command OFF

My rule contains a logic error, of course …

   if (Sun_Elevation.state < 5|° && Nighttime.state != ON) {
      Nighttime.postUpdate(ON)
   } else if (Sun_Elevation.state >= 5|° && Nighttime.state != OFF) {
      Nighttime.postUpdate(OFF)
   }

“glassfish / jersey” errors are usually something about a UI. A sitemap error, or a UI browser not refreshed since a reboot, or similar.

1 Like

That was it!!!
Many many thanks.
I couldn’t figure it out without your all help.