When my tv turn on I need to check if it was off to at least 15s due to the fact that the integration is not super stable and sometime the sensor randomly switch on => off => on, re-triggering some automations, which is quite annoying.
The template condition {{ as_timestamp(now()) - as_timestamp(states.media_player.smart_tv_salotto.last_changed) >= 15 }} won't work as the automation is triggered when the tv switched from off to on, so it always return false.
Is there a way to check the previous last_changed value?