I have a rule for calculating the minutes until sunset, this is quite useful for switching off heavier load items as the day ends and solar power diminishes.
The rule below worked fine with OH2, but with the migration to OH3(I did a clean install) this rule does not work. It is the ONLY thing that does not work with OH3 thus far, which quite impressed me.
Number MinutesUntilSunset "Minutes Until Sunset [%.0f min]"
rule "Minutes Until Sunset" when Time cron "0/30 * * * * ?" then MinutesUntilSunset.postUpdate((new DateTime(Sunset_Time.state.toString).millis - new DateTime(Current_DateTime.state.toString).millis) / 60000) end
I am aware that OH3 now uses Javas native date/time format but I just cannot get my head around it. Any help appreciated!