Automation broken

Please edit your post and format it correctly. Don’t use the quote button. Use the </> button (sometimes in settings/cog icon menu on small screens). Or do this: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16