You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a DateTime Trigger for a rule whith time-only set to false, the rule should not trigger, if the DateTime Items contains a date in the past.
Current Behavior
If the rule contains "1970-01-01 00:00:00", the rule will trigger every 1am in the morning.
It assumes that the date 1970-01-01 means that the rule is time-only. In the edge-case of a user actually sending this date, this is unexpected behavior.
Steps to Reproduce (for Bugs)
A minimal rule to reproduce this looks like the following:
Check your logs and you will see that the rule triggered at 1am in the morning.
Context
When trying to implement an alarmclock-rule that is triggered by a datetime trigger, I stumbled over a behavior, where the time-only flag is not working as expected when using a DateTime trigger. As I could not find a way to reset DateTime-Items to UNDEF, I use 1970-01-01 to express, that no date is selected.
Your Environment
Version used: 4.3
Environment name and version (e.g. Chrome 111, Java 17, Node.js 18.15, ...): Docker Image
Operating System and version (desktop or mobile, Windows 11, Raspbian Bullseye, ...): Debian
The text was updated successfully, but these errors were encountered:
Expected Behavior
When creating a DateTime Trigger for a rule whith time-only set to false, the rule should not trigger, if the DateTime Items contains a date in the past.
Current Behavior
If the rule contains "1970-01-01 00:00:00", the rule will trigger every 1am in the morning.
Possible Solution
I think, the problem is related to this line of code: https://github.com/openhab/openhab-core/blob/12f2314a2d1cbd3157bead4b6de9159bea37275d/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/DateTimeTriggerHandler.java#L180C21-L180C35
It assumes that the date 1970-01-01 means that the rule is time-only. In the edge-case of a user actually sending this date, this is unexpected behavior.
Steps to Reproduce (for Bugs)
A minimal rule to reproduce this looks like the following:
Check your logs and you will see that the rule triggered at 1am in the morning.
Context
When trying to implement an alarmclock-rule that is triggered by a datetime trigger, I stumbled over a behavior, where the time-only flag is not working as expected when using a DateTime trigger. As I could not find a way to reset DateTime-Items to UNDEF, I use 1970-01-01 to express, that no date is selected.
Your Environment
The text was updated successfully, but these errors were encountered: