Service to change state of an entity

I think it would be handy to have a service that can change the state of an entity, so that it could be used in automations. Sometimes it would be nice to change the state without actually affecting the device. For example, I have a TV that I control in HA through IR, but it can’t read the state, so it would be nice to make an automation that says if something is playing, change state to on.

+1 I also search for something like this