There seems to be a state / approach missing that HA could help with. Rather than assuming state, it could be derived from other sensors. For example, time of day and Lux level could be used to derive the state of a lamp. Sound level could be used to derive if the TV is on or off.