Why to limit it to startup/shutdown events?
The lightning and air conditioning systems in my dedicated room are triggered depending on status of the player.
With the current implementation I poll the system every 500 ms to know what has changed and define a global state. The polling is pretty resource consuming.
I've different lightning scenes and air conditioning configurations, for example:
- When nothing is playing; lights are on, not fully powered.
- When playing music, I ve a soft ambiance with spots medium (enough to be able to read a book while listening) and led strips with a blue to green ambiance (not yet based on music
)
- When paused during a movie, another ambiance with spots very low and a red ambiance.
- When the movie reaches the last chapter (usually the credentials) the lights starts to dim on after 30 seconds. (by the way, thank for the recent fix on MCWS chapter info, it helps a lot)
I've similar behavior on the air conditioning system especially while playing movie, I hate to watch the beginning of "Gravity" which is an astonishing silence while the air cond is full powered. So the fan mode is off while watching a movie.
Having MC able to run scripts on state change will make all this home automation far easier.