Get item.name for switch function

There is no simple way to determine which Item caused a rule to trigger. There is a hack you can use in most circumstances which involves:

- All Items you want to find need to be in a group
- Persistence needs to be set up on those Items
- The members of the group cannot be triggered at the same time

With this you can:

Thread::sleep(100) // give persistence time to catch up
val triggerItem = gTimeOfDayEvents.members.sortBy[lastUpdate].last
switch(triggerItem.name) {
...

I will also point you to this approach for implementing tracking of Time of Day.

I started off with an approach very similar to yours. I found that approach ends up being relatively inflexible and scales poorly when you want to add more times of day and/or have more and more rules which care about time of day.