Short and long press

Perhaps what your looking for is a blueprint to use in an automation. I used this blueprint. If I pressed for less than 1 second on a physical switch which was seen in HA it turned a light on and if I held it for more than 2 seconds it turned the TV on.
Short, long or double click