Hi,
OH3.3
For sun_set I have defined an offset of 30 min (within the trigger channel, but also in the start & end datetime channel).
Thats working fine, as per the logs I can see that the trigger is at the correct time / similar to the corresponding item:
2022-10-26 18:46:00.002 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:local:set#event triggered START
2022-10-26 18:50:00.003 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:local:set#event triggered END
However, if I want to get sun_set start / end time via thing action, the offset is ignored.
As I have this for some rules as a condition (only run before / after sun_set), these rules are not running correctly.
Thats the output of the thing action:
2022-10-26 19:53:03.505 [INFO ] [org.openhab.rule.557a41d053 ] - SUN_SET START will happen at: 2022-10-26T18:16+02:00[Europe/Berlin]
2022-10-26 19:53:03.524 [INFO ] [org.openhab.rule.557a41d053 ] - SUN_SET END will happen at: 2022-10-26T18:20+02:00[Europe/Berlin]
Code
var things = Java.type('org.openhab.core.model.script.actions.Things');
var zdt = Java.type('java.time.ZonedDateTime');
var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
var sunEvent = "SUN_SET";
var sunActions = things.getActions('astro', 'astro:sun:local');
var today = zdt.now();
var sunEventTime = sunActions.getEventTime(sunEvent,today,"START");
logger.info("{} START will happen at: {}", sunEvent, sunEventTime.toString());
sunEventTime = sunActions.getEventTime(sunEvent,today,"END");
logger.info("{} END will happen at: {}", sunEvent, sunEventTime.toString());
Question:
Is this expected behavior, that the offset of the channel is ignored when using the thing action?
Do I miss something?
Thanks in advance for any feedback