Google calendar scheduler (openhab.io.gcal) doesn't stop automation on PresenceSimulation = OFF

The Google Calendar scheduler works like a charme: all calendar entries are processed as expected.
So I created weekly recurring events in the Calendar, that switch some of my lights on different days of the week and different times on and off. The calendar is filled for the rest of the year so everytime nobody is at home in the evening, the automation simulates our presence. Perfect!

But now after we came back from our easter holidays I wanted to deactivate the automation. Therefore I set the switch PresenceSimulation to OFF (as I have read in the docs: https://www.openhab.org/addons/integrations/gcal/#presence-simulation).
But the plugin doesn’t stop operating and keeps switching my lights on and off. Any hints for my problem?

These are my log entries after doing a bundle:restart:

2019-04-28 23:33:03.218 [DEBUG] [org.openhab.io.gcal                 ] - BundleEvent STARTING - org.openhab.io.gcal
2019-04-28 23:33:03.242 [DEBUG] [enhab.io.gcal.internal.GCalActivator] - Google Calendar IO has been started.
2019-04-28 23:33:03.339 [DEBUG] [org.openhab.io.gcal                 ] - ServiceEvent REGISTERED - {org.osgi.service.cm.ManagedService}={service.id=428, service.bundleid=232, service.scope=bundle, service.pid=org.openhab.gcal, component.name=org.openhab.binding.gcal.eventdownloader, component.id=272} - org.openhab.io.gcal
2019-04-28 23:33:03.449 [DEBUG] [org.openhab.io.gcal                 ] - BundleEvent STARTED - org.openhab.io.gcal
2019-04-28 23:33:03.602 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - Loaded credential
2019-04-28 23:33:03.615 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device access token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-04-28 23:33:03.618 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device refresh_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-04-28 23:33:03.637 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device expires_in: 1556489663014
2019-04-28 23:33:03.648 [INFO ] [b.core.service.AbstractActiveService] - Google Calendar Event Downloader has been started
2019-04-28 23:33:03.652 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - Got calendar SmartHome CalendarID: xxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com
2019-04-28 23:33:03.655 [DEBUG] [io.gcal.internal.GCalEventDownloader] - Downloading calendar feed for time interval: 2019-04-28T23:33:03.654+02:00 to  2019-04-29T00:03:03.654+02:00
2019-04-28 23:33:03.678 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - Loaded credential
2019-04-28 23:33:03.701 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device access token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-04-28 23:33:03.703 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device refresh_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-04-28 23:33:03.706 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device expires_in: 1556489663014
2019-04-28 23:33:04.304 [DEBUG] [io.gcal.internal.GCalEventDownloader] - found 1 calendar events to process
2019-04-28 23:33:04.321 [DEBUG] [io.gcal.internal.GCalEventDownloader] - created new endJob 'Zimmer E' with details 'SchedulerJob [jobKey=C38E4749-D4A6-4E86-B822-DCBEE870DCA3_end, jobGroup=gcal, 1 triggers=[Sun Apr 28 23:55:00 CEST 2019], content=start {
  send OG_Child_Light 50
}
end {
  send OG_Child_Light 0
}'

I figured out on my own, what the problem here is: It seems as if only calendar entries like this seem to check the “PresenseSimulation” switch:

title: [PresenceSimulation] Schlafzimmer
description: send OG_Bedroom_Light 100

if I use an entry like this, the switch is not tested:

title: [PresenceSimulation] Schlafzimmer
description:
start {
  send OG_Bedroom_Light 100
}
end {
  send OG_Bedroom_Light 0
}

Is this “works as designed” or a bug / missing feature?

That’s correct. It’s by design.

How do you come to this comclusion? And what’s the reason for that?
While looking at the code, I would claim, that it’s a bug. So next step would be to try to fix it - I am still struggeling with the build dependencies, but then I plan to do a pull request to fix it…

The reason is that openHab doesn’t known what the end time is. So if you switch on at E.g. 8pm, there’ll be an entry in your calendar:

8pm-8pm
title: [PresenceSimulation] Light
content: send Light 100

It can’t known when the light turns off (hence the end time is the start time)

If you turn off the light or dim it, there’ll be another entry in your calendar.

I think, you didn’t get my point right: io.gcal supports calendar entries like this:

startTime: 8pm
endTime: 9pm
title:  [PresenceSimulation] Light
content:
start {
  send OG_Bedroom_Light 100
}
end {
  send OG_Bedroom_Light 0
}

The GCal plugin parses this entry into 2 separate cron jobs: One to turn the light on (startTime) and another to turn it off again (endTime). But if you use this syntax for your entries, the “[PresenceSimulation]” detection won’t work at the moment. That’s confusing, especially if you create your PresenceSimulation entries by hand, like I do, and don’t let the google persistence plugin create the entries automatically…

I do understand that, but the presence simulation is not designed to be edited manually. So the tag [PresenceSimulation] only works with a single entry, not with start/end.