Light automation on door sensor and detection

Your automation should be just fine I think
but for now I get this issue:

found character '%' that cannot start any token