Sunrise and sunset move by more than four hours through the year. A clock time for the curtains is wrong most of the year, and changing it every few weeks is the kind of chore a house should do itself. The Engine calculates sunrise and sunset every day from the latitude and longitude of the home, so this scene never needs a clock time changed.
A sun time can be moved by minutes: sunset - 30 is half an hour before sunset, sunrise + 30 half an hour after sunrise. The lamps come from the Hue agent and the curtains from the Matter agent, and both announce themselves. The holiday variable is the same one the front door example uses, switched from Emma's phone.
Mark cannot hear the doorbell, Sophie can. Sometimes they are both at home, sometimes one of them is out, and sometimes the whole family is on holiday. A doorbell that does the same thing every time is no good to anybody here. This scene lets the house decide, every time somebody comes to the front door, who needs to know and how.
It knows who is home because Mark and Sophie each have a switch "athome" on the remote on their phone, and Emma has the holiday switch. The motion sensor by the door and the lamps come from the Hue agent, the sound from the Sound agent; both announce themselves, so the scene does not have to define them.
Suppose you have a P1 interface connected to your Smart Power Meter in your home and you have written a simple Python script to read it and send messages to the Engine when the average consumption changed in the last minute. You also have a HUE bulb and light strip you use as signal for various event in your home like motion at the front door, time to take your medicine and power consumption of your home.
This script stored in your system folder of your myhome.homylon package could set the tresholds you want to be noticed about.