Make sensor which is detect specific 'ERROR' log in Add-on log file

Bro, I wanna make the sensor which is detect specific log word in log file.
And finally detecing error in log, the automation will perform the restart add-on command.
I’m entry level of making code.
So I get assist from the chat GPT.
The configuration yaml is below

#Bestin Addon 로그 감지 센서
sensor:

  • platform: command_line
    name: Bestin Add-on Log Monitor
    command: >
    today=$(date +‘%Y-%m-%d’);
    grep -i ‘ERROR’ /share/bestin/logs/${today}.log || echo “No Match”
    scan_interval: 1800>

    but the sensod was not created.
    could anyone help me??