first try with the forum's help at https://community.home-assistant.io/t/automation-what-is-wrong-here/78267