Your original question has been answered; use a State Trigger.
Your follow-up post indicates you have already attempted but failed to create a functional automation. Post the automation in YAML format (refer to guideline 11 in the FAQ).
Your original question has been answered; use a State Trigger.
Your follow-up post indicates you have already attempted but failed to create a functional automation. Post the automation in YAML format (refer to guideline 11 in the FAQ).