Hello experts! I´m struggeling with a rule and handling DateTime items!
My automower is providing an Item PlannerNextStart. At the moment the items state is “2024-03-27T08:00:00.000+0100”.
I want to write a rule that opens my automowers garage door 2 minutes before the mower starts to mow. How to calculate this minus 2 minutes? I really can´t make any progress as this is my first attempt to calculate with DateTime items!
Can the automower be started from openHAB, or does it have to be scheduled in the proprietary app?
If you can start it from openHAB, then you can have all of the logic in one place (rather than split between two different systems. Your rule would be triggered at the times you define, open the garage door, and then start the automower.
The main benefit of this is that OH can make sure the door is open before starting the automower. Otherwise, you could have a scenario where your OH server is offline and doesn’t open the door. Your automower isn’t going to know that, though I assume it’s smart enough to not run into the door.
I guess you are right. In Visual Studio Code the color for “timeOnly” was the same like for the item.
I moved it into the next row and now its colored white.
Ok the offset calculation is working fine. But I realized that the timezone is obviously wrong? Next start says 10:32, Garage Door Item says 10:30 - but it´s +1h ahead! It should be 09:30 instead.
The timezon is setup correctly in the regional settings for openhab. Any idea how to fix this? I tried offset 3720 (so 1 hour + 2 minutes) which didn´t work at all.
Short update: The trigger is working but it get´s executed every day. My mower is not mowing every day but every second! So I guess this is because of the “timeOnly”.
I will remove it and try again.
@jimtng The trigger wasn´t working without calculating the offset manually. Anyhow I´m close to finish my rule. Thank you