2019-04-04 22:17:00 WARNING (MainThread) [homeassistant.components.mqtt.binary_sensor] No matching payload found for entity: CM_1 with state_topic: CMS_OUT
You said that you changed the state topic to “CMS _OUT” but the command you ran posts to a topic of “home-assistant/window/contact”. Try running this instead:
What I found (reverse engineered), you have to send available message first and then you will be able to change state. I am not 100% sure, it works for me.
Fix for you:
put those lines back to your configuration.yaml (or other config).
remove value_template: ‘{{ value.x }}’
send mqtt message “online” to your availability topic.