binary_sensor: - platform: mqtt name: "Movimiento Habitación Noha" value_template: >- {% if value_json.RfReceived.Data == 'DFEF9C' %} {{'ON'}} {% elif value_json.RfReceived.Data == 'DFEF90' %} {{'OFF'}} {% else %} {{states('binary_sensor.movimiento_habitacion_noha') | upper}} {% endif %} device_class: motion state_topic: "sonoffbridge/tele/RESULT" off_delay: 10