I currently have some rules whit actions to be triggered at a time with an offset to the current time (or sunset/sunrise time). Doing this, one has to take into account that minute- and/or hour values can over- or underflow. Currently this is done with IF - OR constructions, but in situations where both minutes and hours could over- or underflow this is leading to rather complex rules.

Situations like this could be handled much easier using DIV (integer division) and MOD (modulus) operators.

Simple example:

Current rule:

With MOD and DIV

This rule would work with any value added to or subtracted from hours and or minutes. So I would be very pleased if the DIV and MOD operators could be added.

Situations like this could be handled much easier using DIV (integer division) and MOD (modulus) operators.

Simple example:

Current rule:

Code:

`IF ((datetime.minute - 30) >= 0 AND sunriseset.sunset == (datetime.hour + (datetime.minute - 30) / 100)) OR ((datetime.minute - 30) < 0 AND sunriseset.sunset == (datetime.hour - 1) + (datetime.minute - 30 + 60) / 100) THEN ...`

Code:

`IF (datetime.hour + ((datetime.minute - 30) DIV 60 ) MOD 24) + (((datetime.minute -30) MOD 60) /100) == sunrise.sunset THEN ...`