Firstly please format your yaml code so it can be read easily.
Next always try to use entities rather than devices in triggers.