binary_sensor: - platform: mqtt name: "Movimiento Cocina" value_template: >- {% if value_json.RfReceived.Data == '8B6E9C' %} {{'ON'}} {% elif value_json.RfReceived.Data == '8B6E90' %} {{'OFF'}} {% else %} {{states('binary_sensor.movimiento_cocina') | upper}} {% endif %} device_class: motion state_topic: "sonoffbridge/tele/RESULT" off_delay: 10